]> git.mjollnir.org Git - moodle.git/commitdiff
Upgraded the YUI libs to version 0.12.0, released 14 Nov 2006.
authorvyshane <vyshane>
Thu, 23 Nov 2006 03:10:20 +0000 (03:10 +0000)
committervyshane <vyshane>
Thu, 23 Nov 2006 03:10:20 +0000 (03:10 +0000)
79 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/autocomplete/README
lib/yui/autocomplete/autocomplete-debug.js
lib/yui/autocomplete/autocomplete-min.js
lib/yui/autocomplete/autocomplete.js
lib/yui/calendar/README
lib/yui/calendar/assets/calendar.css
lib/yui/calendar/calendar-debug.js
lib/yui/calendar/calendar-min.js
lib/yui/calendar/calendar.js
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.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/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/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/grids/README
lib/yui/grids/grids-min.css
lib/yui/grids/grids.css
lib/yui/logger/README
lib/yui/logger/assets/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.css
lib/yui/menu/menu-debug.js
lib/yui/menu/menu-min.js
lib/yui/menu/menu.js
lib/yui/reset-fonts-grids/README [new file with mode: 0755]
lib/yui/reset-fonts-grids/reset-fonts-grids-min.css [new file with mode: 0755]
lib/yui/reset-fonts-grids/reset-fonts-grids.css [new file with mode: 0755]
lib/yui/reset/README
lib/yui/reset/reset-min.css
lib/yui/reset/reset.css
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 [new file with mode: 0755]
lib/yui/tabview/tabview-debug.js [new file with mode: 0755]
lib/yui/tabview/tabview-min.js [new file with mode: 0755]
lib/yui/tabview/tabview.js [new file with mode: 0755]
lib/yui/treeview/README
lib/yui/treeview/assets/tree.css
lib/yui/treeview/treeview-debug.js
lib/yui/treeview/treeview-min.js
lib/yui/treeview/treeview.js
lib/yui/yahoo-dom-event/README [new file with mode: 0755]
lib/yui/yahoo-dom-event/yahoo-dom-event.js [new file with mode: 0755]
lib/yui/yahoo/README
lib/yui/yahoo/yahoo-debug.js
lib/yui/yahoo/yahoo-min.js
lib/yui/yahoo/yahoo.js

index e67ccb8228b3b3293a0671a8c2797945bfd808bb..ea9fdf57e74a724108221fa7a2c42234d43ce3cc 100644 (file)
@@ -5,4 +5,5 @@ from:
         http://developer.yahoo.com/yui
 
 
-Added to Moodle 13th July, 2006
+Added to Moodle 13 July 2006
+Updated to YUI 0.12.0, 23 November 2006
index 0dad5425d11bbc48a1b6cf79aa7245bd1acbb2a1..e0f99516e1d3017a034901fbce65a9b83f4385d5 100755 (executable)
@@ -1,5 +1,18 @@
 Animation Release Notes\r
 \r
+*** version 0.12.0 ***\r
+\r
+* added boolean finish argument to Anim.stop()\r
+\r
+*** version 0.11.3 ***\r
+\r
+* no changes\r
+\r
+*** version 0.11.1 ***\r
+\r
+* changed "prototype" shorthand to "proto" (workaround firefox < 1.5 scoping\r
+bug)\r
+\r
 *** version 0.11.0 ***\r
 \r
 * ColorAnim subclass added\r
@@ -10,7 +23,7 @@ Animation Release Notes
 \r
 *** version 0.10.0 ***\r
 \r
-* Scroll now handles relative ("by") animation correctly \r
+* Scroll now handles relative ("by") animation correctly\r
 \r
 * Now converts "auto" values of "from" to appropriate initial values\r
 \r
@@ -18,3 +31,4 @@ Animation Release Notes
 \r
 * Initial release\r
 \r
+\r
index 7b9320dcd034834ba7b3fd6241c33a5f4ad712dc..1a4c89c33dd67501c6e15af5a58ec50754ae411a 100755 (executable)
@@ -2,21 +2,27 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version: 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
+/**\r
+ * The animation module provides allows effects to be added to HTMLElements.\r
+ * @module animation\r
+ */\r
+\r
 /**\r
  *\r
- * Base class for animated DOM objects.\r
- * @class Base animation class that provides the interface for building animated effects.\r
+ * Base animation class that provides the interface for building animated effects.\r
  * <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>\r
+ * @class Anim\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
  * @constructor\r
- * @param {String or HTMLElement} el Reference to the element that will be animated\r
+ * @param {String | HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -33,8 +39,9 @@ YAHOO.util.Anim = function(el, attributes, duration, method) {
 \r
 YAHOO.util.Anim.prototype = {\r
    /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
+    * Provides a readable name for the Anim instance.\r
+    * @method toString\r
+    * @return {String}\r
     */\r
    toString: function() {\r
       var el = this.getEl();\r
@@ -51,6 +58,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns the value computed by the animation's "method".\r
+    * @method doMethod\r
     * @param {String} attr The name of the attribute.\r
     * @param {Number} start The value this attribute should start from for this animation.\r
     * @param {Number} end  The value this attribute should end at for this animation.\r
@@ -61,7 +69,8 @@ YAHOO.util.Anim.prototype = {
    },\r
 \r
    /**\r
-    * Applies a value to an attribute\r
+    * Applies a value to an attribute.\r
+    * @method setAttribute\r
     * @param {String} attr The name of the attribute.\r
     * @param {Number} val The value to be applied to the attribute.\r
     * @param {String} unit The unit ('px', '%', etc.) of the value.\r
@@ -76,6 +85,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns current value of the attribute.\r
+    * @method getAttribute\r
     * @param {String} attr The name of the attribute.\r
     * @return {Number} val The current value of the attribute.\r
     */\r
@@ -103,7 +113,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns the unit to use when none is supplied.\r
-    * Applies the "defaultUnit" test to decide whether to use pixels or not\r
+    * @method getDefaultUnit\r
     * @param {attr} attr The name of the attribute.\r
     * @return {String} The default unit to be used.\r
     */\r
@@ -117,6 +127,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Sets the actual values to be used during the animation.\r
+    * @method setRuntimeAttribute\r
     * Should only be needed for subclass use.\r
     * @param {Object} attr The attribute object\r
     * @private\r
@@ -160,7 +171,9 @@ YAHOO.util.Anim.prototype = {
    },\r
 \r
    /**\r
-    * @param {String or HTMLElement} el Reference to the element that will be animated\r
+    * Constructor for Anim instance.\r
+    * @method init\r
+    * @param {String | HTMLElement} el Reference to the element that will be animated\r
     * @param {Object} attributes The attribute(s) to be animated.\r
     * Each attribute is an object with at minimum a "to" or "by" member defined.\r
     * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -171,6 +184,7 @@ YAHOO.util.Anim.prototype = {
    init: function(el, attributes, duration, method) {\r
       /**\r
        * Whether or not the animation is running.\r
+       * @property isAnimated\r
        * @private\r
        * @type Boolean\r
        */\r
@@ -178,6 +192,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * A Date object that is created when the animation begins.\r
+       * @property startTime\r
        * @private\r
        * @type Date\r
        */\r
@@ -185,6 +200,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * The number of frames this animation was able to execute.\r
+       * @property actualFrames\r
        * @private\r
        * @type Int\r
        */\r
@@ -192,6 +208,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * The element to be animated.\r
+       * @property el\r
        * @private\r
        * @type HTMLElement\r
        */\r
@@ -203,14 +220,15 @@ YAHOO.util.Anim.prototype = {
        * If "to" is supplied, the animation will end with the attribute at that value.\r
        * If "by" is supplied, the animation will end at that value plus its starting value.\r
        * If both are supplied, "to" is used, and "by" is ignored.\r
-       * @member YAHOO#util#Anim\r
        * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values).\r
+       * @property attributes\r
        * @type Object\r
        */\r
       this.attributes = attributes || {};\r
 \r
       /**\r
        * The length of the animation.  Defaults to "1" (second).\r
+       * @property duration\r
        * @type Number\r
        */\r
       this.duration = duration || 1;\r
@@ -218,6 +236,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The method that will provide values to the attribute(s) during the animation.\r
        * Defaults to "YAHOO.util.Easing.easeNone".\r
+       * @property method\r
        * @type Function\r
        */\r
       this.method = method || YAHOO.util.Easing.easeNone;\r
@@ -225,6 +244,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Whether or not the duration should be treated as seconds.\r
        * Defaults to true.\r
+       * @property useSeconds\r
        * @type Boolean\r
        */\r
       this.useSeconds = true; // default to seconds\r
@@ -232,6 +252,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The location of the current animation on the timeline.\r
        * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.\r
+       * @property currentFrame\r
        * @type Int\r
        */\r
       this.currentFrame = 0;\r
@@ -239,6 +260,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The total number of frames to be executed.\r
        * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.\r
+       * @property totalFrames\r
        * @type Int\r
        */\r
       this.totalFrames = YAHOO.util.AnimMgr.fps;\r
@@ -246,12 +268,14 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Returns a reference to the animated element.\r
+       * @method getEl\r
        * @return {HTMLElement}\r
        */\r
       this.getEl = function() { return el; };\r
 \r
       /**\r
        * Checks whether the element is currently animated.\r
+       * @method isAnimated\r
        * @return {Boolean} current value of isAnimated.\r
        */\r
       this.isAnimated = function() {\r
@@ -260,6 +284,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Returns the animation start time.\r
+       * @method getStartTime\r
        * @return {Date} current value of startTime.\r
        */\r
       this.getStartTime = function() {\r
@@ -275,6 +300,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Starts the animation by registering it with the animation manager.\r
+       * @method animate\r
        */\r
       this.animate = function() {\r
          if ( this.isAnimated() ) { return false; }\r
@@ -288,13 +314,21 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Stops the animation.  Normally called by AnimMgr when animation completes.\r
+       * @method stop\r
+       * @param {Boolean} finish (optional) If true, animation will jump to final frame.\r
        */\r
-      this.stop = function() {\r
+      this.stop = function(finish) {\r
+         if (finish) {\r
+             this.currentFrame = this.totalFrames;\r
+             this._onTween.fire();\r
+         }\r
          YAHOO.util.AnimMgr.stop(this);\r
       };\r
 \r
       var onStart = function() {\r
          this.onStart.fire();\r
+\r
+         this.runtimeAttributes = {};\r
          for (var attr in this.attributes) {\r
             this.setRuntimeAttribute(attr);\r
          }\r
@@ -364,12 +398,14 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Custom event that fires when animation begins\r
        * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)\r
+       * @event onStart\r
        */\r
       this.onStart = new YAHOO.util.CustomEvent('start', this);\r
 \r
       /**\r
        * Custom event that fires between each frame\r
        * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)\r
+       * @event onTween\r
        */\r
       this.onTween = new YAHOO.util.CustomEvent('tween', this);\r
 \r
@@ -382,6 +418,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Custom event that fires when animation ends\r
        * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)\r
+       * @event onComplete\r
        */\r
       this.onComplete = new YAHOO.util.CustomEvent('complete', this);\r
       /**\r
@@ -396,20 +433,16 @@ YAHOO.util.Anim.prototype = {
    }\r
 };\r
 \r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Handles animation queueing and threading.\r
+ * Handles animation queueing and threading.\r
  * Used by Anim and subclasses.\r
+ * @class AnimMgr\r
+ * @namespace YAHOO.util\r
  */\r
 YAHOO.util.AnimMgr = new function() {\r
    /**\r
-    * Reference to the animation Interval\r
+    * Reference to the animation Interval.\r
+    * @property thread\r
     * @private\r
     * @type Int\r
     */\r
@@ -417,6 +450,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * The current queue of registered animation objects.\r
+    * @property queue\r
     * @private\r
     * @type Array\r
     */\r
@@ -424,6 +458,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * The number of active animations.\r
+    * @property tweenCount\r
     * @private\r
     * @type Int\r
     */\r
@@ -432,6 +467,7 @@ YAHOO.util.AnimMgr = new function() {
    /**\r
     * Base frame rate (frames per second).\r
     * Arbitrarily high for better x-browser calibration (slower browsers drop more frames).\r
+    * @property fps\r
     * @type Int\r
     *\r
     */\r
@@ -439,6 +475,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Interval delay in milliseconds, defaults to fastest possible.\r
+    * @property delay\r
     * @type Int\r
     *\r
     */\r
@@ -447,6 +484,7 @@ YAHOO.util.AnimMgr = new function() {
    /**\r
     * Adds an animation instance to the animation queue.\r
     * All animation instances must be registered in order to animate.\r
+    * @method registerElement\r
     * @param {object} tween The Anim instance to be be registered\r
     */\r
    this.registerElement = function(tween) {\r
@@ -456,6 +494,14 @@ YAHOO.util.AnimMgr = new function() {
       this.start();\r
    };\r
 \r
+   /**\r
+    * removes an animation instance from the animation queue.\r
+    * All animation instances must be registered in order to animate.\r
+    * @method unRegister\r
+    * @param {object} tween The Anim instance to be be registered\r
+    * @param {Int} index The index of the Anim instance\r
+    * @private\r
+    */\r
    this.unRegister = function(tween, index) {\r
       tween._onComplete.fire();\r
       index = index || getIndex(tween);\r
@@ -467,7 +513,8 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Starts the animation thread.\r
-        * Only one thread can run at a time.\r
+       * Only one thread can run at a time.\r
+    * @method start\r
     */\r
    this.start = function() {\r
       if (thread === null) { thread = setInterval(this.run, this.delay); }\r
@@ -475,6 +522,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Stops the animation thread or a specific animation instance.\r
+    * @method stop\r
     * @param {object} tween A specific Anim instance to stop (optional)\r
     * If no instance given, Manager stops thread and all animations.\r
     */\r
@@ -497,6 +545,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Called per Interval to handle each animation frame.\r
+    * @method run\r
     */\r
    this.run = function() {\r
       for (var i = 0, len = queue.length; i < len; ++i) {\r
@@ -527,6 +576,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * On the fly frame correction to keep animation on time.\r
+    * @method correctFrame\r
     * @private\r
     * @param {Object} tween The Anim instance being corrected.\r
     */\r
@@ -551,16 +601,10 @@ YAHOO.util.AnimMgr = new function() {
       }\r
    };\r
 };\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- *\r
- * @class Used to calculate Bezier splines for any number of control points.\r
+ * Used to calculate Bezier splines for any number of control points.\r
+ * @class Bezier\r
+ * @namespace YAHOO.util\r
  *\r
  */\r
 YAHOO.util.Bezier = new function()\r
@@ -571,6 +615,7 @@ YAHOO.util.Bezier = new function()
     * At least 2 points are required (start and end).\r
     * First point is start. Last point is end.\r
     * Additional control points are optional.\r
+    * @method getPosition\r
     * @param {Array} points An array containing Bezier points\r
     * @param {Number} t A number between 0 and 1 which is the basis for determining current position\r
     * @return {Array} An array containing int x and y member data\r
@@ -596,9 +641,11 @@ YAHOO.util.Bezier = new function()
    };\r
 };\r
 /**\r
- * @class ColorAnim subclass for color fading\r
- * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code></p>\r
- * <p>Color values can be specified with either 112233, #112233, [255,255,255], or rgb(255,255,255)\r
+ * Anim subclass for color transitions.\r
+ * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,\r
+ * [255,255,255], or rgb(255,255,255)</p>\r
+ * @class ColorAnim\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -606,13 +653,14 @@ YAHOO.util.Bezier = new function()
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @constructor\r
+ * @extends YAHOO.util.Anim\r
  * @param {HTMLElement | String} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
  * All attribute names use camelCase.\r
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
- * @param {Function} method (optional, defaults to Y.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a Y.Easing method)\r
+ * @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)\r
  */\r
 (function() {\r
    YAHOO.util.ColorAnim = function(el, attributes, duration,  method) {\r
@@ -624,33 +672,27 @@ YAHOO.util.Bezier = new function()
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.ColorAnim.superclass;\r
-   var prototype = Y.ColorAnim.prototype;\r
+   var proto = Y.ColorAnim.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("ColorAnim " + id);\r
    };\r
 \r
-   /**\r
-    * Only certain attributes should be treated as colors.\r
-    * @type Object\r
-    */\r
-   prototype.patterns.color = /color$/i;\r
-   prototype.patterns.rgb    = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;\r
-   prototype.patterns.hex    = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;\r
-   prototype.patterns.hex3   = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;\r
+   proto.patterns.color = /color$/i;\r
+   proto.patterns.rgb         = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;\r
+   proto.patterns.hex         = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;\r
+   proto.patterns.hex3        = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;\r
+   proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari\r
 \r
    /**\r
     * Attempts to parse the given string and return a 3-tuple.\r
+    * @method parseColor\r
     * @param {String} s The string to parse.\r
     * @return {Array} The 3-tuple of rgb values.\r
     */\r
-   prototype.parseColor = function(s) {\r
+   proto.parseColor = function(s) {\r
       if (s.length == 3) { return s; }\r
 \r
       var c = this.patterns.hex.exec(s);\r
@@ -671,25 +713,20 @@ YAHOO.util.Bezier = new function()
       return null;\r
    };\r
 \r
-   /**\r
-    * Returns current value of the attribute.\r
-    * @param {String} attr The name of the attribute.\r
-    * @return {Number} val The current value of the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       var el = this.getEl();\r
       if (  this.patterns.color.test(attr) ) {\r
          var val = YAHOO.util.Dom.getStyle(el, attr);\r
 \r
-         if (val == 'transparent') { // bgcolor default\r
+         if (this.patterns.transparent.test(val)) { // bgcolor default\r
             var parent = el.parentNode; // try and get from an ancestor\r
             val = Y.Dom.getStyle(parent, attr);\r
 \r
-            while (parent && val == 'transparent') {\r
+            while (parent && this.patterns.transparent.test(val)) {\r
                parent = parent.parentNode;\r
                val = Y.Dom.getStyle(parent, attr);\r
                if (parent.tagName.toUpperCase() == 'HTML') {\r
-                  val = 'ffffff';\r
+                  val = '#fff';\r
                }\r
             }\r
          }\r
@@ -700,14 +737,7 @@ YAHOO.util.Bezier = new function()
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val;\r
 \r
       if ( this.patterns.color.test(attr) ) {\r
@@ -725,13 +755,7 @@ YAHOO.util.Bezier = new function()
       return val;\r
    };\r
 \r
-   /**\r
-    * Sets the actual values to be used during the animation.\r
-    * Should only be needed for subclass use.\r
-    * @param {Object} attr The attribute object\r
-    * @private\r
-    */\r
-   prototype.setRuntimeAttribute = function(attr) {\r
+   proto.setRuntimeAttribute = function(attr) {\r
       superclass.setRuntimeAttribute.call(this, attr);\r
 \r
       if ( this.patterns.color.test(attr) ) {\r
@@ -754,27 +778,33 @@ YAHOO.util.Bezier = new function()
 })();/*\r
 TERMS OF USE - EASING EQUATIONS\r
 Open source under the BSD License.\r
-Copyright Â© 2001 Robert Penner All rights reserved.\r
+Copyright 2001 Robert Penner All rights reserved.\r
 \r
 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
 \r
   * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
   * 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.\r
   * 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.\r
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
+ * 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.\r
+ * 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.\r
 \r
 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.\r
+*/\r
 \r
+/**\r
+ * Singleton that determines how an animation proceeds from start to end.\r
+ * @class Easing\r
+ * @namespace YAHOO.util\r
 */\r
 \r
 YAHOO.util.Easing = {\r
 \r
    /**\r
     * Uniform speed between points.\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeNone\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeNone: function (t, b, c, d) {\r
        return c*t/d + b;\r
@@ -782,11 +812,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and accelerates towards end. (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeIn: function (t, b, c, d) {\r
        return c*(t/=d)*t + b;\r
@@ -794,11 +825,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins quickly and decelerates towards end.  (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeOut: function (t, b, c, d) {\r
        return -c *(t/=d)*(t-2) + b;\r
@@ -806,11 +838,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and decelerates towards end. (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeBoth: function (t, b, c, d) {\r
        if ((t/=d/2) < 1) return c/2*t*t + b;\r
@@ -819,11 +852,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and accelerates towards end. (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeInStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeInStrong: function (t, b, c, d) {\r
        return c*(t/=d)*t*t*t + b;\r
@@ -831,11 +865,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins quickly and decelerates towards end.  (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeOutStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeOutStrong: function (t, b, c, d) {\r
        return -c * ((t=t/d-1)*t*t*t - 1) + b;\r
@@ -843,11 +878,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and decelerates towards end. (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeBothStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeBothStrong: function (t, b, c, d) {\r
        if ((t/=d/2) < 1) return c/2*t*t*t*t + b;\r
@@ -855,13 +891,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap in elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap in elastic effect.\r
+    * @method elasticIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
 \r
    elasticIn: function (t, b, c, d, a, p) {\r
@@ -872,13 +909,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap out elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap out elastic effect.\r
+    * @method elasticOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    elasticOut: function (t, b, c, d, a, p) {\r
        if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;\r
@@ -888,13 +926,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap both elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap both elastic effect.\r
+    * @method elasticBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    elasticBoth: function (t, b, c, d, a, p) {\r
        if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);\r
@@ -906,13 +945,14 @@ YAHOO.util.Easing = {
 \r
 \r
    /**\r
-    * back easing in - backtracking slightly, then reversing direction and moving to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Backtracks slightly, then reverses direction and moves to end.\r
+    * @method backIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backIn: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -920,14 +960,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * back easing out - moving towards target, overshooting it slightly,\r
-    * then reversing and coming back to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Overshoots end, then reverses and comes back to end.\r
+    * @method backOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backOut: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -935,14 +975,15 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * back easing in/out - backtracking slightly, then reversing direction and moving to target,\r
-    * then overshooting target, reversing, and finally coming back to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Backtracks slightly, then reverses direction, overshoots end,\r
+    * then reverses and comes back to end.\r
+    * @method backBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backBoth: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -951,24 +992,26 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * bounce in\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounce off of start.\r
+    * @method bounceIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceIn: function (t, b, c, d) {\r
        return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;\r
    },\r
 \r
    /**\r
-    * bounce out\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounces off end.\r
+    * @method bounceOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceOut: function (t, b, c, d) {\r
        if ((t/=d) < (1/2.75)) {\r
@@ -983,12 +1026,13 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * bounce both\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounces off start and end.\r
+    * @method bounceBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceBoth: function (t, b, c, d) {\r
        if (t < d/2) return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;\r
@@ -996,16 +1040,12 @@ YAHOO.util.Easing = {
    }\r
 };\r
 \r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Anim subclass for moving elements along a path defined by the "points" member of "attributes".  All "points" are arrays with x, y coordinates.\r
+ * Anim subclass for moving elements along a path defined by the "points"\r
+ * member of "attributes".  All "points" are arrays with x, y coordinates.\r
  * <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>\r
+ * @class Motion\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -1014,7 +1054,8 @@ Version: 0.10.0
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
  * @constructor\r
- * @param {String or HTMLElement} el Reference to the element that will be animated\r
+ * @extends YAHOO.util.Anim\r
+ * @param {String | HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -1034,27 +1075,17 @@ Version: 0.10.0
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.Motion.superclass;\r
-   var prototype = Y.Motion.prototype;\r
+   var proto = Y.Motion.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("Motion " + id);\r
    };\r
 \r
-   prototype.patterns.points = /^points$/i;\r
+   proto.patterns.points = /^points$/i;\r
 \r
-   /**\r
-    * Applies a value to an attribute\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} val The value to be applied to the attribute.\r
-    * @param {String} unit The unit ('px', '%', etc.) of the value.\r
-    */\r
-   prototype.setAttribute = function(attr, val, unit) {\r
+   proto.setAttribute = function(attr, val, unit) {\r
       if (  this.patterns.points.test(attr) ) {\r
          unit = unit || 'px';\r
          superclass.setAttribute.call(this, 'left', val[0], unit);\r
@@ -1064,12 +1095,7 @@ Version: 0.10.0
       }\r
    };\r
 \r
-   /**\r
-    * Sets the default value to be used when "from" is not supplied.\r
-    * @param {String} attr The attribute being set.\r
-    * @param {Number} val The default value to be applied to the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       if (  this.patterns.points.test(attr) ) {\r
          var val = [\r
             superclass.getAttribute.call(this, 'left'),\r
@@ -1082,14 +1108,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val = null;\r
 \r
       if ( this.patterns.points.test(attr) ) {\r
@@ -1101,13 +1120,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Sets the actual values to be used during the animation.\r
-    * Should only be needed for subclass use.\r
-    * @param {Object} attr The attribute object\r
-    * @private\r
-    */\r
-   prototype.setRuntimeAttribute = function(attr) {\r
+   proto.setRuntimeAttribute = function(attr) {\r
       if ( this.patterns.points.test(attr) ) {\r
          var el = this.getEl();\r
          var attributes = this.attributes;\r
@@ -1179,16 +1192,12 @@ Version: 0.10.0
       return (typeof prop !== 'undefined');\r
    };\r
 })();\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Anim subclass for scrolling elements to a position defined by the "scroll" member of "attributes".  All "scroll" members are arrays with x, y scroll positions.\r
+ * Anim subclass for scrolling elements to a position defined by the "scroll"\r
+ * member of "attributes".  All "scroll" members are arrays with x, y scroll positions.\r
  * <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>\r
+ * @class Scroll\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -1196,6 +1205,7 @@ Version: 0.10.0
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
+ * @extends YAHOO.util.Anim\r
  * @constructor\r
  * @param {String or HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
@@ -1217,26 +1227,15 @@ Version: 0.10.0
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.Scroll.superclass;\r
-   var prototype = Y.Scroll.prototype;\r
+   var proto = Y.Scroll.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("Scroll " + id);\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val = null;\r
 \r
       if (attr == 'scroll') {\r
@@ -1251,12 +1250,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns current value of the attribute.\r
-    * @param {String} attr The name of the attribute.\r
-    * @return {Number} val The current value of the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       var val = null;\r
       var el = this.getEl();\r
 \r
@@ -1269,13 +1263,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Applies a value to an attribute\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} val The value to be applied to the attribute.\r
-    * @param {String} unit The unit ('px', '%', etc.) of the value.\r
-    */\r
-   prototype.setAttribute = function(attr, val, unit) {\r
+   proto.setAttribute = function(attr, val, unit) {\r
       var el = this.getEl();\r
 \r
       if (attr == 'scroll') {\r
index bbea1cc643e7b36a7d063e20fe17a85b10408a96..353f3a3783ba51587eaf92cbaab706ed8e70a94e 100755 (executable)
@@ -1 +1 @@
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt Version: 0.11.0*/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;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];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},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=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;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;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(){YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();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=200;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){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};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[i].isAnimated()){this.unRegister(tween,i);}}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 prototype=Y.ColorAnim.prototype;prototype.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};prototype.patterns.color=/color$/i;prototype.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;prototype.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;prototype.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;prototype.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;};prototype.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(val=='transparent'){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&val=='transparent'){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='ffffff';}}}}else{val=superclass.getAttribute.call(this,attr);}return val;};prototype.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;};prototype.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;}else{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 prototype=Y.Motion.prototype;prototype.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};prototype.patterns.points=/^points$/i;prototype.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);}};prototype.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;};prototype.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;};prototype.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 prototype=Y.Scroll.prototype;prototype.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};prototype.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;};prototype.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;};prototype.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);}};})();\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0 */ 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;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];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},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=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;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;YAHOO.util.AnimMgr.registerElement(this);};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=200;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){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};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[i].isAnimated()){this.unRegister(tween,i);}}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;}else{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);}};})();
\ No newline at end of file
index 5f2f9d14cc6b8ca6b979c8b51563969f79cda355..333f946903df29b352c19455e6630541bedd8007 100755 (executable)
@@ -2,21 +2,27 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version: 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
+/**\r
+ * The animation module provides allows effects to be added to HTMLElements.\r
+ * @module animation\r
+ */\r
+\r
 /**\r
  *\r
- * Base class for animated DOM objects.\r
- * @class Base animation class that provides the interface for building animated effects.\r
+ * Base animation class that provides the interface for building animated effects.\r
  * <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>\r
+ * @class Anim\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
  * @constructor\r
- * @param {String or HTMLElement} el Reference to the element that will be animated\r
+ * @param {String | HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -33,8 +39,9 @@ YAHOO.util.Anim = function(el, attributes, duration, method) {
 \r
 YAHOO.util.Anim.prototype = {\r
    /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
+    * Provides a readable name for the Anim instance.\r
+    * @method toString\r
+    * @return {String}\r
     */\r
    toString: function() {\r
       var el = this.getEl();\r
@@ -51,6 +58,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns the value computed by the animation's "method".\r
+    * @method doMethod\r
     * @param {String} attr The name of the attribute.\r
     * @param {Number} start The value this attribute should start from for this animation.\r
     * @param {Number} end  The value this attribute should end at for this animation.\r
@@ -61,7 +69,8 @@ YAHOO.util.Anim.prototype = {
    },\r
 \r
    /**\r
-    * Applies a value to an attribute\r
+    * Applies a value to an attribute.\r
+    * @method setAttribute\r
     * @param {String} attr The name of the attribute.\r
     * @param {Number} val The value to be applied to the attribute.\r
     * @param {String} unit The unit ('px', '%', etc.) of the value.\r
@@ -76,6 +85,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns current value of the attribute.\r
+    * @method getAttribute\r
     * @param {String} attr The name of the attribute.\r
     * @return {Number} val The current value of the attribute.\r
     */\r
@@ -103,7 +113,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Returns the unit to use when none is supplied.\r
-    * Applies the "defaultUnit" test to decide whether to use pixels or not\r
+    * @method getDefaultUnit\r
     * @param {attr} attr The name of the attribute.\r
     * @return {String} The default unit to be used.\r
     */\r
@@ -117,6 +127,7 @@ YAHOO.util.Anim.prototype = {
 \r
    /**\r
     * Sets the actual values to be used during the animation.\r
+    * @method setRuntimeAttribute\r
     * Should only be needed for subclass use.\r
     * @param {Object} attr The attribute object\r
     * @private\r
@@ -160,7 +171,9 @@ YAHOO.util.Anim.prototype = {
    },\r
 \r
    /**\r
-    * @param {String or HTMLElement} el Reference to the element that will be animated\r
+    * Constructor for Anim instance.\r
+    * @method init\r
+    * @param {String | HTMLElement} el Reference to the element that will be animated\r
     * @param {Object} attributes The attribute(s) to be animated.\r
     * Each attribute is an object with at minimum a "to" or "by" member defined.\r
     * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -171,6 +184,7 @@ YAHOO.util.Anim.prototype = {
    init: function(el, attributes, duration, method) {\r
       /**\r
        * Whether or not the animation is running.\r
+       * @property isAnimated\r
        * @private\r
        * @type Boolean\r
        */\r
@@ -178,6 +192,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * A Date object that is created when the animation begins.\r
+       * @property startTime\r
        * @private\r
        * @type Date\r
        */\r
@@ -185,6 +200,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * The number of frames this animation was able to execute.\r
+       * @property actualFrames\r
        * @private\r
        * @type Int\r
        */\r
@@ -192,6 +208,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * The element to be animated.\r
+       * @property el\r
        * @private\r
        * @type HTMLElement\r
        */\r
@@ -203,14 +220,15 @@ YAHOO.util.Anim.prototype = {
        * If "to" is supplied, the animation will end with the attribute at that value.\r
        * If "by" is supplied, the animation will end at that value plus its starting value.\r
        * If both are supplied, "to" is used, and "by" is ignored.\r
-       * @member YAHOO#util#Anim\r
        * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values).\r
+       * @property attributes\r
        * @type Object\r
        */\r
       this.attributes = attributes || {};\r
 \r
       /**\r
        * The length of the animation.  Defaults to "1" (second).\r
+       * @property duration\r
        * @type Number\r
        */\r
       this.duration = duration || 1;\r
@@ -218,6 +236,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The method that will provide values to the attribute(s) during the animation.\r
        * Defaults to "YAHOO.util.Easing.easeNone".\r
+       * @property method\r
        * @type Function\r
        */\r
       this.method = method || YAHOO.util.Easing.easeNone;\r
@@ -225,6 +244,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Whether or not the duration should be treated as seconds.\r
        * Defaults to true.\r
+       * @property useSeconds\r
        * @type Boolean\r
        */\r
       this.useSeconds = true; // default to seconds\r
@@ -232,6 +252,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The location of the current animation on the timeline.\r
        * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.\r
+       * @property currentFrame\r
        * @type Int\r
        */\r
       this.currentFrame = 0;\r
@@ -239,6 +260,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * The total number of frames to be executed.\r
        * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.\r
+       * @property totalFrames\r
        * @type Int\r
        */\r
       this.totalFrames = YAHOO.util.AnimMgr.fps;\r
@@ -246,12 +268,14 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Returns a reference to the animated element.\r
+       * @method getEl\r
        * @return {HTMLElement}\r
        */\r
       this.getEl = function() { return el; };\r
 \r
       /**\r
        * Checks whether the element is currently animated.\r
+       * @method isAnimated\r
        * @return {Boolean} current value of isAnimated.\r
        */\r
       this.isAnimated = function() {\r
@@ -260,6 +284,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Returns the animation start time.\r
+       * @method getStartTime\r
        * @return {Date} current value of startTime.\r
        */\r
       this.getStartTime = function() {\r
@@ -272,6 +297,7 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Starts the animation by registering it with the animation manager.\r
+       * @method animate\r
        */\r
       this.animate = function() {\r
          if ( this.isAnimated() ) { return false; }\r
@@ -285,13 +311,21 @@ YAHOO.util.Anim.prototype = {
 \r
       /**\r
        * Stops the animation.  Normally called by AnimMgr when animation completes.\r
+       * @method stop\r
+       * @param {Boolean} finish (optional) If true, animation will jump to final frame.\r
        */\r
-      this.stop = function() {\r
+      this.stop = function(finish) {\r
+         if (finish) {\r
+             this.currentFrame = this.totalFrames;\r
+             this._onTween.fire();\r
+         }\r
          YAHOO.util.AnimMgr.stop(this);\r
       };\r
 \r
       var onStart = function() {\r
          this.onStart.fire();\r
+\r
+         this.runtimeAttributes = {};\r
          for (var attr in this.attributes) {\r
             this.setRuntimeAttribute(attr);\r
          }\r
@@ -361,12 +395,14 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Custom event that fires when animation begins\r
        * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)\r
+       * @event onStart\r
        */\r
       this.onStart = new YAHOO.util.CustomEvent('start', this);\r
 \r
       /**\r
        * Custom event that fires between each frame\r
        * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)\r
+       * @event onTween\r
        */\r
       this.onTween = new YAHOO.util.CustomEvent('tween', this);\r
 \r
@@ -379,6 +415,7 @@ YAHOO.util.Anim.prototype = {
       /**\r
        * Custom event that fires when animation ends\r
        * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)\r
+       * @event onComplete\r
        */\r
       this.onComplete = new YAHOO.util.CustomEvent('complete', this);\r
       /**\r
@@ -393,20 +430,16 @@ YAHOO.util.Anim.prototype = {
    }\r
 };\r
 \r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Handles animation queueing and threading.\r
+ * Handles animation queueing and threading.\r
  * Used by Anim and subclasses.\r
+ * @class AnimMgr\r
+ * @namespace YAHOO.util\r
  */\r
 YAHOO.util.AnimMgr = new function() {\r
    /**\r
-    * Reference to the animation Interval\r
+    * Reference to the animation Interval.\r
+    * @property thread\r
     * @private\r
     * @type Int\r
     */\r
@@ -414,6 +447,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * The current queue of registered animation objects.\r
+    * @property queue\r
     * @private\r
     * @type Array\r
     */\r
@@ -421,6 +455,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * The number of active animations.\r
+    * @property tweenCount\r
     * @private\r
     * @type Int\r
     */\r
@@ -429,6 +464,7 @@ YAHOO.util.AnimMgr = new function() {
    /**\r
     * Base frame rate (frames per second).\r
     * Arbitrarily high for better x-browser calibration (slower browsers drop more frames).\r
+    * @property fps\r
     * @type Int\r
     *\r
     */\r
@@ -436,6 +472,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Interval delay in milliseconds, defaults to fastest possible.\r
+    * @property delay\r
     * @type Int\r
     *\r
     */\r
@@ -444,6 +481,7 @@ YAHOO.util.AnimMgr = new function() {
    /**\r
     * Adds an animation instance to the animation queue.\r
     * All animation instances must be registered in order to animate.\r
+    * @method registerElement\r
     * @param {object} tween The Anim instance to be be registered\r
     */\r
    this.registerElement = function(tween) {\r
@@ -453,6 +491,14 @@ YAHOO.util.AnimMgr = new function() {
       this.start();\r
    };\r
 \r
+   /**\r
+    * removes an animation instance from the animation queue.\r
+    * All animation instances must be registered in order to animate.\r
+    * @method unRegister\r
+    * @param {object} tween The Anim instance to be be registered\r
+    * @param {Int} index The index of the Anim instance\r
+    * @private\r
+    */\r
    this.unRegister = function(tween, index) {\r
       tween._onComplete.fire();\r
       index = index || getIndex(tween);\r
@@ -464,7 +510,8 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Starts the animation thread.\r
-        * Only one thread can run at a time.\r
+       * Only one thread can run at a time.\r
+    * @method start\r
     */\r
    this.start = function() {\r
       if (thread === null) { thread = setInterval(this.run, this.delay); }\r
@@ -472,6 +519,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Stops the animation thread or a specific animation instance.\r
+    * @method stop\r
     * @param {object} tween A specific Anim instance to stop (optional)\r
     * If no instance given, Manager stops thread and all animations.\r
     */\r
@@ -494,6 +542,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * Called per Interval to handle each animation frame.\r
+    * @method run\r
     */\r
    this.run = function() {\r
       for (var i = 0, len = queue.length; i < len; ++i) {\r
@@ -524,6 +573,7 @@ YAHOO.util.AnimMgr = new function() {
 \r
    /**\r
     * On the fly frame correction to keep animation on time.\r
+    * @method correctFrame\r
     * @private\r
     * @param {Object} tween The Anim instance being corrected.\r
     */\r
@@ -548,16 +598,10 @@ YAHOO.util.AnimMgr = new function() {
       }\r
    };\r
 };\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- *\r
- * @class Used to calculate Bezier splines for any number of control points.\r
+ * Used to calculate Bezier splines for any number of control points.\r
+ * @class Bezier\r
+ * @namespace YAHOO.util\r
  *\r
  */\r
 YAHOO.util.Bezier = new function()\r
@@ -568,6 +612,7 @@ YAHOO.util.Bezier = new function()
     * At least 2 points are required (start and end).\r
     * First point is start. Last point is end.\r
     * Additional control points are optional.\r
+    * @method getPosition\r
     * @param {Array} points An array containing Bezier points\r
     * @param {Number} t A number between 0 and 1 which is the basis for determining current position\r
     * @return {Array} An array containing int x and y member data\r
@@ -593,9 +638,11 @@ YAHOO.util.Bezier = new function()
    };\r
 };\r
 /**\r
- * @class ColorAnim subclass for color fading\r
- * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code></p>\r
- * <p>Color values can be specified with either 112233, #112233, [255,255,255], or rgb(255,255,255)\r
+ * Anim subclass for color transitions.\r
+ * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,\r
+ * [255,255,255], or rgb(255,255,255)</p>\r
+ * @class ColorAnim\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -603,13 +650,14 @@ YAHOO.util.Bezier = new function()
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @constructor\r
+ * @extends YAHOO.util.Anim\r
  * @param {HTMLElement | String} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
  * All attribute names use camelCase.\r
  * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
- * @param {Function} method (optional, defaults to Y.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a Y.Easing method)\r
+ * @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)\r
  */\r
 (function() {\r
    YAHOO.util.ColorAnim = function(el, attributes, duration,  method) {\r
@@ -621,33 +669,27 @@ YAHOO.util.Bezier = new function()
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.ColorAnim.superclass;\r
-   var prototype = Y.ColorAnim.prototype;\r
+   var proto = Y.ColorAnim.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("ColorAnim " + id);\r
    };\r
 \r
-   /**\r
-    * Only certain attributes should be treated as colors.\r
-    * @type Object\r
-    */\r
-   prototype.patterns.color = /color$/i;\r
-   prototype.patterns.rgb    = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;\r
-   prototype.patterns.hex    = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;\r
-   prototype.patterns.hex3   = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;\r
+   proto.patterns.color = /color$/i;\r
+   proto.patterns.rgb         = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;\r
+   proto.patterns.hex         = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;\r
+   proto.patterns.hex3        = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;\r
+   proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari\r
 \r
    /**\r
     * Attempts to parse the given string and return a 3-tuple.\r
+    * @method parseColor\r
     * @param {String} s The string to parse.\r
     * @return {Array} The 3-tuple of rgb values.\r
     */\r
-   prototype.parseColor = function(s) {\r
+   proto.parseColor = function(s) {\r
       if (s.length == 3) { return s; }\r
 \r
       var c = this.patterns.hex.exec(s);\r
@@ -668,25 +710,20 @@ YAHOO.util.Bezier = new function()
       return null;\r
    };\r
 \r
-   /**\r
-    * Returns current value of the attribute.\r
-    * @param {String} attr The name of the attribute.\r
-    * @return {Number} val The current value of the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       var el = this.getEl();\r
       if (  this.patterns.color.test(attr) ) {\r
          var val = YAHOO.util.Dom.getStyle(el, attr);\r
 \r
-         if (val == 'transparent') { // bgcolor default\r
+         if (this.patterns.transparent.test(val)) { // bgcolor default\r
             var parent = el.parentNode; // try and get from an ancestor\r
             val = Y.Dom.getStyle(parent, attr);\r
 \r
-            while (parent && val == 'transparent') {\r
+            while (parent && this.patterns.transparent.test(val)) {\r
                parent = parent.parentNode;\r
                val = Y.Dom.getStyle(parent, attr);\r
                if (parent.tagName.toUpperCase() == 'HTML') {\r
-                  val = 'ffffff';\r
+                  val = '#fff';\r
                }\r
             }\r
          }\r
@@ -697,14 +734,7 @@ YAHOO.util.Bezier = new function()
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val;\r
 \r
       if ( this.patterns.color.test(attr) ) {\r
@@ -722,13 +752,7 @@ YAHOO.util.Bezier = new function()
       return val;\r
    };\r
 \r
-   /**\r
-    * Sets the actual values to be used during the animation.\r
-    * Should only be needed for subclass use.\r
-    * @param {Object} attr The attribute object\r
-    * @private\r
-    */\r
-   prototype.setRuntimeAttribute = function(attr) {\r
+   proto.setRuntimeAttribute = function(attr) {\r
       superclass.setRuntimeAttribute.call(this, attr);\r
 \r
       if ( this.patterns.color.test(attr) ) {\r
@@ -751,27 +775,33 @@ YAHOO.util.Bezier = new function()
 })();/*\r
 TERMS OF USE - EASING EQUATIONS\r
 Open source under the BSD License.\r
-Copyright Â© 2001 Robert Penner All rights reserved.\r
+Copyright 2001 Robert Penner All rights reserved.\r
 \r
 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
 \r
   * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
   * 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.\r
   * 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.\r
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
+ * 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.\r
+ * 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.\r
 \r
 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.\r
+*/\r
 \r
+/**\r
+ * Singleton that determines how an animation proceeds from start to end.\r
+ * @class Easing\r
+ * @namespace YAHOO.util\r
 */\r
 \r
 YAHOO.util.Easing = {\r
 \r
    /**\r
     * Uniform speed between points.\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeNone\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeNone: function (t, b, c, d) {\r
        return c*t/d + b;\r
@@ -779,11 +809,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and accelerates towards end. (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeIn: function (t, b, c, d) {\r
        return c*(t/=d)*t + b;\r
@@ -791,11 +822,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins quickly and decelerates towards end.  (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeOut: function (t, b, c, d) {\r
        return -c *(t/=d)*(t-2) + b;\r
@@ -803,11 +835,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and decelerates towards end. (quadratic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeBoth: function (t, b, c, d) {\r
        if ((t/=d/2) < 1) return c/2*t*t + b;\r
@@ -816,11 +849,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and accelerates towards end. (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeInStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeInStrong: function (t, b, c, d) {\r
        return c*(t/=d)*t*t*t + b;\r
@@ -828,11 +862,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins quickly and decelerates towards end.  (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeOutStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeOutStrong: function (t, b, c, d) {\r
        return -c * ((t=t/d-1)*t*t*t - 1) + b;\r
@@ -840,11 +875,12 @@ YAHOO.util.Easing = {
 \r
    /**\r
     * Begins slowly and decelerates towards end. (quartic)\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @method easeBothStrong\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    easeBothStrong: function (t, b, c, d) {\r
        if ((t/=d/2) < 1) return c/2*t*t*t*t + b;\r
@@ -852,13 +888,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap in elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap in elastic effect.\r
+    * @method elasticIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
 \r
    elasticIn: function (t, b, c, d, a, p) {\r
@@ -869,13 +906,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap out elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap out elastic effect.\r
+    * @method elasticOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    elasticOut: function (t, b, c, d, a, p) {\r
        if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;\r
@@ -885,13 +923,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * snap both elastic effect\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
+    * Snap both elastic effect.\r
+    * @method elasticBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
     * @param {Number} p Period (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    elasticBoth: function (t, b, c, d, a, p) {\r
        if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);\r
@@ -902,13 +941,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * back easing in - backtracking slightly, then reversing direction and moving to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Backtracks slightly, then reverses direction and moves to end.\r
+    * @method backIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backIn: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -916,14 +956,14 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * back easing out - moving towards target, overshooting it slightly,\r
-    * then reversing and coming back to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Overshoots end, then reverses and comes back to end.\r
+    * @method backOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backOut: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -931,14 +971,15 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * back easing in/out - backtracking slightly, then reversing direction and moving to target,\r
-    * then overshooting target, reversing, and finally coming back to target\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @param {Number) s Overshoot (optional)\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Backtracks slightly, then reverses direction, overshoots end,\r
+    * then reverses and comes back to end.\r
+    * @method backBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @param {Number} s Overshoot (optional)\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    backBoth: function (t, b, c, d, s) {\r
        if (typeof s == 'undefined') s = 1.70158;\r
@@ -947,24 +988,26 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * bounce in\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounce off of start.\r
+    * @method bounceIn\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceIn: function (t, b, c, d) {\r
        return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b;\r
    },\r
 \r
    /**\r
-    * bounce out\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounces off end.\r
+    * @method bounceOut\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceOut: function (t, b, c, d) {\r
        if ((t/=d) < (1/2.75)) {\r
@@ -979,12 +1022,13 @@ YAHOO.util.Easing = {
    },\r
 \r
    /**\r
-    * bounce both\r
-    * @param {Number} t Time value used to compute current value.\r
-    * @param {Number} b Starting value.\r
-    * @param {Number} c Delta between start and end values.\r
-    * @param {Number} d Total length of animation.\r
-    * @return {Number} The computed value for the current animation frame.\r
+    * Bounces off start and end.\r
+    * @method bounceBoth\r
+    * @param {Number} t Time value used to compute current value\r
+    * @param {Number} b Starting value\r
+    * @param {Number} c Delta between start and end values\r
+    * @param {Number} d Total length of animation\r
+    * @return {Number} The computed value for the current animation frame\r
     */\r
    bounceBoth: function (t, b, c, d) {\r
        if (t < d/2) return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b;\r
@@ -992,16 +1036,12 @@ YAHOO.util.Easing = {
    }\r
 };\r
 \r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Anim subclass for moving elements along a path defined by the "points" member of "attributes".  All "points" are arrays with x, y coordinates.\r
+ * Anim subclass for moving elements along a path defined by the "points"\r
+ * member of "attributes".  All "points" are arrays with x, y coordinates.\r
  * <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>\r
+ * @class Motion\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -1010,7 +1050,8 @@ Version: 0.10.0
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
  * @constructor\r
- * @param {String or HTMLElement} el Reference to the element that will be animated\r
+ * @extends YAHOO.util.Anim\r
+ * @param {String | HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
  * Each attribute is an object with at minimum a "to" or "by" member defined.\r
  * Additional optional members are "from" (defaults to current value), "units" (defaults to "px").\r
@@ -1030,27 +1071,17 @@ Version: 0.10.0
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.Motion.superclass;\r
-   var prototype = Y.Motion.prototype;\r
+   var proto = Y.Motion.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("Motion " + id);\r
    };\r
 \r
-   prototype.patterns.points = /^points$/i;\r
+   proto.patterns.points = /^points$/i;\r
 \r
-   /**\r
-    * Applies a value to an attribute\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} val The value to be applied to the attribute.\r
-    * @param {String} unit The unit ('px', '%', etc.) of the value.\r
-    */\r
-   prototype.setAttribute = function(attr, val, unit) {\r
+   proto.setAttribute = function(attr, val, unit) {\r
       if (  this.patterns.points.test(attr) ) {\r
          unit = unit || 'px';\r
          superclass.setAttribute.call(this, 'left', val[0], unit);\r
@@ -1060,12 +1091,7 @@ Version: 0.10.0
       }\r
    };\r
 \r
-   /**\r
-    * Sets the default value to be used when "from" is not supplied.\r
-    * @param {String} attr The attribute being set.\r
-    * @param {Number} val The default value to be applied to the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       if (  this.patterns.points.test(attr) ) {\r
          var val = [\r
             superclass.getAttribute.call(this, 'left'),\r
@@ -1078,14 +1104,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val = null;\r
 \r
       if ( this.patterns.points.test(attr) ) {\r
@@ -1097,13 +1116,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Sets the actual values to be used during the animation.\r
-    * Should only be needed for subclass use.\r
-    * @param {Object} attr The attribute object\r
-    * @private\r
-    */\r
-   prototype.setRuntimeAttribute = function(attr) {\r
+   proto.setRuntimeAttribute = function(attr) {\r
       if ( this.patterns.points.test(attr) ) {\r
          var el = this.getEl();\r
          var attributes = this.attributes;\r
@@ -1175,16 +1188,12 @@ Version: 0.10.0
       return (typeof prop !== 'undefined');\r
    };\r
 })();\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version: 0.10.0\r
-*/\r
-\r
 /**\r
- * @class Anim subclass for scrolling elements to a position defined by the "scroll" member of "attributes".  All "scroll" members are arrays with x, y scroll positions.\r
+ * Anim subclass for scrolling elements to a position defined by the "scroll"\r
+ * member of "attributes".  All "scroll" members are arrays with x, y scroll positions.\r
  * <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p>\r
+ * @class Scroll\r
+ * @namespace YAHOO.util\r
  * @requires YAHOO.util.Anim\r
  * @requires YAHOO.util.AnimMgr\r
  * @requires YAHOO.util.Easing\r
@@ -1192,6 +1201,7 @@ Version: 0.10.0
  * @requires YAHOO.util.Dom\r
  * @requires YAHOO.util.Event\r
  * @requires YAHOO.util.CustomEvent\r
+ * @extends YAHOO.util.Anim\r
  * @constructor\r
  * @param {String or HTMLElement} el Reference to the element that will be animated\r
  * @param {Object} attributes The attribute(s) to be animated.\r
@@ -1213,26 +1223,15 @@ Version: 0.10.0
    // shorthand\r
    var Y = YAHOO.util;\r
    var superclass = Y.Scroll.superclass;\r
-   var prototype = Y.Scroll.prototype;\r
+   var proto = Y.Scroll.prototype;\r
 \r
-   /**\r
-    * toString method\r
-    * @return {String} string represenation of anim obj\r
-    */\r
-   prototype.toString = function() {\r
+   proto.toString = function() {\r
       var el = this.getEl();\r
       var id = el.id || el.tagName;\r
       return ("Scroll " + id);\r
    };\r
 \r
-   /**\r
-    * Returns the value computed by the animation's "method".\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} start The value this attribute should start from for this animation.\r
-    * @param {Number} end  The value this attribute should end at for this animation.\r
-    * @return {Number} The Value to be applied to the attribute.\r
-    */\r
-   prototype.doMethod = function(attr, start, end) {\r
+   proto.doMethod = function(attr, start, end) {\r
       var val = null;\r
 \r
       if (attr == 'scroll') {\r
@@ -1247,12 +1246,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Returns current value of the attribute.\r
-    * @param {String} attr The name of the attribute.\r
-    * @return {Number} val The current value of the attribute.\r
-    */\r
-   prototype.getAttribute = function(attr) {\r
+   proto.getAttribute = function(attr) {\r
       var val = null;\r
       var el = this.getEl();\r
 \r
@@ -1265,13 +1259,7 @@ Version: 0.10.0
       return val;\r
    };\r
 \r
-   /**\r
-    * Applies a value to an attribute\r
-    * @param {String} attr The name of the attribute.\r
-    * @param {Number} val The value to be applied to the attribute.\r
-    * @param {String} unit The unit ('px', '%', etc.) of the value.\r
-    */\r
-   prototype.setAttribute = function(attr, val, unit) {\r
+   proto.setAttribute = function(attr, val, unit) {\r
       var el = this.getEl();\r
 \r
       if (attr == 'scroll') {\r
index a3b5c1fb33a8a2a9b770ffaf86f8fb39ac082592..4470be23f231096f5dfcdd64bd2486cdb14eec17 100755 (executable)
@@ -1,5 +1,34 @@
 AutoComplete Release Notes\r
 \r
+*** version 0.12.0 ***\r
+\r
+* The following constants must be defined as static class properties and are no longer\r
+available as instance properties:\r
+\r
+YAHOO.widget.DataSource.ERROR_DATANULL\r
+YAHOO.widget.DataSource.ERROR_DATAPARSE\r
+YAHOO.widget.DS_XHR.TYPE_JSON\r
+YAHOO.widget.DS_XHR.TYPE_XML\r
+YAHOO.widget.DS_XHR.TYPE_FLAT\r
+YAHOO.widget.DS_XHR.ERROR_DATAXHR\r
+\r
+* The property minQueryLength now supports zero and negative number values for\r
+DS_JSFunction and DS_XHR objects, to enable null or empty string queries and to disable\r
+AutoComplete functionality altogether, respectively.\r
+\r
+* Enabling the alwaysShowContainer feature will no longer send containerExpandEvent or\r
+containerCollapseEvent.\r
+\r
+\r
+\r
+**** version 0.11.3 ***\r
+\r
+* The iFrameSrc property has been deprecated. Implementers no longer need to\r
+specify an https URL to avoid IE security warnings when working with sites over\r
+SSL.\r
+\r
+\r
+\r
 *** version 0.11.0 ***\r
 \r
 * The method getListIds() has been deprecated for getListItems(), which returns\r
index f78c68f53f55451deb2c677e160fc6a70b4e27da..62fd2b73bdfde833b58561754679d4ca930a4c71 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
 Code licensed under the BSD License:\r\r
 http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.11.0\r\r
+version: 0.12.0\r\r
 */\r\r
 \r\r
+ /**\r
+ * The AutoComplete control provides the front-end logic for text-entry suggestion and\r
+ * completion functionality.\r
+ *\r
+ * @module autocomplete\r
+ * @requires yahoo, dom, event, datasource\r
+ * @optional animation, connection, json\r
+ * @namespace YAHOO.widget\r
+ * @title AutoComplete Widget\r
+ */\r
+\r
+/****************************************************************************/\r
+/****************************************************************************/\r
+/****************************************************************************/\r
+\r
+/**\r
+ * The AutoComplete class provides the customizable functionality of a plug-and-play DHTML\r
+ * auto completion widget.  Some key features:\r
+ * <ul>\r
+ * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>\r
+ * <li>The drop down container can "roll down" or "fly out" via configurable\r
+ * animation</li>\r
+ * <li>UI look-and-feel customizable through CSS, including container\r
+ * attributes, borders, position, fonts, etc</li>\r
+ * </ul>\r
+ *\r
+ * @class AutoComplete\r
+ * @constructor\r
+ * @param elInput {HTMLElement} DOM element reference of an input field\r
+ * @param elInput {String} String ID of an input field\r
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV\r
+ * @param elContainer {String} String ID of an existing DIV\r
+ * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params\r
+ */\r
+YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {\r
+    if(elInput && elContainer && oDataSource) {\r
+        // Validate DataSource\r
+        if (oDataSource && (oDataSource instanceof YAHOO.widget.DataSource)) {\r
+            this.dataSource = oDataSource;\r
+        }\r
+        else {\r
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid DataSource", "error", this.toString());\r
+            return;\r
+        }\r
+\r
+        // Validate input element\r
+        if(YAHOO.util.Dom.inDocument(elInput)) {\r
+            if(typeof elInput == "string") {\r
+                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;\r
+                    this._oTextbox = document.getElementById(elInput);\r
+            }\r
+            else {\r
+                this._sName = (elInput.id) ?\r
+                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:\r
+                    "instance" + YAHOO.widget.AutoComplete._nIndex;\r
+                this._oTextbox = elInput;\r
+            }\r
+        }\r
+        else {\r
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid input element", "error", this.toString());\r
+            return;\r
+        }\r
+\r
+        // Validate container element\r
+        if(YAHOO.util.Dom.inDocument(elContainer)) {\r
+            if(typeof elContainer == "string") {\r
+                    this._oContainer = document.getElementById(elContainer);\r
+            }\r
+            else {\r
+                this._oContainer = elContainer;\r
+            }\r
+            if(this._oContainer.style.display == "none") {\r
+                YAHOO.log("The container may not display properly if display is set to \"none\" in CSS", "warn", this.toString());\r
+            }\r
+        }\r
+        else {\r
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid container element", "error", this.toString());\r
+            return;\r
+        }\r
+\r
+        // Set any config params passed in to override defaults\r
+        if (typeof oConfigs == "object") {\r
+            for(var sConfig in oConfigs) {\r
+                if (sConfig) {\r
+                    this[sConfig] = oConfigs[sConfig];\r
+                }\r
+            }\r
+        }\r
+\r
+        // Initialization sequence\r
+        this._initContainer();\r
+        this._initProps();\r
+        this._initList();\r
+        this._initContainerHelpers();\r
+\r
+        // Set up events\r
+        var oSelf = this;\r
+        var oTextbox = this._oTextbox;\r
+        // Events are actually for the content module within the container\r
+        var oContent = this._oContainer._oContent;\r
+\r
+        // Dom events\r
+        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);\r
+        if(oTextbox.form) {\r
+            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);\r
+        }\r
+        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);\r
+\r
+        // Custom events\r
+        this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);\r
+        this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this);\r
+        this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this);\r
+        this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this);\r
+        this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r
+        this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this);\r
+        this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this);\r
+        this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this);\r
+        this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this);\r
+        this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this);\r
+        this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this);\r
+        this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this);\r
+        this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this);\r
+        this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r
+        this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r
+        this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r
+        \r
+        // Finish up\r
+        oTextbox.setAttribute("autocomplete","off");\r
+        YAHOO.widget.AutoComplete._nIndex++;\r
+        YAHOO.log("AutoComplete initialized","info",this.toString());\r
+    }\r
+    // Required arguments were not found\r
+    else {\r
+        YAHOO.log("Could not instantiate AutoComplete due invalid arguments", "error", this.toString());\r
+    }\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public member variables\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * The DataSource object that encapsulates the data used for auto completion.\r
+ * This object should be an inherited object from YAHOO.widget.DataSource.\r
+ *\r
+ * @property dataSource\r
+ * @type Object\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataSource = null;\r
+\r
+/**\r
+ * Number of characters that must be entered before querying for results. A negative value\r
+ * effectively turns off the widget. A value of 0 allows queries of null or empty string\r
+ * values.\r
+ *\r
+ * @property minQueryLength\r
+ * @type Number\r
+ * @default 1\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;\r
+\r
+/**\r
+ * Maximum number of results to display in results container.\r
+ *\r
+ * @property maxResultsDisplayed\r
+ * @type Number\r
+ * @default 10\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;\r
+\r
+/**\r
+ * Number of seconds to delay before submitting a query request.  If a query\r
+ * request is received before a previous one has completed its delay, the\r
+ * previous request is cancelled and the new request is set to the delay.\r
+ *\r
+ * @property queryDelay\r
+ * @type Number\r
+ * @default 0.5\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.queryDelay = 0.5;\r
+\r
+/**\r
+ * Class name of a highlighted item within results container.\r
+ *\r
+ * @property highlighClassName\r
+ * @type String\r
+ * @default "yui-ac-highlight"\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";\r
+\r
+/**\r
+ * Class name of a pre-highlighted item within results container.\r
+ *\r
+ * @property prehighlightClassName\r
+ * @type String\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;\r
+\r
+/**\r
+ * Query delimiter. A single character separator for multiple delimited\r
+ * selections. Multiple delimiter characteres may be defined as an array of\r
+ * strings. A null value or empty string indicates that query results cannot\r
+ * be delimited. This feature is not recommended if you need forceSelection to\r
+ * be true.\r
+ *\r
+ * @property delimChar\r
+ * @type String | String[]\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.delimChar = null;\r
+\r
+/**\r
+ * Whether or not the first item in results container should be automatically highlighted\r
+ * on expand.\r
+ *\r
+ * @property autoHighlight\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.autoHighlight = true;\r
+\r
+/**\r
+ * Whether or not the input field should be automatically updated\r
+ * with the first query result as the user types, auto-selecting the substring\r
+ * that the user has not typed.\r
+ *\r
+ * @property typeAhead\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.typeAhead = false;\r
+\r
+/**\r
+ * Whether or not to animate the expansion/collapse of the results container in the\r
+ * horizontal direction.\r
+ *\r
+ * @property animHoriz\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animHoriz = false;\r
+\r
+/**\r
+ * Whether or not to animate the expansion/collapse of the results container in the\r
+ * vertical direction.\r
+ *\r
+ * @property animVert\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animVert = true;\r
+\r
+/**\r
+ * Speed of container expand/collapse animation, in seconds..\r
+ *\r
+ * @property animSpeed\r
+ * @type Number\r
+ * @default 0.3\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;\r
+\r
+/**\r
+ * Whether or not to force the user's selection to match one of the query\r
+ * results. Enabling this feature essentially transforms the input field into a\r
+ * &lt;select&gt; field. This feature is not recommended with delimiter character(s)\r
+ * defined.\r
+ *\r
+ * @property forceSelection\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.forceSelection = false;\r
+\r
+/**\r
+ * Whether or not to allow browsers to cache user-typed input in the input\r
+ * field. Disabling this feature will prevent the widget from setting the\r
+ * autocomplete="off" on the input field. When autocomplete="off"\r
+ * and users click the back button after form submission, user-typed input can\r
+ * be prefilled by the browser from its cache. This caching of user input may\r
+ * not be desired for sensitive data, such as credit card numbers, in which\r
+ * case, implementers should consider setting allowBrowserAutocomplete to false.\r
+ *\r
+ * @property allowBrowserAutocomplete\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;\r
+\r
+/**\r
+ * Whether or not the results container should always be displayed.\r
+ * Enabling this feature displays the container when the widget is instantiated\r
+ * and prevents the toggling of the container to a collapsed state.\r
+ *\r
+ * @property alwaysShowContainer\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;\r
+\r
+/**\r
+ * Whether or not to use an iFrame to layer over Windows form elements in\r
+ * IE. Set to true only when the results container will be on top of a\r
+ * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,\r
+ * 5.5 < IE < 7).\r
+ *\r
+ * @property useIFrame\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.useIFrame = false;\r
+\r
+/**\r
+ * Whether or not the results container should have a shadow.\r
+ *\r
+ * @property useShadow\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.useShadow = false;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public methods\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+ /**\r
+ * Public accessor to the unique name of the AutoComplete instance.\r
+ *\r
+ * @method toString\r
+ * @return {String} Unique name of the AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.toString = function() {\r
+    return "AutoComplete " + this._sName;\r
+};\r
+\r
+ /**\r
+ * Returns true if container is in an expanded state, false otherwise.\r
+ *\r
+ * @method isContainerOpen\r
+ * @return {Boolean} Returns true if container is in an expanded state, false otherwise.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() {\r
+    return this._bContainerOpen;\r
+};\r
+\r
+/**\r
+ * Public accessor to the internal array of DOM &lt;li&gt; elements that\r
+ * display query results within the results container.\r
+ *\r
+ * @method getListItems\r
+ * @return {HTMLElement[]} Array of &lt;li&gt; elements within the results container.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.getListItems = function() {\r
+    return this._aListItems;\r
+};\r
+\r
+/**\r
+ * Public accessor to the data held in an &lt;li&gt; element of the\r
+ * results container.\r
+ *\r
+ * @method getListItemData\r
+ * @return {Object | Array} Object or array of result data or null\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {\r
+    if(oListItem._oResultData) {\r
+        return oListItem._oResultData;\r
+    }\r
+    else {\r
+        return false;\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container header. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_hd".\r
+ *\r
+ * @method setHeader\r
+ * @param sHeader {String} HTML markup for results container header.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {\r
+    if(sHeader) {\r
+        if(this._oContainer._oContent._oHeader) {\r
+            this._oContainer._oContent._oHeader.innerHTML = sHeader;\r
+            this._oContainer._oContent._oHeader.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oHeader.innerHTML = "";\r
+        this._oContainer._oContent._oHeader.style.display = "none";\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container footer. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_ft".\r
+ *\r
+ * @method setFooter\r
+ * @param sFooter {String} HTML markup for results container footer.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {\r
+    if(sFooter) {\r
+        if(this._oContainer._oContent._oFooter) {\r
+            this._oContainer._oContent._oFooter.innerHTML = sFooter;\r
+            this._oContainer._oContent._oFooter.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oFooter.innerHTML = "";\r
+        this._oContainer._oContent._oFooter.style.display = "none";\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container body. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_bd".\r
+ *\r
+ * @method setBody\r
+ * @param sHeader {String} HTML markup for results container body.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {\r
+    if(sBody) {\r
+        if(this._oContainer._oContent._oBody) {\r
+            this._oContainer._oContent._oBody.innerHTML = sBody;\r
+            this._oContainer._oContent._oBody.style.display = "block";\r
+            this._oContainer._oContent.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oBody.innerHTML = "";\r
+        this._oContainer._oContent.style.display = "none";\r
+    }\r
+    this._maxResultsDisplayed = 0;\r
+};\r
+\r
+/**\r
+ * Overridable method that converts a result item object into HTML markup\r
+ * for display. Return data values are accessible via the oResultItem object,\r
+ * and the key return value will always be oResultItem[0]. Markup will be\r
+ * displayed within &lt;li&gt; element tags in the container.\r
+ *\r
+ * @method formatResult\r
+ * @param oResultItem {Object} Result item representing one query result. Data is held in an array.\r
+ * @param sQuery {String} The current query string.\r
+ * @return {String} HTML markup of formatted result data.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {\r
+    var sResult = oResultItem[0];\r
+    if(sResult) {\r
+        return sResult;\r
+    }\r
+    else {\r
+        return "";\r
+    }\r
+};\r
+\r
+/**\r
+ * Overridable method called before container expands allows implementers to access data\r
+ * and DOM elements.\r
+ *\r
+ * @method doBeforeExpandContainer\r
+ * @return {Boolean} Return true to continue expanding container, false to cancel the expand.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oResultItem, sQuery) {\r
+    return true;\r
+};\r
+\r
+/**\r
+ * Makes query request to the DataSource.\r
+ *\r
+ * @method sendQuery\r
+ * @param sQuery {String} Query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {\r
+    this._sendQuery(sQuery);\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public events\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Fired when the input field receives focus.\r
+ *\r
+ * @event textboxFocusEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;\r
+\r
+/**\r
+ * Fired when the input field receives key input.\r
+ *\r
+ * @event textboxKeyEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param nKeycode {Number} The keycode number.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance makes a query to the DataSource.\r
+ * \r
+ * @event dataRequestEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance receives query results from the data\r
+ * source.\r
+ *\r
+ * @event dataReturnEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ * @param aResults {Array} Results array.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance does not receive query results from the\r
+ * DataSource due to an error.\r
+ *\r
+ * @event dataErrorEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;\r
+\r
+/**\r
+ * Fired when the results container is expanded.\r
+ *\r
+ * @event containerExpandEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;\r
+\r
+/**\r
+ * Fired when the input field has been prefilled by the type-ahead\r
+ * feature. \r
+ *\r
+ * @event typeAheadEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ * @param sPrefill {String} The prefill string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been moused over.\r
+ *\r
+ * @event itemMouseOverEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt element item moused to.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been moused out.\r
+ *\r
+ * @event itemMouseOutEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item moused from.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been arrowed to. \r
+ *\r
+ * @event itemArrowToEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed to.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been arrowed away from.\r
+ *\r
+ * @event itemArrowFromEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed from.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;\r
+\r
+/**\r
+ * Fired when an item is selected via mouse click, ENTER key, or TAB key.\r
+ *\r
+ * @event itemSelectEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The selected &lt;li&gt; element item.\r
+ * @param oData {Object} The data returned for the item, either as an object,\r
+ * or mapped from the schema into an array.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;\r
+\r
+/**\r
+ * Fired when a user selection does not match any of the displayed result items.\r
+ * Note that this event may not behave as expected when delimiter characters\r
+ * have been defined. \r
+ *\r
+ * @event unmatchedItemSelectEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The user-typed query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;\r
+\r
+/**\r
+ * Fired if forceSelection is enabled and the user's input has been cleared\r
+ * because it did not match one of the returned query results.\r
+ *\r
+ * @event selectionEnforceEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;\r
+\r
+/**\r
+ * Fired when the results container is collapsed.\r
+ *\r
+ * @event containerCollapseEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;\r
+\r
+/**\r
+ * Fired when the input field loses focus.\r
+ *\r
+ * @event textboxBlurEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private member variables\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Internal class variable to index multiple AutoComplete instances.\r
+ *\r
+ * @property _nIndex\r
+ * @type Number\r
+ * @default 0\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete._nIndex = 0;\r
+\r
+/**\r
+ * Name of AutoComplete instance.\r
+ *\r
+ * @property _sName\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sName = null;\r
+\r
+/**\r
+ * Text input field DOM element.\r
+ *\r
+ * @property _oTextbox\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oTextbox = null;\r
+\r
+/**\r
+ * Whether or not the input field is currently in focus. If query results come back\r
+ * but the user has already moved on, do not proceed with auto complete behavior.\r
+ *\r
+ * @property _bFocused\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bFocused = true;\r
+\r
+/**\r
+ * Animation instance for container expand/collapse.\r
+ *\r
+ * @property _oAnim\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oAnim = null;\r
+\r
+/**\r
+ * Container DOM element.\r
+ *\r
+ * @property _oContainer\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oContainer = null;\r
+\r
+/**\r
+ * Whether or not the results container is currently open.\r
+ *\r
+ * @property _bContainerOpen\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;\r
+\r
+/**\r
+ * Whether or not the mouse is currently over the results\r
+ * container. This is necessary in order to prevent clicks on container items\r
+ * from being text input field blur events.\r
+ *\r
+ * @property _bOverContainer\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bOverContainer = false;\r
+\r
+/**\r
+ * Array of &lt;li&gt; elements references that contain query results within the\r
+ * results container.\r
+ *\r
+ * @property _aListItems\r
+ * @type Array\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._aListItems = null;\r
+\r
+/**\r
+ * Number of &lt;li&gt; elements currently displayed in results container.\r
+ *\r
+ * @property _nDisplayedItems\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;\r
+\r
+/**\r
+ * Internal count of &lt;li&gt; elements displayed and hidden in results container.\r
+ *\r
+ * @property _maxResultsDisplayed\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;\r
+\r
+/**\r
+ * Current query string\r
+ *\r
+ * @property _sCurQuery\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sCurQuery = null;\r
+\r
+/**\r
+ * Past queries this session (for saving delimited queries).\r
+ *\r
+ * @property _sSavedQuery\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;\r
+\r
+/**\r
+ * Pointer to the currently highlighted &lt;li&gt; element in the container.\r
+ *\r
+ * @property _oCurItem\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oCurItem = null;\r
+\r
+/**\r
+ * Whether or not an item has been selected since the container was populated\r
+ * with results. Reset to false by _populateList, and set to true when item is\r
+ * selected.\r
+ *\r
+ * @property _bItemSelected\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bItemSelected = false;\r
+\r
+/**\r
+ * Key code of the last key pressed in textbox.\r
+ *\r
+ * @property _nKeyCode\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nKeyCode = null;\r
+\r
+/**\r
+ * Delay timeout ID.\r
+ *\r
+ * @property _nDelayID\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nDelayID = -1;\r
+\r
+/**\r
+ * Src to iFrame used when useIFrame = true. Supports implementations over SSL\r
+ * as well.\r
+ *\r
+ * @property _iFrameSrc\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;";\r
+\r
+/**\r
+ * For users typing via certain IMEs, queries must be triggered by intervals,\r
+ * since key events yet supported across all browsers for all IMEs.\r
+ *\r
+ * @property _queryInterval\r
+ * @type Object\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._queryInterval = null;\r
+\r
+/**\r
+ * Internal tracker to last known textbox value, used to determine whether or not\r
+ * to trigger a query via interval for certain IME users.\r
+ *\r
+ * @event _sLastTextboxValue\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private methods\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Updates and validates latest public config properties.\r
+ *\r
+ * @method __initProps\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initProps = function() {\r
+    // Correct any invalid values\r
+    var minQueryLength = this.minQueryLength;\r
+    if(isNaN(minQueryLength) || (minQueryLength < 1)) {\r
+        minQueryLength = 1;\r
+    }\r
+    var maxResultsDisplayed = this.maxResultsDisplayed;\r
+    if(isNaN(this.maxResultsDisplayed) || (this.maxResultsDisplayed < 1)) {\r
+        this.maxResultsDisplayed = 10;\r
+    }\r
+    var queryDelay = this.queryDelay;\r
+    if(isNaN(this.queryDelay) || (this.queryDelay < 0)) {\r
+        this.queryDelay = 0.5;\r
+    }\r
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r
+    if(aDelimChar) {\r
+        if(typeof aDelimChar == "string") {\r
+            this.delimChar = [aDelimChar];\r
+        }\r
+        else if(aDelimChar.constructor != Array) {\r
+            this.delimChar = null;\r
+        }\r
+    }\r
+    var animSpeed = this.animSpeed;\r
+    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {\r
+        if(isNaN(animSpeed) || (animSpeed < 0)) {\r
+            animSpeed = 0.3;\r
+        }\r
+        if(!this._oAnim ) {\r
+            oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);\r
+            this._oAnim = oAnim;\r
+        }\r
+        else {\r
+            this._oAnim.duration = animSpeed;\r
+        }\r
+    }\r
+    if(this.forceSelection && this.delimChar) {\r
+        YAHOO.log("The forceSelection feature has been enabled with delimChar defined.","warn", this.toString());\r
+    }\r
+};\r
+\r
+/**\r
+ * Initializes the results container helpers if they are enabled and do\r
+ * not exist\r
+ *\r
+ * @method _initContainerHelpers\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {\r
+    if(this.useShadow && !this._oContainer._oShadow) {\r
+        var oShadow = document.createElement("div");\r
+        oShadow.className = "yui-ac-shadow";\r
+        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);\r
+    }\r
+    if(this.useIFrame && !this._oContainer._oIFrame) {\r
+        var oIFrame = document.createElement("iframe");\r
+        oIFrame.src = this._iFrameSrc;\r
+        oIFrame.frameBorder = 0;\r
+        oIFrame.scrolling = "no";\r
+        oIFrame.style.position = "absolute";\r
+        oIFrame.style.width = "100%";\r
+        oIFrame.style.height = "100%";\r
+        oIFrame.tabIndex = -1;\r
+        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);\r
+    }\r
+};\r
+\r
+/**\r
+ * Initializes the results container once at object creation\r
+ *\r
+ * @method _initContainer\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initContainer = function() {\r
+    if(!this._oContainer._oContent) {\r
+        // The oContent div helps size the iframe and shadow properly\r
+        var oContent = document.createElement("div");\r
+        oContent.className = "yui-ac-content";\r
+        oContent.style.display = "none";\r
+        this._oContainer._oContent = this._oContainer.appendChild(oContent);\r
+\r
+        var oHeader = document.createElement("div");\r
+        oHeader.className = "yui-ac-hd";\r
+        oHeader.style.display = "none";\r
+        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);\r
+\r
+        var oBody = document.createElement("div");\r
+        oBody.className = "yui-ac-bd";\r
+        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);\r
+\r
+        var oFooter = document.createElement("div");\r
+        oFooter.className = "yui-ac-ft";\r
+        oFooter.style.display = "none";\r
+        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);\r
+    }\r
+    else {\r
+        YAHOO.log("Could not initialize the container","warn",this.toString());\r
+    }\r
+};\r
+\r
+/**\r
+ * Clears out contents of container body and creates up to\r
+ * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an\r
+ * &lt;ul&gt; element.\r
+ *\r
+ * @method _initList\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initList = function() {\r
+    this._aListItems = [];\r
+    while(this._oContainer._oContent._oBody.hasChildNodes()) {\r
+        var oldListItems = this.getListItems();\r
+        if(oldListItems) {\r
+            for(var oldi = oldListItems.length-1; oldi >= 0; i--) {\r
+                oldListItems[oldi] = null;\r
+            }\r
+        }\r
+        this._oContainer._oContent._oBody.innerHTML = "";\r
+    }\r
+\r
+    var oList = document.createElement("ul");\r
+    oList = this._oContainer._oContent._oBody.appendChild(oList);\r
+    for(var i=0; i<this.maxResultsDisplayed; i++) {\r
+        var oItem = document.createElement("li");\r
+        oItem = oList.appendChild(oItem);\r
+        this._aListItems[i] = oItem;\r
+        this._initListItem(oItem, i);\r
+    }\r
+    this._maxResultsDisplayed = this.maxResultsDisplayed;\r
+};\r
+\r
+/**\r
+ * Initializes each &lt;li&gt; element in the container list.\r
+ *\r
+ * @method _initListItem\r
+ * @param oItem {HTMLElement} The &lt;li&gt; DOM element.\r
+ * @param nItemIndex {Number} The index of the element.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initListItem = function(oItem, nItemIndex) {\r
+    var oSelf = this;\r
+    oItem.style.display = "none";\r
+    oItem._nItemIndex = nItemIndex;\r
+\r
+    oItem.mouseover = oItem.mouseout = oItem.onclick = null;\r
+    YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);\r
+    YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);\r
+    YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);\r
+};\r
+\r
+/**\r
+ * Enables interval detection for  Korean IME support.\r
+ *\r
+ * @method _onIMEDetected\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {\r
+    oSelf._enableIntervalDetection();\r
+};\r
+\r
+/**\r
+ * Enables query triggers based on text input detection by intervals (rather\r
+ * than by key events).\r
+ *\r
+ * @method _enableIntervalDetection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {\r
+    var currValue = this._oTextbox.value;\r
+    var lastValue = this._sLastTextboxValue;\r
+    if(currValue != lastValue) {\r
+        this._sLastTextboxValue = currValue;\r
+        this._sendQuery(currValue);\r
+    }\r
+};\r
+\r
+\r
+/**\r
+ * Cancels text input detection by intervals.\r
+ *\r
+ * @method _cancelIntervalDetection\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection = function(oSelf) {\r
+    if(oSelf._queryInterval) {\r
+        clearInterval(oSelf._queryInterval);\r
+    }\r
+};\r
+\r
+\r
+/**\r
+ * Whether or not key is functional or should be ignored. Note that the right\r
+ * arrow key is NOT an ignored key since it triggers queries for certain intl\r
+ * charsets.\r
+ *\r
+ * @method _isIgnoreKey\r
+ * @param nKeycode {Number} Code of key pressed.\r
+ * @return {Boolean} True if key should be ignored, false otherwise.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {\r
+    if ((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter\r
+            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl\r
+            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock\r
+            (nKeyCode == 27) || // esc\r
+            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end\r
+            (nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up\r
+            (nKeyCode == 40) || // down\r
+            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert\r
+        return true;\r
+    }\r
+    return false;\r
+};\r
+\r
+/**\r
+ * Makes query request to the DataSource.\r
+ *\r
+ * @method _sendQuery\r
+ * @param sQuery {String} Query string.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {\r
+    // Widget has been effectively turned off\r
+    if(this.minQueryLength == -1) {\r
+        this._toggleContainer(false);\r
+        return;\r
+    }\r
+    // Delimiter has been enabled\r
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r
+    if(aDelimChar) {\r
+        // Loop through all possible delimiters and find the latest one\r
+        // A " " may be a false positive if they are defined as delimiters AND\r
+        // are used to separate delimited queries\r
+        var nDelimIndex = -1;\r
+        for(var i = aDelimChar.length-1; i >= 0; i--) {\r
+            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);\r
+            if(nNewIndex > nDelimIndex) {\r
+                nDelimIndex = nNewIndex;\r
+            }\r
+        }\r
+        // If we think the last delimiter is a space (" "), make sure it is NOT\r
+        // a false positive by also checking the char directly before it\r
+        if(aDelimChar[i] == " ") {\r
+            for (var j = aDelimChar.length-1; j >= 0; j--) {\r
+                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {\r
+                    nDelimIndex--;\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        // A delimiter has been found so extract the latest query\r
+        if (nDelimIndex > -1) {\r
+            var nQueryStart = nDelimIndex + 1;\r
+            // Trim any white space from the beginning...\r
+            while(sQuery.charAt(nQueryStart) == " ") {\r
+                nQueryStart += 1;\r
+            }\r
+            // ...and save the rest of the string for later\r
+            this._sSavedQuery = sQuery.substring(0,nQueryStart);\r
+            // Here is the query itself\r
+            sQuery = sQuery.substr(nQueryStart);\r
+        }\r
+        else if(sQuery.indexOf(this._sSavedQuery) < 0){\r
+            this._sSavedQuery = null;\r
+        }\r
+    }\r
+\r
+    // Don't search queries that are too short\r
+    if (sQuery && (sQuery.length < this.minQueryLength) || (!sQuery && this.minQueryLength > 0)) {\r
+        if (this._nDelayID != -1) {\r
+            clearTimeout(this._nDelayID);\r
+        }\r
+        this._toggleContainer(false);\r
+        return;\r
+    }\r
+\r
+    sQuery = encodeURIComponent(sQuery);\r
+    this._nDelayID = -1;    // Reset timeout ID because request has been made\r
+    this.dataRequestEvent.fire(this, sQuery);\r
+    this.dataSource.getResults(this._populateList, sQuery, this);\r
+};\r
+\r
+/**\r
+ * Populates the array of &lt;li&gt; elements in the container with query\r
+ * results. This method is passed to YAHOO.widget.DataSource#getResults as a\r
+ * callback function so results from the DataSource instance are returned to the\r
+ * AutoComplete instance.\r
+ *\r
+ * @method _populateList\r
+ * @param sQuery {String} The query string.\r
+ * @param aResults {Array} An array of query result objects from the DataSource.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {\r
+    if(aResults === null) {\r
+        oSelf.dataErrorEvent.fire(oSelf, sQuery);\r
+    }\r
+    if (!oSelf._bFocused || !aResults) {\r
+        return;\r
+    }\r
+\r
+    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);\r
+    var contentStyle = oSelf._oContainer._oContent.style;\r
+    contentStyle.width = (!isOpera) ? null : "";\r
+    contentStyle.height = (!isOpera) ? null : "";\r
+\r
+    var sCurQuery = decodeURIComponent(sQuery);\r
+    oSelf._sCurQuery = sCurQuery;\r
+    oSelf._bItemSelected = false;\r
+\r
+    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {\r
+        oSelf._initList();\r
+    }\r
+\r
+    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);\r
+    oSelf._nDisplayedItems = nItems;\r
+    if (nItems > 0) {\r
+        oSelf._initContainerHelpers();\r
+        var aItems = oSelf._aListItems;\r
+\r
+        // Fill items with data\r
+        for(var i = nItems-1; i >= 0; i--) {\r
+            var oItemi = aItems[i];\r
+            var oResultItemi = aResults[i];\r
+            oItemi.innerHTML = oSelf.formatResult(oResultItemi, sCurQuery);\r
+            oItemi.style.display = "list-item";\r
+            oItemi._sResultKey = oResultItemi[0];\r
+            oItemi._oResultData = oResultItemi;\r
+\r
+        }\r
+\r
+        // Empty out remaining items if any\r
+        for(var j = aItems.length-1; j >= nItems ; j--) {\r
+            var oItemj = aItems[j];\r
+            oItemj.innerHTML = null;\r
+            oItemj.style.display = "none";\r
+            oItemj._sResultKey = null;\r
+            oItemj._oResultData = null;\r
+        }\r
+\r
+        if(oSelf.autoHighlight) {\r
+            // Go to the first item\r
+            var oFirstItem = aItems[0];\r
+            oSelf._toggleHighlight(oFirstItem,"to");\r
+            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);\r
+            oSelf._typeAhead(oFirstItem,sQuery);\r
+        }\r
+        else {\r
+            oSelf._oCurItem = null;\r
+        }\r
+\r
+        // Expand the container\r
+        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);\r
+        oSelf._toggleContainer(ok);\r
+    }\r
+    else {\r
+        oSelf._toggleContainer(false);\r
+    }\r
+    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);\r
+};\r
+\r
+/**\r
+ * When forceSelection is true and the user attempts\r
+ * leave the text input box without selecting an item from the query results,\r
+ * the user selection is cleared.\r
+ *\r
+ * @method _clearSelection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._clearSelection = function() {\r
+    var sValue = this._oTextbox.value;\r
+    var sChar = (this.delimChar) ? this.delimChar[0] : null;\r
+    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;\r
+    if(nIndex > -1) {\r
+        this._oTextbox.value = sValue.substring(0,nIndex);\r
+    }\r
+    else {\r
+         this._oTextbox.value = "";\r
+    }\r
+    this._sSavedQuery = this._oTextbox.value;\r
+\r
+    // Fire custom event\r
+    this.selectionEnforceEvent.fire(this);\r
+};\r
+\r
+/**\r
+ * Whether or not user-typed value in the text input box matches any of the\r
+ * query results.\r
+ *\r
+ * @method _textMatchesOption\r
+ * @return {Boolean} True if user-input text matches a result, false otherwise.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {\r
+    var foundMatch = false;\r
+\r
+    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {\r
+        var oItem = this._aListItems[i];\r
+        var sMatch = oItem._sResultKey.toLowerCase();\r
+        if (sMatch == this._sCurQuery.toLowerCase()) {\r
+            foundMatch = true;\r
+            break;\r
+        }\r
+    }\r
+    return(foundMatch);\r
+};\r
+\r
+/**\r
+ * Updates in the text input box with the first query result as the user types,\r
+ * selecting the substring that the user has not typed.\r
+ *\r
+ * @method _typeAhead\r
+ * @param oItem {HTMLElement} The &lt;li&gt; element item whose data populates the input field.\r
+ * @param sQuery {String} Query string.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r
+    // Don't update if turned off\r
+    if (!this.typeAhead) {\r
+        return;\r
+    }\r
+\r
+    var oTextbox = this._oTextbox;\r
+    var sValue = this._oTextbox.value; // any saved queries plus what user has typed\r
+\r
+    // Don't update with type-ahead if text selection is not supported\r
+    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {\r
+        return;\r
+    }\r
+\r
+    // Select the portion of text that the user has not typed\r
+    var nStart = sValue.length;\r
+    this._updateValue(oItem);\r
+    var nEnd = oTextbox.value.length;\r
+    this._selectText(oTextbox,nStart,nEnd);\r
+    var sPrefill = oTextbox.value.substr(nStart,nEnd);\r
+    this.typeAheadEvent.fire(this,sQuery,sPrefill);\r
+};\r
+\r
+/**\r
+ * Selects text in the input field.\r
+ *\r
+ * @method _selectText\r
+ * @param oTextbox {HTMLElement} Text input box element in which to select text.\r
+ * @param nStart {Number} Starting index of text string to select.\r
+ * @param nEnd {Number} Ending index of text selection.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {\r
+    if (oTextbox.setSelectionRange) { // For Mozilla\r
+        oTextbox.setSelectionRange(nStart,nEnd);\r
+    }\r
+    else if (oTextbox.createTextRange) { // For IE\r
+        var oTextRange = oTextbox.createTextRange();\r
+        oTextRange.moveStart("character", nStart);\r
+        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);\r
+        oTextRange.select();\r
+    }\r
+    else {\r
+        oTextbox.select();\r
+    }\r
+};\r
+\r
+/**\r
+ * Syncs results container with its helpers.\r
+ *\r
+ * @method _toggleContainerHelpers\r
+ * @param bShow {Boolean} True if container is expanded, false if collapsed\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {\r
+    var bFireEvent = false;\r
+    var width = this._oContainer._oContent.offsetWidth + "px";\r
+    var height = this._oContainer._oContent.offsetHeight + "px";\r
+\r
+    if(this.useIFrame && this._oContainer._oIFrame) {\r
+        bFireEvent = true;\r
+        if(bShow) {\r
+            this._oContainer._oIFrame.style.width = width;\r
+            this._oContainer._oIFrame.style.height = height;\r
+        }\r
+        else {\r
+            this._oContainer._oIFrame.style.width = 0;\r
+            this._oContainer._oIFrame.style.height = 0;\r
+        }\r
+    }\r
+    if(this.useShadow && this._oContainer._oShadow) {\r
+        bFireEvent = true;\r
+        if(bShow) {\r
+            this._oContainer._oShadow.style.width = width;\r
+            this._oContainer._oShadow.style.height = height;\r
+        }\r
+        else {\r
+           this._oContainer._oShadow.style.width = 0;\r
+            this._oContainer._oShadow.style.height = 0;\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Animates expansion or collapse of the container.\r
+ *\r
+ * @method _toggleContainer\r
+ * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {\r
+    var oContainer = this._oContainer;\r
+\r
+    // Implementer has container always open so don't mess with it\r
+    if(this.alwaysShowContainer && this._bContainerOpen) {\r
+        return;\r
+    }\r
+    \r
+    // Clear contents of container\r
+    if(!bShow) {\r
+        this._oContainer._oContent.scrollTop = 0;\r
+        var aItems = this._aListItems;\r
+\r
+        if(aItems && (aItems.length > 0)) {\r
+            for(var i = aItems.length-1; i >= 0 ; i--) {\r
+                aItems[i].style.display = "none";\r
+            }\r
+        }\r
+\r
+        if (this._oCurItem) {\r
+            this._toggleHighlight(this._oCurItem,"from");\r
+        }\r
+\r
+        this._oCurItem = null;\r
+        this._nDisplayedItems = 0;\r
+        this._sCurQuery = null;\r
+    }\r
+\r
+    // Container is already closed\r
+    if (!bShow && !this._bContainerOpen) {\r
+        oContainer._oContent.style.display = "none";\r
+        return;\r
+    }\r
+\r
+    // If animation is enabled...\r
+    var oAnim = this._oAnim;\r
+    if (oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {\r
+        // If helpers need to be collapsed, do it right away...\r
+        // but if helpers need to be expanded, wait until after the container expands\r
+        if(!bShow) {\r
+            this._toggleContainerHelpers(bShow);\r
+        }\r
+\r
+        if(oAnim.isAnimated()) {\r
+            oAnim.stop();\r
+        }\r
+\r
+        // Clone container to grab current size offscreen\r
+        var oClone = oContainer._oContent.cloneNode(true);\r
+        oContainer.appendChild(oClone);\r
+        oClone.style.top = "-9000px";\r
+        oClone.style.display = "block";\r
+\r
+        // Current size of the container is the EXPANDED size\r
+        var wExp = oClone.offsetWidth;\r
+        var hExp = oClone.offsetHeight;\r
+\r
+        // Calculate COLLAPSED sizes based on horiz and vert anim\r
+        var wColl = (this.animHoriz) ? 0 : wExp;\r
+        var hColl = (this.animVert) ? 0 : hExp;\r
+\r
+        // Set animation sizes\r
+        oAnim.attributes = (bShow) ?\r
+            {width: { to: wExp }, height: { to: hExp }} :\r
+            {width: { to: wColl}, height: { to: hColl }};\r
+\r
+        // If opening anew, set to a collapsed size...\r
+        if(bShow && !this._bContainerOpen) {\r
+            oContainer._oContent.style.width = wColl+"px";\r
+            oContainer._oContent.style.height = hColl+"px";\r
+        }\r
+        // Else, set it to its last known size.\r
+        else {\r
+            oContainer._oContent.style.width = wExp+"px";\r
+            oContainer._oContent.style.height = hExp+"px";\r
+        }\r
+\r
+        oContainer.removeChild(oClone);\r
+        oClone = null;\r
+\r
+       var oSelf = this;\r
+       var onAnimComplete = function() {\r
+            // Finish the collapse\r
+               oAnim.onComplete.unsubscribeAll();\r
+\r
+            if(bShow) {\r
+                oSelf.containerExpandEvent.fire(oSelf);\r
+            }\r
+            else {\r
+                oContainer._oContent.style.display = "none";\r
+                oSelf.containerCollapseEvent.fire(oSelf);\r
+            }\r
+            oSelf._toggleContainerHelpers(bShow);\r
+       };\r
+\r
+        // Display container and animate it\r
+        oContainer._oContent.style.display = "block";\r
+        oAnim.onComplete.subscribe(onAnimComplete);\r
+        oAnim.animate();\r
+        this._bContainerOpen = bShow;\r
+    }\r
+    // Else don't animate, just show or hide\r
+    else {\r
+        if(bShow) {\r
+            oContainer._oContent.style.display = "block";\r
+            this.containerExpandEvent.fire(this);\r
+        }\r
+        else {\r
+            oContainer._oContent.style.display = "none";\r
+            this.containerCollapseEvent.fire(this);\r
+        }\r
+        this._toggleContainerHelpers(bShow);\r
+        this._bContainerOpen = bShow;\r
+   }\r
+\r
+};\r
+\r
+/**\r
+ * Toggles the highlight on or off for an item in the container, and also cleans\r
+ * up highlighting of any previous item.\r
+ *\r
+ * @method _toggleHighlight\r
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.\r
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {\r
+    var sHighlight = this.highlightClassName;\r
+    if(this._oCurItem) {\r
+        // Remove highlight from old item\r
+        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);\r
+    }\r
+\r
+    if((sType == "to") && sHighlight) {\r
+        // Apply highlight to new item\r
+        YAHOO.util.Dom.addClass(oNewItem, sHighlight);\r
+        this._oCurItem = oNewItem;\r
+    }\r
+};\r
+\r
+/**\r
+ * Toggles the pre-highlight on or off for an item in the container.\r
+ *\r
+ * @method _togglePrehighlight\r
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.\r
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {\r
+    if(oNewItem == this._oCurItem) {\r
+        return;\r
+    }\r
+\r
+    var sPrehighlight = this.prehighlightClassName;\r
+    if((sType == "mouseover") && sPrehighlight) {\r
+        // Apply prehighlight to new item\r
+        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);\r
+    }\r
+    else {\r
+        // Remove prehighlight from old item\r
+        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);\r
+    }\r
+};\r
+\r
+/**\r
+ * Updates the text input box value with selected query result. If a delimiter\r
+ * has been defined, then the value gets appended with the delimiter.\r
+ *\r
+ * @method _updateValue\r
+ * @param oItem {HTMLElement} The &lt;li&gt; element item with which to update the value.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {\r
+    var oTextbox = this._oTextbox;\r
+    var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null;\r
+    var sSavedQuery = this._sSavedQuery;\r
+    var sResultKey = oItem._sResultKey;\r
+    oTextbox.focus();\r
+\r
+    // First clear text field\r
+    oTextbox.value = "";\r
+    // Grab data to put into text field\r
+    if(sDelimChar) {\r
+        if(sSavedQuery) {\r
+            oTextbox.value = sSavedQuery;\r
+        }\r
+        oTextbox.value += sResultKey + sDelimChar;\r
+        if(sDelimChar != " ") {\r
+            oTextbox.value += " ";\r
+        }\r
+    }\r
+    else { oTextbox.value = sResultKey; }\r
+\r
+    // scroll to bottom of textarea if necessary\r
+    if(oTextbox.type == "textarea") {\r
+        oTextbox.scrollTop = oTextbox.scrollHeight;\r
+    }\r
+\r
+    // move cursor to end\r
+    var end = oTextbox.value.length;\r
+    this._selectText(oTextbox,end,end);\r
+\r
+    this._oCurItem = oItem;\r
+};\r
+\r
+/**\r
+ * Selects a result item from the container\r
+ *\r
+ * @method _selectItem\r
+ * @param oItem {HTMLElement} The selected &lt;li&gt; element item.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._selectItem = function(oItem) {\r
+    this._bItemSelected = true;\r
+    this._updateValue(oItem);\r
+    this._cancelIntervalDetection(this);\r
+    this.itemSelectEvent.fire(this, oItem, oItem._oResultData);\r
+    this._toggleContainer(false);\r
+};\r
+\r
+/**\r
+ * For values updated by type-ahead, the right arrow key jumps to the end\r
+ * of the textbox, otherwise the container is closed.\r
+ *\r
+ * @method _jumpSelection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {\r
+    if(!this.typeAhead) {\r
+        return;\r
+    }\r
+    else {\r
+        this._toggleContainer(false);\r
+    }\r
+};\r
+\r
+/**\r
+ * Triggered by up and down arrow keys, changes the current highlighted\r
+ * &lt;li&gt; element item. Scrolls container if necessary.\r
+ *\r
+ * @method _moveSelection\r
+ * @param nKeyCode {Number} Code of key pressed.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {\r
+    if(this._bContainerOpen) {\r
+        // Determine current item's id number\r
+        var oCurItem = this._oCurItem;\r
+        var nCurItemIndex = -1;\r
+\r
+        if (oCurItem) {\r
+            nCurItemIndex = oCurItem._nItemIndex;\r
+        }\r
+\r
+        var nNewItemIndex = (nKeyCode == 40) ?\r
+                (nCurItemIndex + 1) : (nCurItemIndex - 1);\r
+\r
+        // Out of bounds\r
+        if (nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {\r
+            return;\r
+        }\r
+\r
+        if (oCurItem) {\r
+            // Unhighlight current item\r
+            this._toggleHighlight(oCurItem, "from");\r
+            this.itemArrowFromEvent.fire(this, oCurItem);\r
+        }\r
+        if (nNewItemIndex == -1) {\r
+           // Go back to query (remove type-ahead string)\r
+            if(this.delimChar && this._sSavedQuery) {\r
+                if (!this._textMatchesOption()) {\r
+                    this._oTextbox.value = this._sSavedQuery;\r
+                }\r
+                else {\r
+                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;\r
+                }\r
+            }\r
+            else {\r
+                this._oTextbox.value = this._sCurQuery;\r
+            }\r
+            this._oCurItem = null;\r
+            return;\r
+        }\r
+        if (nNewItemIndex == -2) {\r
+            // Close container\r
+            this._toggleContainer(false);\r
+            return;\r
+        }\r
+\r
+        var oNewItem = this._aListItems[nNewItemIndex];\r
+\r
+        // Scroll the container if necessary\r
+        var oContent = this._oContainer._oContent;\r
+        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||\r
+            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));\r
+        if(scrollOn && (nNewItemIndex > -1) &&\r
+        (nNewItemIndex < this._nDisplayedItems)) {\r
+            // User is keying down\r
+            if(nKeyCode == 40) {\r
+                // Bottom of selected item is below scroll area...\r
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {\r
+                    // Set bottom of scroll area to bottom of selected item\r
+                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;\r
+                }\r
+                // Bottom of selected item is above scroll area...\r
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {\r
+                    // Set top of selected item to top of scroll area\r
+                    oContent.scrollTop = oNewItem.offsetTop;\r
+\r
+                }\r
+            }\r
+            // User is keying up\r
+            else {\r
+                // Top of selected item is above scroll area\r
+                if(oNewItem.offsetTop < oContent.scrollTop) {\r
+                    // Set top of scroll area to top of selected item\r
+                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r
+                }\r
+                // Top of selected item is below scroll area\r
+                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {\r
+                    // Set bottom of selected item to bottom of scroll area\r
+                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;\r
+                }\r
+            }\r
+        }\r
+\r
+        this._toggleHighlight(oNewItem, "to");\r
+        this.itemArrowToEvent.fire(this, oNewItem);\r
+        if(this.typeAhead) {\r
+            this._updateValue(oNewItem);\r
+        }\r
+    }\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private event handlers\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Handles &lt;li&gt; element mouseover events in the container.\r
+ *\r
+ * @method _onItemMouseover\r
+ * @param v {HTMLEvent} The mouseover event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {\r
+    if(oSelf.prehighlightClassName) {\r
+        oSelf._togglePrehighlight(this,"mouseover");\r
+    }\r
+    else {\r
+        oSelf._toggleHighlight(this,"to");\r
+    }\r
+\r
+    oSelf.itemMouseOverEvent.fire(oSelf, this);\r
+};\r
+\r
+/**\r
+ * Handles &lt;li&gt; element mouseout events in the container.\r
+ *\r
+ * @method _onItemMouseout\r
+ * @param v {HTMLEvent} The mouseout event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {\r
+    if(oSelf.prehighlightClassName) {\r
+        oSelf._togglePrehighlight(this,"mouseout");\r
+    }\r
+    else {\r
+        oSelf._toggleHighlight(this,"from");\r
+    }\r
+\r
+    oSelf.itemMouseOutEvent.fire(oSelf, this);\r
+};\r
+\r
+/**\r
+ * Handles &lt;li&gt; element click events in the container.\r
+ *\r
+ * @method _onItemMouseclick\r
+ * @param v {HTMLEvent} The click event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {\r
+    // In case item has not been moused over\r
+    oSelf._toggleHighlight(this,"to");\r
+    oSelf._selectItem(this);\r
+};\r
+\r
+/**\r
+ * Handles container mouseover events.\r
+ *\r
+ * @method _onContainerMouseover\r
+ * @param v {HTMLEvent} The mouseover event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {\r
+    oSelf._bOverContainer = true;\r
+};\r
+\r
+/**\r
+ * Handles container mouseout events.\r
+ *\r
+ * @method _onContainerMouseout\r
+ * @param v {HTMLEvent} The mouseout event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {\r
+    oSelf._bOverContainer = false;\r
+    // If container is still active\r
+    if(oSelf._oCurItem) {\r
+        oSelf._toggleHighlight(oSelf._oCurItem,"to");\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles container scroll events.\r
+ *\r
+ * @method _onContainerScroll\r
+ * @param v {HTMLEvent} The scroll event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {\r
+    oSelf._oTextbox.focus();\r
+};\r
+\r
+/**\r
+ * Handles container resize events.\r
+ *\r
+ * @method _onContainerResize\r
+ * @param v {HTMLEvent} The resize event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {\r
+    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);\r
+};\r
+\r
+\r
+/**\r
+ * Handles textbox keydown events of functional keys, mainly for UI behavior.\r
+ *\r
+ * @method _onTextboxKeyDown\r
+ * @param v {HTMLEvent} The keydown event.\r
+ * @param oSelf {object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {\r
+    var nKeyCode = v.keyCode;\r
+\r
+    switch (nKeyCode) {\r
+        case 9: // tab\r
+            if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r
+                if(oSelf._bContainerOpen) {\r
+                    YAHOO.util.Event.stopEvent(v);\r
+                }\r
+            }\r
+            // select an item or clear out\r
+            if(oSelf._oCurItem) {\r
+                oSelf._selectItem(oSelf._oCurItem);\r
+            }\r
+            else {\r
+                oSelf._toggleContainer(false);\r
+            }\r
+            break;\r
+        case 13: // enter\r
+            if(oSelf._nKeyCode != nKeyCode) {\r
+                if(oSelf._bContainerOpen) {\r
+                    YAHOO.util.Event.stopEvent(v);\r
+                }\r
+            }\r
+            if(oSelf._oCurItem) {\r
+                oSelf._selectItem(oSelf._oCurItem);\r
+            }\r
+            else {\r
+                oSelf._toggleContainer(false);\r
+            }\r
+            break;\r
+        case 27: // esc\r
+            oSelf._toggleContainer(false);\r
+            return;\r
+        case 39: // right\r
+            oSelf._jumpSelection();\r
+            break;\r
+        case 38: // up\r
+            YAHOO.util.Event.stopEvent(v);\r
+            oSelf._moveSelection(nKeyCode);\r
+            break;\r
+        case 40: // down\r
+            YAHOO.util.Event.stopEvent(v);\r
+            oSelf._moveSelection(nKeyCode);\r
+            break;\r
+        default:\r
+            break;\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles textbox keypress events.\r
+ * @method _onTextboxKeyPress\r
+ * @param v {HTMLEvent} The keypress event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {\r
+    var nKeyCode = v.keyCode;\r
+\r
+        //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)\r
+        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);\r
+        if(isMac) {\r
+            switch (nKeyCode) {\r
+            case 9: // tab\r
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r
+                    if(oSelf._bContainerOpen) {\r
+                        YAHOO.util.Event.stopEvent(v);\r
+                    }\r
+                }\r
+                break;\r
+            case 13: // enter\r
+                    if(oSelf._nKeyCode != nKeyCode) {\r
+                        if(oSelf._bContainerOpen) {\r
+                            YAHOO.util.Event.stopEvent(v);\r
+                        }\r
+                    }\r
+                break;\r
+            case 38: // up\r
+            case 40: // down\r
+                YAHOO.util.Event.stopEvent(v);\r
+                break;\r
+            default:\r
+                break;\r
+            }\r
+        }\r
+\r
+        //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948)\r
+        // Korean IME detected\r
+        else if(nKeyCode == 229) {\r
+            oSelf._queryInterval = setInterval(function() { oSelf._onIMEDetected(oSelf); },500);\r
+        }\r
+};\r
+\r
+/**\r
+ * Handles textbox keyup events that trigger queries.\r
+ *\r
+ * @method _onTextboxKeyUp\r
+ * @param v {HTMLEvent} The keyup event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {\r
+    // Check to see if any of the public properties have been updated\r
+    oSelf._initProps();\r
+\r
+    var nKeyCode = v.keyCode;\r
+    oSelf._nKeyCode = nKeyCode;\r
+    var sText = this.value; //string in textbox\r
+\r
+    // Filter out chars that don't trigger queries\r
+    if (oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {\r
+        return;\r
+    }\r
+    else {\r
+        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);\r
+    }\r
+\r
+    // Set timeout on the request\r
+    if (oSelf.queryDelay > 0) {\r
+        var nDelayID =\r
+            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));\r
+\r
+        if (oSelf._nDelayID != -1) {\r
+            clearTimeout(oSelf._nDelayID);\r
+        }\r
+\r
+        oSelf._nDelayID = nDelayID;\r
+    }\r
+    else {\r
+        // No delay so send request immediately\r
+        oSelf._sendQuery(sText);\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles text input box receiving focus.\r
+ *\r
+ * @method _onTextboxFocus\r
+ * @param v {HTMLEvent} The focus event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {\r
+    oSelf._oTextbox.setAttribute("autocomplete","off");\r
+    oSelf._bFocused = true;\r
+    oSelf.textboxFocusEvent.fire(oSelf);\r
+};\r
+\r
+/**\r
+ * Handles text input box losing focus.\r
+ *\r
+ * @method _onTextboxBlur\r
+ * @param v {HTMLEvent} The focus event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {\r
+    // Don't treat as a blur if it was a selection via mouse click\r
+    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {\r
+        // Current query needs to be validated\r
+        if(!oSelf._bItemSelected) {\r
+            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && !oSelf._textMatchesOption())) {\r
+                if(oSelf.forceSelection) {\r
+                    oSelf._clearSelection();\r
+                }\r
+                else {\r
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);\r
+                }\r
+            }\r
+        }\r
+\r
+        if(oSelf._bContainerOpen) {\r
+            oSelf._toggleContainer(false);\r
+        }\r
+        oSelf._cancelIntervalDetection(oSelf);\r
+        oSelf._bFocused = false;\r
+        oSelf.textboxBlurEvent.fire(oSelf);\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles form submission event.\r
+ *\r
+ * @method _onFormSubmit\r
+ * @param v {HTMLEvent} The submit event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {\r
+    if(oSelf.allowBrowserAutocomplete) {\r
+        oSelf._oTextbox.setAttribute("autocomplete","on");\r
+    }\r
+    else {\r
+        oSelf._oTextbox.setAttribute("autocomplete","off");\r
+    }\r
+};\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Class providing the customizable functionality of a plug-and-play DHTML\r\r
- * auto complete widget.  Some key features:\r\r
- * <ul>\r\r
- * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>\r\r
- * <li>The drop down container can "roll down" or "fly out" via configurable\r\r
- * animation</li>\r\r
- * <li>UI look-and-feel customizable through CSS, including container\r\r
- * attributes, borders, position, fonts, etc</li>\r\r
- * </ul>\r\r
- *\r\r
- * requires YAHOO.util.Dom Dom utility\r\r
- * requires YAHOO.util.Event Event utility\r\r
- * requires YAHOO.widget.DataSource Data source class\r\r
- * see YAHOO.util.Animation Animation utility\r\r
- * see JSON JSON library\r\r
- *\r\r
- * @constructor\r\r
- * @param {element | string} inputEl DOM element reference or string ID of the auto complete input field\r\r
- * @param {element | string} containerEl DOM element reference or string ID of the auto complete &lt;div&gt;\r\r
- *                              container\r\r
- * @param {object} oDataSource Instance of YAHOO.widget.DataSource for query/results\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
- */\r\r
-YAHOO.widget.AutoComplete = function(inputEl,containerEl,oDataSource,oConfigs) {\r\r
-    if(inputEl && containerEl && oDataSource) {\r\r
-        // Validate data source\r\r
-        if (oDataSource && (oDataSource instanceof YAHOO.widget.DataSource)) {\r\r
-            this.dataSource = oDataSource;\r\r
-        }\r\r
-        else {\r\r
-            YAHOO.log("Could not instantiate AutoComplete due to an invalid DataSource", "error", this.toString());\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Validate input element\r\r
-        if(YAHOO.util.Dom.inDocument(inputEl)) {\r\r
-            if(typeof inputEl == "string") {\r\r
-                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + inputEl;\r\r
-                    this._oTextbox = document.getElementById(inputEl);\r\r
-            }\r\r
-            else {\r\r
-                this._sName = (inputEl.id) ?\r\r
-                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + inputEl.id:\r\r
-                    "instance" + YAHOO.widget.AutoComplete._nIndex;\r\r
-                this._oTextbox = inputEl;\r\r
-            }\r\r
-        }\r\r
-        else {\r\r
-            YAHOO.log("Could not instantiate AutoComplete due to an invalid input element", "error", this.toString());\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Validate container element\r\r
-        if(YAHOO.util.Dom.inDocument(containerEl)) {\r\r
-            if(typeof containerEl == "string") {\r\r
-                    this._oContainer = document.getElementById(containerEl);\r\r
-            }\r\r
-            else {\r\r
-                this._oContainer = containerEl;\r\r
-            }\r\r
-            if(this._oContainer.style.display == "none") {\r\r
-                YAHOO.log("The container may not display properly if display is set to \"none\" in CSS", "warn", this.toString());\r\r
-            }\r\r
-        }\r\r
-        else {\r\r
-            YAHOO.log("Could not instantiate AutoComplete due to an invalid container element", "error", this.toString());\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Set any config params passed in to override defaults\r\r
-        if (typeof oConfigs == "object") {\r\r
-            for(var sConfig in oConfigs) {\r\r
-                if (sConfig) {\r\r
-                    this[sConfig] = oConfigs[sConfig];\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        // Initialization sequence\r\r
-        this._initContainer();\r\r
-        this._initProps();\r\r
-        this._initList();\r\r
-        this._initContainerHelpers();\r\r
-\r\r
-        // Set up events\r\r
-        var oSelf = this;\r\r
-        var oTextbox = this._oTextbox;\r\r
-        // Events are actually for the content module within the container\r\r
-        var oContent = this._oContainer._oContent;\r\r
-\r\r
-        // Dom events\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);\r\r
-        if(oTextbox.form) {\r\r
-            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);\r\r
-        }\r\r
-\r\r
-        // Custom events\r\r
-        this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);\r\r
-        this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this);\r\r
-        this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this);\r\r
-        this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this);\r\r
-        this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r\r
-        this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this);\r\r
-        this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this);\r\r
-        this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this);\r\r
-        this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this);\r\r
-        this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this);\r\r
-        this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this);\r\r
-        this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this);\r\r
-        this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this);\r\r
-        this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r\r
-        this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r\r
-        this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r\r
-        \r\r
-        // Finish up\r\r
-        oTextbox.setAttribute("autocomplete","off");\r\r
-        YAHOO.widget.AutoComplete._nIndex++;\r\r
-        YAHOO.log("AutoComplete initialized","info",this.toString());\r\r
-    }\r\r
-    // Required arguments were not found\r\r
-    else {\r\r
-        YAHOO.log("Could not instantiate AutoComplete due invalid arguments", "error", this.toString());\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * The data source object that encapsulates the data used for auto completion.\r\r
- * This object should be an inherited object from YAHOO.widget.DataSource.\r\r
- *\r\r
- * @type object\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataSource = null;\r\r
-\r\r
-/**\r\r
- * Number of characters that must be entered before querying for results.\r\r
- * Default: 1.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;\r\r
-\r\r
-/**\r\r
- * Maximum number of results to display in auto complete container. Default: 10.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;\r\r
-\r\r
-/**\r\r
- * Number of seconds to delay before submitting a query request.  If a query\r\r
- * request is received before a previous one has completed its delay, the\r\r
- * previous request is cancelled and the new request is set to the delay.\r\r
- * Default: 0.5.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.queryDelay = 0.5;\r\r
-\r\r
-/**\r\r
- * Class name of a highlighted item within the auto complete container.\r\r
- * Default: "yui-ac-highlight".\r\r
- *\r\r
- * @type string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";\r\r
-\r\r
-/**\r\r
- * Class name of a pre-highlighted item within the auto complete container.\r\r
- * Default: null.\r\r
- *\r\r
- * @type string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;\r\r
-\r\r
-/**\r\r
- * Query delimiter. A single character separator for multiple delimited\r\r
- * selections. Multiple delimiter characteres may be defined as an array of\r\r
- * strings. A null value or empty string indicates that query results cannot\r\r
- * be delimited. This feature is not recommended if you need forceSelection to\r\r
- * be true. Default: null.\r\r
- *\r\r
- * @type string or array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.delimChar = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the first item in the auto complete container should be\r\r
- * automatically highlighted on expand. Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.autoHighlight = true;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete input field should be automatically updated\r\r
- * with the first query result as the user types, auto-selecting the substring\r\r
- * that the user has not typed. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.typeAhead = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to animate the expansion/collapse of the auto complete\r\r
- * container in the horizontal direction. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animHoriz = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to animate the expansion/collapse of the auto complete\r\r
- * container in the vertical direction. Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animVert = true;\r\r
-\r\r
-/**\r\r
- * Speed of container expand/collapse animation, in seconds. Default: 0.3.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;\r\r
-\r\r
-/**\r\r
- * Whether or not to force the user's selection to match one of the query\r\r
- * results. Enabling this feature essentially transforms the auto complete form\r\r
- * input field into a &lt;select&gt; field. This feature is not recommended\r\r
- * with delimiter character(s) defined. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.forceSelection = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to allow browsers to cache user-typed input in the input\r\r
- * field. Disabling this feature will prevent the widget from setting the\r\r
- * autocomplete="off" on the auto complete input field. When autocomplete="off"\r\r
- * and users click the back button after form submission, user-typed input can\r\r
- * be prefilled by the browser from its cache. This caching of user input may\r\r
- * not be desired for sensitive data, such as credit card numbers, in which\r\r
- * case, implementers should consider setting allowBrowserAutocomplete to false.\r\r
- * Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container should always be displayed.\r\r
- * Enabling this feature prevents the toggling of the container to a collapsed\r\r
- * state. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to use an iFrame to layer over Windows form elements in\r\r
- * IE. Set to true only when the auto complete container will be on top of a\r\r
- * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,\r\r
- * 5.5 < IE < 7). Default:false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.useIFrame = false;\r\r
-\r\r
-/**\r\r
- * Configurable iFrame src used when useIFrame = true. Implementations over SSL\r\r
- * should set this parameter to an appropriate https location in order to avoid\r\r
- * security-related browser errors. Default:"about:blank".\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.iFrameSrc = "about:blank";\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container should have a shadow. Default:false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.useShadow = false;\r\r
-\r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
- /**\r\r
- * Public accessor to the unique name of the auto complete instance.\r\r
- *\r\r
- * @return {string} Unique name of the auto complete instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getName = function() {\r\r
-    return this._sName;\r\r
-};\r\r
-\r\r
- /**\r\r
- * Public accessor to the unique name of the auto complete instance.\r\r
- *\r\r
- * @return {string} Unique name of the auto complete instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.toString = function() {\r\r
-    return "AutoComplete " + this._sName;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to the internal array of DOM &lt;li&gt; elements that\r\r
- * display query results within the auto complete container.\r\r
- *\r\r
- * @return {array} Array of &lt;li&gt; elements within the auto complete\r\r
- *                 container\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getListItems = function() {\r\r
-    return this._aListItems;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to the data held in an &lt;li&gt; element of the\r\r
- * auto complete container.\r\r
- *\r\r
- * @return {object or array} Object or array of result data or null\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {\r\r
-    if(oListItem._oResultData) {\r\r
-        return oListItem._oResultData;\r\r
-    }\r\r
-    else {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container header. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_hd".\r\r
- *\r\r
- * @param {string} sHeader HTML markup for container header\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {\r\r
-    if(sHeader) {\r\r
-        if(this._oContainer._oContent._oHeader) {\r\r
-            this._oContainer._oContent._oHeader.innerHTML = sHeader;\r\r
-            this._oContainer._oContent._oHeader.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oHeader.innerHTML = "";\r\r
-        this._oContainer._oContent._oHeader.style.display = "none";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container footer. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_ft".\r\r
- *\r\r
- * @param {string} sFooter HTML markup for container footer\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {\r\r
-    if(sFooter) {\r\r
-        if(this._oContainer._oContent._oFooter) {\r\r
-            this._oContainer._oContent._oFooter.innerHTML = sFooter;\r\r
-            this._oContainer._oContent._oFooter.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oFooter.innerHTML = "";\r\r
-        this._oContainer._oContent._oFooter.style.display = "none";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container body. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_bd".\r\r
- *\r\r
- * @param {string} sHeader HTML markup for container body\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {\r\r
-    if(sBody) {\r\r
-        if(this._oContainer._oContent._oBody) {\r\r
-            this._oContainer._oContent._oBody.innerHTML = sBody;\r\r
-            this._oContainer._oContent._oBody.style.display = "block";\r\r
-            this._oContainer._oContent.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oBody.innerHTML = "";\r\r
-        this._oContainer._oContent.style.display = "none";\r\r
-    }\r\r
-    this._maxResultsDisplayed = 0;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Overridable method that converts a result item object into HTML markup\r\r
- * for display. Return data values are accessible via the oResultItem object,\r\r
- * and the key return value will always be oResultItem[0]. Markup will be\r\r
- * displayed within &lt;li&gt; element tags in the container.\r\r
- *\r\r
- * @param {object} oResultItem Result item object representing one query result\r\r
- * @param {string} sQuery The current query string\r\r
- * @return {string} HTML markup of formatted result data\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {\r\r
-    var sResult = oResultItem[0];\r\r
-    if(sResult) {\r\r
-        return sResult;\r\r
-    }\r\r
-    else {\r\r
-        return "";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Makes query request to the data source.\r\r
- *\r\r
- * @param {string} sQuery Query string.\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {\r\r
-    if(sQuery) {\r\r
-        this._sendQuery(sQuery);\r\r
-    }\r\r
-    else {\r\r
-        YAHOO.log("Query could not be sent because the string value was empty or null.","warn",this.toString());\r\r
-        return;\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Fired when the auto complete text input box receives focus. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     -  args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete text input box receives key input. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The keycode number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance makes a query to the data source.\r\r
- * Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance receives query results from the data\r\r
- * source. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- *     - args[2] Results array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance does not receive query results from the\r\r
- * data source due to an error. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete container is expanded. If alwaysShowContainer is\r\r
- * enabled, then containerExpandEvent will be fired when the container is\r\r
- * populated with results. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete textbox has been prefilled by the type-ahead\r\r
- * feature. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- *     - args[2] The prefill string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been moused over. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt element item moused to\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been moused out. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item moused from\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been arrowed to. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item arrowed to\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been arrowed away from. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item arrowed from\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when an item is selected via mouse click, ENTER key, or TAB key.\r\r
- * Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The selected &lt;li&gt; element item\r\r
- *     - args[2] The data returned for the item, either as an object, or mapped from the schema into an array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when an user selection does not match any of the displayed result items.\r\r
- * Note that this event may not behave as expected when delimiter characters\r\r
- * have been defined. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The user selection\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired if forceSelection is enabled and the user's input has been cleared\r\r
- * because it did not match one of the returned query results. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete container is collapsed. If alwaysShowContainer is\r\r
- * enabled, then containerCollapseEvent will be fired when the container is\r\r
- * cleared of results. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete text input box loses focus. Subscribers receive\r\r
- * an array of the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;\r\r
-\r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Internal class variable to index multiple auto complete instances.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete._nIndex = 0;\r\r
-\r\r
-/**\r\r
- * Name of auto complete instance.\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sName = null;\r\r
-\r\r
-/**\r\r
- * Text input box DOM element.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oTextbox = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the textbox is currently in focus. If query results come back\r\r
- * but the user has already moved on, do not proceed with auto complete behavior.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bFocused = true;\r\r
-\r\r
-/**\r\r
- * Animation instance for container expand/collapse.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oAnim = null;\r\r
-\r\r
-/**\r\r
- * Container DOM element.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oContainer = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container is currently open.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;\r\r
-\r\r
-/**\r\r
- * Whether or not the mouse is currently over the auto complete\r\r
- * container. This is necessary in order to prevent clicks on container items\r\r
- * from being text input box blur events.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bOverContainer = false;\r\r
-\r\r
-/**\r\r
- * Array of &lt;li&gt; elements references that contain query results within the\r\r
- * auto complete container.\r\r
- *\r\r
- * @type array\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._aListItems = null;\r\r
-\r\r
-/**\r\r
- * Number of &lt;li&gt; elements currently displayed in auto complete container.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;\r\r
-\r\r
-/**\r\r
- * Internal count of &lt;li&gt; elements displayed and hidden in auto complete container.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;\r\r
-\r\r
-/**\r\r
- * Current query string\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sCurQuery = null;\r\r
-\r\r
-/**\r\r
- * Past queries this session (for saving delimited queries).\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;\r\r
-\r\r
-/**\r\r
- * Pointer to the currently highlighted &lt;li&gt; element in the container.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oCurItem = null;\r\r
-\r\r
-/**\r\r
- * Whether or not an item has been selected since the container was populated\r\r
- * with results. Reset to false by _populateList, and set to true when item is\r\r
- * selected.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bItemSelected = false;\r\r
-\r\r
-/**\r\r
- * Key code of the last key pressed in textbox.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nKeyCode = null;\r\r
-\r\r
-/**\r\r
- * Delay timeout ID.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nDelayID = -1;\r\r
-\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Updates and validates latest public config properties.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initProps = function() {\r\r
-    // Correct any invalid values\r\r
-    var minQueryLength = this.minQueryLength;\r\r
-    if(isNaN(minQueryLength) || (minQueryLength < 1)) {\r\r
-        minQueryLength = 1;\r\r
-    }\r\r
-    var maxResultsDisplayed = this.maxResultsDisplayed;\r\r
-    if(isNaN(this.maxResultsDisplayed) || (this.maxResultsDisplayed < 1)) {\r\r
-        this.maxResultsDisplayed = 10;\r\r
-    }\r\r
-    var queryDelay = this.queryDelay;\r\r
-    if(isNaN(this.queryDelay) || (this.queryDelay < 0)) {\r\r
-        this.queryDelay = 0.5;\r\r
-    }\r\r
-    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r\r
-    if(aDelimChar) {\r\r
-        if(typeof aDelimChar == "string") {\r\r
-            this.delimChar = [aDelimChar];\r\r
-        }\r\r
-        else if(aDelimChar.constructor != Array) {\r\r
-            this.delimChar = null;\r\r
-        }\r\r
-    }\r\r
-    var animSpeed = this.animSpeed;\r\r
-    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {\r\r
-        if(isNaN(animSpeed) || (animSpeed < 0)) {\r\r
-            animSpeed = 0.3;\r\r
-        }\r\r
-        if(!this._oAnim ) {\r\r
-            oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);\r\r
-            this._oAnim = oAnim;\r\r
-        }\r\r
-        else {\r\r
-            this._oAnim.duration = animSpeed;\r\r
-        }\r\r
-    }\r\r
-    if(this.forceSelection && this.delimChar) {\r\r
-        YAHOO.log("The forceSelection feature has been enabled with delimChar defined.","warn", this.toString());\r\r
-    }\r\r
-    if(this.alwaysShowContainer && (this.useShadow || this.useIFrame)) {\r\r
-        YAHOO.log("The features useShadow and useIFrame are not compatible with the alwaysShowContainer feature.","warn", this.toString());\r\r
-    }\r\r
-\r\r
-    if(this.alwaysShowContainer) {\r\r
-        this._bContainerOpen = true;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes the auto complete container helpers if they are enabled and do\r\r
- * not exist\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {\r\r
-    if(this.useShadow && !this._oContainer._oShadow) {\r\r
-        var oShadow = document.createElement("div");\r\r
-        oShadow.className = "yui-ac-shadow";\r\r
-        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);\r\r
-    }\r\r
-    if(this.useIFrame && !this._oContainer._oIFrame) {\r\r
-        var oIFrame = document.createElement("iframe");\r\r
-        oIFrame.src = this.iFrameSrc;\r\r
-        oIFrame.frameBorder = 0;\r\r
-        oIFrame.scrolling = "no";\r\r
-        oIFrame.style.position = "absolute";\r\r
-        oIFrame.style.width = "100%";\r\r
-        oIFrame.style.height = "100%";\r\r
-        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes the auto complete container once at object creation\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initContainer = function() {\r\r
-    if(!this._oContainer._oContent) {\r\r
-        // The oContent div helps size the iframe and shadow properly\r\r
-        var oContent = document.createElement("div");\r\r
-        oContent.className = "yui-ac-content";\r\r
-        oContent.style.display = "none";\r\r
-        this._oContainer._oContent = this._oContainer.appendChild(oContent);\r\r
-\r\r
-        var oHeader = document.createElement("div");\r\r
-        oHeader.className = "yui-ac-hd";\r\r
-        oHeader.style.display = "none";\r\r
-        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);\r\r
-\r\r
-        var oBody = document.createElement("div");\r\r
-        oBody.className = "yui-ac-bd";\r\r
-        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);\r\r
-\r\r
-        var oFooter = document.createElement("div");\r\r
-        oFooter.className = "yui-ac-ft";\r\r
-        oFooter.style.display = "none";\r\r
-        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);\r\r
-    }\r\r
-    else {\r\r
-        YAHOO.log("Could not initialize the container","warn",this.toString());\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Clears out contents of container body and creates up to\r\r
- * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an\r\r
- * &lt;ul&gt; element.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initList = function() {\r\r
-    this._aListItems = [];\r\r
-    while(this._oContainer._oContent._oBody.hasChildNodes()) {\r\r
-        var oldListItems = this.getListItems();\r\r
-        if(oldListItems) {\r\r
-            for(var oldi = oldListItems.length-1; oldi >= 0; i--) {\r\r
-                oldListItems[oldi] = null;\r\r
-            }\r\r
-        }\r\r
-        this._oContainer._oContent._oBody.innerHTML = "";\r\r
-    }\r\r
-\r\r
-    var oList = document.createElement("ul");\r\r
-    oList = this._oContainer._oContent._oBody.appendChild(oList);\r\r
-    for(var i=0; i<this.maxResultsDisplayed; i++) {\r\r
-        var oItem = document.createElement("li");\r\r
-        oItem = oList.appendChild(oItem);\r\r
-        this._aListItems[i] = oItem;\r\r
-        this._initListItem(oItem, i);\r\r
-    }\r\r
-    this._maxResultsDisplayed = this.maxResultsDisplayed;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes each &lt;li&gt; element in the container list.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; DOM element\r\r
- * @param {number} nItemIndex The index of the element\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initListItem = function(oItem, nItemIndex) {\r\r
-    var oSelf = this;\r\r
-    oItem.style.display = "none";\r\r
-    oItem._nItemIndex = nItemIndex;\r\r
-\r\r
-    oItem.mouseover = oItem.mouseout = oItem.onclick = null;\r\r
-    YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);\r\r
-    YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);\r\r
-    YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element mouseover events in the container.\r\r
- *\r\r
- * @param {event} v The mouseover event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {\r\r
-    if(oSelf.prehighlightClassName) {\r\r
-        oSelf._togglePrehighlight(this,"mouseover");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._toggleHighlight(this,"to");\r\r
-    }\r\r
-\r\r
-    oSelf.itemMouseOverEvent.fire(oSelf, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element mouseout events in the container.\r\r
- *\r\r
- * @param {event} v The mouseout event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {\r\r
-    if(oSelf.prehighlightClassName) {\r\r
-        oSelf._togglePrehighlight(this,"mouseout");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._toggleHighlight(this,"from");\r\r
-    }\r\r
-\r\r
-    oSelf.itemMouseOutEvent.fire(oSelf, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element click events in the container.\r\r
- *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {\r\r
-    // In case item has not been moused over\r\r
-    oSelf._toggleHighlight(this,"to");\r\r
-    oSelf._selectItem(this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container mouseover events.\r\r
- *\r\r
- * @param {event} v The mouseover event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {\r\r
-    oSelf._bOverContainer = true;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container mouseout events.\r\r
- *\r\r
- * @param {event} v The mouseout event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {\r\r
-    oSelf._bOverContainer = false;\r\r
-    // If container is still active\r\r
-    if(oSelf._oCurItem) {\r\r
-        oSelf._toggleHighlight(oSelf._oCurItem,"to");\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container scroll events.\r\r
- *\r\r
- * @param {event} v The scroll event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {\r\r
-    oSelf._oTextbox.focus();\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container resize events.\r\r
- *\r\r
- * @param {event} v The resize event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {\r\r
-    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);\r\r
-};\r\r
-\r\r
-\r\r
-/**\r\r
- * Handles textbox keydown events of functional keys, mainly for UI behavior.\r\r
- *\r\r
- * @param {event} v The keydown event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {\r\r
-    var nKeyCode = v.keyCode;\r\r
-\r\r
-    switch (nKeyCode) {\r\r
-        case 9: // tab\r\r
-            if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r\r
-                if(oSelf._bContainerOpen) {\r\r
-                    YAHOO.util.Event.stopEvent(v);\r\r
-                }\r\r
-            }\r\r
-            // select an item or clear out\r\r
-            if(oSelf._oCurItem) {\r\r
-                oSelf._selectItem(oSelf._oCurItem);\r\r
-            }\r\r
-            else {\r\r
-                oSelf._clearList();\r\r
-            }\r\r
-            break;\r\r
-        case 13: // enter\r\r
-            if(oSelf._nKeyCode != nKeyCode) {\r\r
-                if(oSelf._bContainerOpen) {\r\r
-                    YAHOO.util.Event.stopEvent(v);\r\r
-                }\r\r
-            }\r\r
-            if(oSelf._oCurItem) {\r\r
-                oSelf._selectItem(oSelf._oCurItem);\r\r
-            }\r\r
-            else {\r\r
-                oSelf._clearList();\r\r
-            }\r\r
-            break;\r\r
-        case 27: // esc\r\r
-            oSelf._clearList();\r\r
-            return;\r\r
-        case 39: // right\r\r
-            oSelf._jumpSelection();\r\r
-            break;\r\r
-        case 38: // up\r\r
-            YAHOO.util.Event.stopEvent(v);\r\r
-            oSelf._moveSelection(nKeyCode);\r\r
-            break;\r\r
-        case 40: // down\r\r
-            YAHOO.util.Event.stopEvent(v);\r\r
-            oSelf._moveSelection(nKeyCode);\r\r
-            break;\r\r
-        default:\r\r
-            break;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles textbox keypress events, mainly for stopEvent in Safari.\r\r
- *\r\r
- * @param {event} v The keyup event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {\r\r
-    var nKeyCode = v.keyCode;\r\r
-\r\r
-    switch (nKeyCode) {\r\r
-    case 9: // tab\r\r
-    case 13: // enter\r\r
-        if((oSelf._nKeyCode != nKeyCode)) {\r\r
-                YAHOO.util.Event.stopEvent(v);\r\r
-        }\r\r
-        break;\r\r
-    case 38: // up\r\r
-    case 40: // down\r\r
-        YAHOO.util.Event.stopEvent(v);\r\r
-        break;\r\r
-    default:\r\r
-        break;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles textbox keyup events that trigger queries.\r\r
- *\r\r
- * @param {event} v The keyup event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {\r\r
-    // Check to see if any of the public properties have been updated\r\r
-    oSelf._initProps();\r\r
-\r\r
-    var nKeyCode = v.keyCode;\r\r
-    oSelf._nKeyCode = nKeyCode;\r\r
-    var sChar = String.fromCharCode(nKeyCode);\r\r
-    var sText = this.value; //string in textbox\r\r
-\r\r
-    // Filter out chars that don't trigger queries\r\r
-    if (oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {\r\r
-        return;\r\r
-    }\r\r
-    else {\r\r
-        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);\r\r
-    }\r\r
-\r\r
-    // Set timeout on the request\r\r
-    if (oSelf.queryDelay > 0) {\r\r
-        var nDelayID =\r\r
-            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));\r\r
-\r\r
-        if (oSelf._nDelayID != -1) {\r\r
-            clearTimeout(oSelf._nDelayID);\r\r
-        }\r\r
-\r\r
-        oSelf._nDelayID = nDelayID;\r\r
-    }\r\r
-    else {\r\r
-        // No delay so send request immediately\r\r
-        oSelf._sendQuery(sText);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Whether or not key is functional or should be ignored. Note that the right\r\r
- * arrow key is NOT an ignored key since it triggers queries for certain intl\r\r
- * charsets.\r\r
- *\r\r
- * @param {number} nKeycode Code of key pressed\r\r
- * @return {boolean} Whether or not to be ignore key\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {\r\r
-    if ((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter\r\r
-            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl\r\r
-            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock\r\r
-            (nKeyCode == 27) || // esc\r\r
-            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end\r\r
-            (nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up\r\r
-            (nKeyCode == 40) || // down\r\r
-            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert\r\r
-        return true;\r\r
-    }\r\r
-    return false;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles text input box receiving focus.\r\r
- *\r\r
- * @param {event} v The focus event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {\r\r
-    oSelf._oTextbox.setAttribute("autocomplete","off");\r\r
-    oSelf._bFocused = true;\r\r
-    oSelf.textboxFocusEvent.fire(oSelf);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles text input box losing focus.\r\r
- *\r\r
- * @param {event} v The focus event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {\r\r
-    // Don't treat as a blur if it was a selection via mouse click\r\r
-    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {\r\r
-        // Current query needs to be validated\r\r
-        if(!oSelf._bItemSelected) {\r\r
-            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && !oSelf._textMatchesOption())) {\r\r
-                if(oSelf.forceSelection) {\r\r
-                    oSelf._clearSelection();\r\r
-                }\r\r
-                else {\r\r
-                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        if(oSelf._bContainerOpen) {\r\r
-            oSelf._clearList();\r\r
-        }\r\r
-        oSelf._bFocused = false;\r\r
-        oSelf.textboxBlurEvent.fire(oSelf);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles form submission event.\r\r
- *\r\r
- * @param {event} v The submit event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {\r\r
-    if(oSelf.allowBrowserAutocomplete) {\r\r
-        oSelf._oTextbox.setAttribute("autocomplete","on");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._oTextbox.setAttribute("autocomplete","off");\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Makes query request to the data source.\r\r
- *\r\r
- * @param {string} sQuery Query string.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {\r\r
-    // Delimiter has been enabled\r\r
-    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r\r
-    if(aDelimChar) {\r\r
-        // Loop through all possible delimiters and find the latest one\r\r
-        // A " " may be a false positive if they are defined as delimiters AND\r\r
-        // are used to separate delimited queries\r\r
-        var nDelimIndex = -1;\r\r
-        for(var i = aDelimChar.length-1; i >= 0; i--) {\r\r
-            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);\r\r
-            if(nNewIndex > nDelimIndex) {\r\r
-                nDelimIndex = nNewIndex;\r\r
-            }\r\r
-        }\r\r
-        // If we think the last delimiter is a space (" "), make sure it is NOT\r\r
-        // a false positive by also checking the char directly before it\r\r
-        if(aDelimChar[i] == " ") {\r\r
-            for (var j = aDelimChar.length-1; j >= 0; j--) {\r\r
-                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {\r\r
-                    nDelimIndex--;\r\r
-                    break;\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-        // A delimiter has been found so extract the latest query\r\r
-        if (nDelimIndex > -1) {\r\r
-            var nQueryStart = nDelimIndex + 1;\r\r
-            // Trim any white space from the beginning...\r\r
-            while(sQuery.charAt(nQueryStart) == " ") {\r\r
-                nQueryStart += 1;\r\r
-            }\r\r
-            // ...and save the rest of the string for later\r\r
-            this._sSavedQuery = sQuery.substring(0,nQueryStart);\r\r
-            // Here is the query itself\r\r
-            sQuery = sQuery.substr(nQueryStart);\r\r
-        }\r\r
-        else if(sQuery.indexOf(this._sSavedQuery) < 0){\r\r
-            this._sSavedQuery = null;\r\r
-        }\r\r
-    }\r\r
-\r\r
-    // Don't search queries that are too short\r\r
-    if (sQuery.length < this.minQueryLength) {\r\r
-        if (this._nDelayID != -1) {\r\r
-            clearTimeout(this._nDelayID);\r\r
-        }\r\r
-        this._clearList();\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    sQuery = encodeURIComponent(sQuery);\r\r
-    this._nDelayID = -1;    // Reset timeout ID because request has been made\r\r
-    this.dataRequestEvent.fire(this, sQuery);\r\r
-    this.dataSource.getResults(this._populateList, sQuery, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Hides all visuals related to the array of &lt;li&gt; elements in the container.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._clearList = function() {\r\r
-    this._oContainer._oContent.scrollTop = 0;\r\r
-    var aItems = this._aListItems;\r\r
-\r\r
-    if(aItems && (aItems.length > 0)) {\r\r
-        for(var i = aItems.length-1; i >= 0 ; i--) {\r\r
-            aItems[i].style.display = "none";\r\r
-        }\r\r
-    }\r\r
-\r\r
-    if (this._oCurItem) {\r\r
-        this._toggleHighlight(this._oCurItem,"from");\r\r
-    }\r\r
-\r\r
-    this._oCurItem = null;\r\r
-    this._nDisplayedItems = 0;\r\r
-    this._sCurQuery = null;\r\r
-    this._toggleContainer(false);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Populates the array of &lt;li&gt; elements in the container with query\r\r
- * results. This method is passed to YAHOO.widget.DataSource#getResults as a\r\r
- * callback function so results from the datasource are returned to the\r\r
- * auto complete instance.\r\r
- *\r\r
- * @param {string} sQuery The query string\r\r
- * @param {object} aResults An array of query result objects from the data source\r\r
- * @param {string} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {\r\r
-    if(aResults === null) {\r\r
-        oSelf.dataErrorEvent.fire(oSelf, sQuery);\r\r
-    }\r\r
-    if (!oSelf._bFocused || !aResults) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);\r\r
-    var contentStyle = oSelf._oContainer._oContent.style;\r\r
-    contentStyle.width = (!isOpera) ? null : "";\r\r
-    contentStyle.height = (!isOpera) ? null : "";\r\r
-\r\r
-    var sCurQuery = decodeURIComponent(sQuery);\r\r
-    oSelf._sCurQuery = sCurQuery;\r\r
-    oSelf._bItemSelected = false;\r\r
-\r\r
-    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {\r\r
-        oSelf._initList();\r\r
-    }\r\r
-\r\r
-    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);\r\r
-    oSelf._nDisplayedItems = nItems;\r\r
-    if (nItems > 0) {\r\r
-        oSelf._initContainerHelpers();\r\r
-        var aItems = oSelf._aListItems;\r\r
-\r\r
-        // Fill items with data\r\r
-        for(var i = nItems-1; i >= 0; i--) {\r\r
-            var oItemi = aItems[i];\r\r
-            var oResultItemi = aResults[i];\r\r
-            oItemi.innerHTML = oSelf.formatResult(oResultItemi, sCurQuery);\r\r
-            oItemi.style.display = "list-item";\r\r
-            oItemi._sResultKey = oResultItemi[0];\r\r
-            oItemi._oResultData = oResultItemi;\r\r
-\r\r
-        }\r\r
-\r\r
-        // Empty out remaining items if any\r\r
-        for(var j = aItems.length-1; j >= nItems ; j--) {\r\r
-            var oItemj = aItems[j];\r\r
-            oItemj.innerHTML = null;\r\r
-            oItemj.style.display = "none";\r\r
-            oItemj._sResultKey = null;\r\r
-            oItemj._oResultData = null;\r\r
-        }\r\r
-\r\r
-        if(oSelf.autoHighlight) {\r\r
-            // Go to the first item\r\r
-            var oFirstItem = aItems[0];\r\r
-            oSelf._toggleHighlight(oFirstItem,"to");\r\r
-            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);\r\r
-            oSelf._typeAhead(oFirstItem,sQuery);\r\r
-        }\r\r
-        else {\r\r
-            oSelf._oCurItem = null;\r\r
-        }\r\r
-\r\r
-        // Expand the container\r\r
-        oSelf._toggleContainer(true);\r\r
-    }\r\r
-    else {\r\r
-        oSelf._clearList();\r\r
-    }\r\r
-    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);\r\r
-};\r\r
-\r\r
-/**\r\r
- * When YAHOO.widget.AutoComplete#bForceSelection is true and the user attempts\r\r
- * leave the text input box without selecting an item from the query results,\r\r
- * the user selection is cleared.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._clearSelection = function() {\r\r
-    var sValue = this._oTextbox.value;\r\r
-    var sChar = (this.delimChar) ? this.delimChar[0] : null;\r\r
-    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;\r\r
-    if(nIndex > -1) {\r\r
-        this._oTextbox.value = sValue.substring(0,nIndex);\r\r
-    }\r\r
-    else {\r\r
-         this._oTextbox.value = "";\r\r
-    }\r\r
-    this._sSavedQuery = this._oTextbox.value;\r\r
-\r\r
-    // Fire custom event\r\r
-    this.selectionEnforceEvent.fire(this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Whether or not user-typed value in the text input box matches any of the\r\r
- * query results.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {\r\r
-    var foundMatch = false;\r\r
-\r\r
-    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {\r\r
-        var oItem = this._aListItems[i];\r\r
-        var sMatch = oItem._sResultKey.toLowerCase();\r\r
-        if (sMatch == this._sCurQuery.toLowerCase()) {\r\r
-            foundMatch = true;\r\r
-            break;\r\r
-        }\r\r
-    }\r\r
-    return(foundMatch);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Updates in the text input box with the first query result as the user types,\r\r
- * selecting the substring that the user has not typed.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; element item whose data populates the input field\r\r
- * @param {string} sQuery Query string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r\r
-    // Don't update if turned off\r\r
-    if (!this.typeAhead) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var oTextbox = this._oTextbox;\r\r
-    var sValue = this._oTextbox.value; // any saved queries plus what user has typed\r\r
-\r\r
-    // Don't update with type-ahead if text selection is not supported\r\r
-    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    // Select the portion of text that the user has not typed\r\r
-    var nStart = sValue.length;\r\r
-    this._updateValue(oItem);\r\r
-    var nEnd = oTextbox.value.length;\r\r
-    this._selectText(oTextbox,nStart,nEnd);\r\r
-    var sPrefill = oTextbox.value.substr(nStart,nEnd);\r\r
-    this.typeAheadEvent.fire(this,sQuery,sPrefill);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Selects text in a text input box.\r\r
- *\r\r
- * @param {object} oTextbox Text input box element in which to select text\r\r
- * @param {number} nStart Starting index of text string to select\r\r
- * @param {number} nEnd Ending index of text selection\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {\r\r
-    if (oTextbox.setSelectionRange) { // For Mozilla\r\r
-        oTextbox.setSelectionRange(nStart,nEnd);\r\r
-    }\r\r
-    else if (oTextbox.createTextRange) { // For IE\r\r
-        var oTextRange = oTextbox.createTextRange();\r\r
-        oTextRange.moveStart("character", nStart);\r\r
-        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);\r\r
-        oTextRange.select();\r\r
-    }\r\r
-    else {\r\r
-        oTextbox.select();\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Syncs auto complete container with its helpers.\r\r
- *\r\r
- * @param {boolean} bShow True if container is expanded, false if collapsed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {\r\r
-    var bFireEvent = false;\r\r
-    var width = this._oContainer._oContent.offsetWidth + "px";\r\r
-    var height = this._oContainer._oContent.offsetHeight + "px";\r\r
-\r\r
-    if(this.useIFrame && this._oContainer._oIFrame) {\r\r
-        bFireEvent = true;\r\r
-        if(this.alwaysShowContainer || bShow) {\r\r
-            this._oContainer._oIFrame.style.width = width;\r\r
-            this._oContainer._oIFrame.style.height = height;\r\r
-        }\r\r
-        else {\r\r
-            this._oContainer._oIFrame.style.width = 0;\r\r
-            this._oContainer._oIFrame.style.height = 0;\r\r
-        }\r\r
-    }\r\r
-    if(this.useShadow && this._oContainer._oShadow) {\r\r
-        bFireEvent = true;\r\r
-        if(this.alwaysShowContainer || bShow) {\r\r
-            this._oContainer._oShadow.style.width = width;\r\r
-            this._oContainer._oShadow.style.height = height;\r\r
-        }\r\r
-        else {\r\r
-           this._oContainer._oShadow.style.width = 0;\r\r
-            this._oContainer._oShadow.style.height = 0;\r\r
-        }\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Animates expansion or collapse of the container.\r\r
- *\r\r
- * @param {boolean} bShow True if container should be expanded, false if\r\r
- *                        container should be collapsed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {\r\r
-    // Implementer has container always open so don't mess with it\r\r
-    if(this.alwaysShowContainer) {\r\r
-        // Fire these events to give implementers a hook into the container\r\r
-        // being populated and being emptied\r\r
-        if(bShow) {\r\r
-            this.containerExpandEvent.fire(this);\r\r
-        }\r\r
-        else {\r\r
-            this.containerCollapseEvent.fire(this);\r\r
-        }\r\r
-        this._bContainerOpen = bShow;\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var oContainer = this._oContainer;\r\r
-    // Container is already closed\r\r
-    if (!bShow && !this._bContainerOpen) {\r\r
-        oContainer._oContent.style.display = "none";\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    // If animation is enabled...\r\r
-    var oAnim = this._oAnim;\r\r
-    if (oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {\r\r
-        // If helpers need to be collapsed, do it right away...\r\r
-        // but if helpers need to be expanded, wait until after the container expands\r\r
-        if(!bShow) {\r\r
-            this._toggleContainerHelpers(bShow);\r\r
-        }\r\r
-\r\r
-        if(oAnim.isAnimated()) {\r\r
-            oAnim.stop();\r\r
-        }\r\r
-\r\r
-        // Clone container to grab current size offscreen\r\r
-        var oClone = oContainer._oContent.cloneNode(true);\r\r
-        oContainer.appendChild(oClone);\r\r
-        oClone.style.top = "-9000px";\r\r
-        oClone.style.display = "block";\r\r
-\r\r
-        // Current size of the container is the EXPANDED size\r\r
-        var wExp = oClone.offsetWidth;\r\r
-        var hExp = oClone.offsetHeight;\r\r
-\r\r
-        // Calculate COLLAPSED sizes based on horiz and vert anim\r\r
-        var wColl = (this.animHoriz) ? 0 : wExp;\r\r
-        var hColl = (this.animVert) ? 0 : hExp;\r\r
-\r\r
-        // Set animation sizes\r\r
-        oAnim.attributes = (bShow) ?\r\r
-            {width: { to: wExp }, height: { to: hExp }} :\r\r
-            {width: { to: wColl}, height: { to: hColl }};\r\r
-\r\r
-        // If opening anew, set to a collapsed size...\r\r
-        if(bShow && !this._bContainerOpen) {\r\r
-            oContainer._oContent.style.width = wColl+"px";\r\r
-            oContainer._oContent.style.height = hColl+"px";\r\r
-        }\r\r
-        // Else, set it to its last known size.\r\r
-        else {\r\r
-            oContainer._oContent.style.width = wExp+"px";\r\r
-            oContainer._oContent.style.height = hExp+"px";\r\r
-        }\r\r
-\r\r
-        oContainer.removeChild(oClone);\r\r
-        oClone = null;\r\r
-\r\r
-       var oSelf = this;\r\r
-       var onAnimComplete = function() {\r\r
-            // Finish the collapse\r\r
-               oAnim.onComplete.unsubscribeAll();\r\r
-\r\r
-            if(bShow) {\r\r
-                oSelf.containerExpandEvent.fire(oSelf);\r\r
-            }\r\r
-            else {\r\r
-                oContainer._oContent.style.display = "none";\r\r
-                oSelf.containerCollapseEvent.fire(oSelf);\r\r
-            }\r\r
-            oSelf._toggleContainerHelpers(bShow);\r\r
-       };\r\r
-\r\r
-        // Display container and animate it\r\r
-        oContainer._oContent.style.display = "block";\r\r
-        oAnim.onComplete.subscribe(onAnimComplete);\r\r
-        oAnim.animate();\r\r
-        this._bContainerOpen = bShow;\r\r
-    }\r\r
-    // Else don't animate, just show or hide\r\r
-    else {\r\r
-        if(bShow) {\r\r
-            oContainer._oContent.style.display = "block";\r\r
-            this.containerExpandEvent.fire(this);\r\r
-        }\r\r
-        else {\r\r
-            oContainer._oContent.style.display = "none";\r\r
-            this.containerCollapseEvent.fire(this);\r\r
-        }\r\r
-        this._toggleContainerHelpers(bShow);\r\r
-        this._bContainerOpen = bShow;\r\r
-   }\r\r
-\r\r
-};\r\r
-\r\r
-/**\r\r
- * Toggles the highlight on or off for an item in the container, and also cleans\r\r
- * up highlighting of any previous item.\r\r
- *\r\r
- * @param {object} oNewItem New The &lt;li&gt; element item to receive highlight\r\r
- *                              behavior\r\r
- * @param {string} sType "mouseover" will toggle highlight on, and "mouseout"\r\r
- *                       will toggle highlight off.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {\r\r
-    var sHighlight = this.highlightClassName;\r\r
-    if(this._oCurItem) {\r\r
-        // Remove highlight from old item\r\r
-        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);\r\r
-    }\r\r
-\r\r
-    if((sType == "to") && sHighlight) {\r\r
-        // Apply highlight to new item\r\r
-        YAHOO.util.Dom.addClass(oNewItem, sHighlight);\r\r
-        this._oCurItem = oNewItem;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Toggles the pre-highlight on or off for an item in the container.\r\r
- *\r\r
- * @param {object} oNewItem New The &lt;li&gt; element item to receive highlight\r\r
- *                              behavior\r\r
- * @param {string} sType "mouseover" will toggle highlight on, and "mouseout"\r\r
- *                       will toggle highlight off.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {\r\r
-    if(oNewItem == this._oCurItem) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var sPrehighlight = this.prehighlightClassName;\r\r
-    if((sType == "mouseover") && sPrehighlight) {\r\r
-        // Apply prehighlight to new item\r\r
-        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);\r\r
-    }\r\r
-    else {\r\r
-        // Remove prehighlight from old item\r\r
-        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Updates the text input box value with selected query result. If a delimiter\r\r
- * has been defined, then the value gets appended with the delimiter.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; element item with which to update the value\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {\r\r
-    var oTextbox = this._oTextbox;\r\r
-    var sDelimChar = (this.delimChar) ? this.delimChar[0] : null;\r\r
-    var sSavedQuery = this._sSavedQuery;\r\r
-    var sResultKey = oItem._sResultKey;\r\r
-    oTextbox.focus();\r\r
-\r\r
-    // First clear text field\r\r
-    oTextbox.value = "";\r\r
-    // Grab data to put into text field\r\r
-    if(sDelimChar) {\r\r
-        if(sSavedQuery) {\r\r
-            oTextbox.value = sSavedQuery;\r\r
-        }\r\r
-        oTextbox.value += sResultKey + sDelimChar;\r\r
-        if(sDelimChar != " ") {\r\r
-            oTextbox.value += " ";\r\r
-        }\r\r
-    }\r\r
-    else { oTextbox.value = sResultKey; }\r\r
-\r\r
-    // scroll to bottom of textarea if necessary\r\r
-    if(oTextbox.type == "textarea") {\r\r
-        oTextbox.scrollTop = oTextbox.scrollHeight;\r\r
-    }\r\r
-\r\r
-    // move cursor to end\r\r
-    var end = oTextbox.value.length;\r\r
-    this._selectText(oTextbox,end,end);\r\r
-\r\r
-    this._oCurItem = oItem;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Selects a result item from the container\r\r
- *\r\r
- * @param {object} oItem The selected &lt;li&gt; element item\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._selectItem = function(oItem) {\r\r
-    this._bItemSelected = true;\r\r
-    this._updateValue(oItem);\r\r
-    this.itemSelectEvent.fire(this, oItem, oItem._oResultData);\r\r
-    this._clearList();\r\r
-};\r\r
-\r\r
-/**\r\r
- * For values updated by type-ahead, the right arrow key jumps to the end\r\r
- * of the textbox, otherwise the container is closed.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {\r\r
-    if(!this.typeAhead) {\r\r
-        return;\r\r
-    }\r\r
-    else {\r\r
-        this._clearList();\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Triggered by up and down arrow keys, changes the current highlighted\r\r
- * &lt;li&gt; element item. Scrolls container if necessary.\r\r
- *\r\r
- * @param {number} nKeyCode Code of key pressed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {\r\r
-    if(this._bContainerOpen) {\r\r
-        // Determine current item's id number\r\r
-        var oCurItem = this._oCurItem;\r\r
-        var nCurItemIndex = -1;\r\r
-\r\r
-        if (oCurItem) {\r\r
-            nCurItemIndex = oCurItem._nItemIndex;\r\r
-        }\r\r
-\r\r
-        var nNewItemIndex = (nKeyCode == 40) ?\r\r
-                (nCurItemIndex + 1) : (nCurItemIndex - 1);\r\r
-\r\r
-        // Out of bounds\r\r
-        if (nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        if (oCurItem) {\r\r
-            // Unhighlight current item\r\r
-            this._toggleHighlight(oCurItem, "from");\r\r
-            this.itemArrowFromEvent.fire(this, oCurItem);\r\r
-        }\r\r
-        if (nNewItemIndex == -1) {\r\r
-           // Go back to query (remove type-ahead string)\r\r
-            if(this.delimChar && this._sSavedQuery) {\r\r
-                if (!this._textMatchesOption()) {\r\r
-                    this._oTextbox.value = this._sSavedQuery;\r\r
-                }\r\r
-                else {\r\r
-                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;\r\r
-                }\r\r
-            }\r\r
-            else {\r\r
-                this._oTextbox.value = this._sCurQuery;\r\r
-            }\r\r
-            this._oCurItem = null;\r\r
-            return;\r\r
-        }\r\r
-        if (nNewItemIndex == -2) {\r\r
-            // Close container\r\r
-            this._clearList();\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        var oNewItem = this._aListItems[nNewItemIndex];\r\r
-\r\r
-        // Scroll the container if necessary\r\r
-        if((YAHOO.util.Dom.getStyle(this._oContainer._oContent,"overflow") == "auto") &&\r\r
-        (nNewItemIndex > -1) && (nNewItemIndex < this._nDisplayedItems)) {\r\r
-            // User is keying down\r\r
-            if(nKeyCode == 40) {\r\r
-                // Bottom of selected item is below scroll area...\r\r
-                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (this._oContainer._oContent.scrollTop + this._oContainer._oContent.offsetHeight)) {\r\r
-                    // Set bottom of scroll area to bottom of selected item\r\r
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - this._oContainer._oContent.offsetHeight;\r\r
-                }\r\r
-                // Bottom of selected item is above scroll area...\r\r
-                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < this._oContainer._oContent.scrollTop) {\r\r
-                    // Set top of selected item to top of scroll area\r\r
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r\r
-\r\r
-                }\r\r
-            }\r\r
-            // User is keying up\r\r
-            else {\r\r
-                // Top of selected item is above scroll area\r\r
-                if(oNewItem.offsetTop < this._oContainer._oContent.scrollTop) {\r\r
-                    // Set top of scroll area to top of selected item\r\r
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r\r
-                }\r\r
-                // Top of selected item is below scroll area\r\r
-                else if(oNewItem.offsetTop > (this._oContainer._oContent.scrollTop + this._oContainer._oContent.offsetHeight)) {\r\r
-                    // Set bottom of selected item to bottom of scroll area\r\r
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - this._oContainer._oContent.offsetHeight;\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        this._toggleHighlight(oNewItem, "to");\r\r
-        this.itemArrowToEvent.fire(this, oNewItem);\r\r
-        if(this.typeAhead) {\r\r
-            this._updateValue(oNewItem);\r\r
-        }\r\r
-    }\r\r
-};\r\r
-\r\r
-/****************************************************************************/\r\r
-/****************************************************************************/\r\r
-/****************************************************************************/\r\r
-\r\r
-/**\r\r
- * Class providing encapsulation of a data source. \r\r
+ * The DataSource classes manages sending a request and returning response from a live\r\r
+ * database. Supported data include local JavaScript arrays and objects and databases\r\r
+ * accessible via XHR connections. Supported response formats include JavaScript arrays,\r\r
+ * JSON, XML, and flat-file textual data.\r\r
  *  \r\r
+ * @class DataSource\r\r
  * @constructor\r\r
- *\r\r
  */\r\r
 YAHOO.widget.DataSource = function() { \r\r
     /* abstract class */\r\r
 };\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public constants\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public constants\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Error message for null data responses.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATANULL\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype.ERROR_DATANULL = "Response data was null";\r\r
+YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";\r\r
 \r\r
 /**\r\r
  * Error message for data responses with parsing errors.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATAPARSE\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype.ERROR_DATAPARSE = "Response data could not be parsed";\r\r
+YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Max size of the local cache.  Set to 0 to turn off caching.  Caching is\r\r
  * useful to reduce the number of server connections.  Recommended only for data\r\r
  * sources that return comprehensive results for queries or when stale data is\r\r
- * not an issue. Default: 15.\r\r
+ * not an issue.\r\r
  *\r\r
- * @type number\r\r
+ * @property maxCacheEntries\r\r
+ * @type Number\r\r
+ * @default 15\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;\r\r
 \r\r
@@ -1861,50 +2081,52 @@ YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;
  * data source. If caching is on and queryMatchContains is true, the cache\r\r
  * returns results that "contain" the query string. By default,\r\r
  * queryMatchContains is set to false, meaning the cache only returns results\r\r
- * that "start with" the query string. Default: false.\r\r
+ * that "start with" the query string.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property queryMatchContains\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchContains = false;\r\r
 \r\r
 /**\r\r
- * Data source query subset matching. If caching is on and queryMatchSubset is\r\r
+ * Enables query subset matching. If caching is on and queryMatchSubset is\r\r
  * true, substrings of queries will return matching cached results. For\r\r
  * instance, if the first query is for "abc" susequent queries that start with\r\r
  * "abc", like "abcd", will be queried against the cache, and not the live data\r\r
- * source. Recommended only for data sources that return comprehensive results\r\r
- * for queries with very few characters. Default: false.\r\r
+ * source. Recommended only for DataSources that return comprehensive results\r\r
+ * for queries with very few characters.\r\r
+ *\r\r
+ * @property queryMatchSubset\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  *\r\r
- * @type boolean\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchSubset = false;\r\r
 \r\r
 /**\r\r
- * Data source query case-sensitivity matching. If caching is on and\r\r
+ * Enables query case-sensitivity matching. If caching is on and\r\r
  * queryMatchCase is true, queries will only return results for case-sensitive\r\r
- * matches. Default: false.\r\r
+ * matches.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property queryMatchCase\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchCase = false;\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
- /**\r\r
- * Public accessor to the unique name of the data source instance.\r\r
- *\r\r
- * @return {string} Unique name of the data source instance\r\r
- */\r\r
-YAHOO.widget.DataSource.prototype.getName = function() {\r\r
-    return this._sName;\r\r
-};\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
  /**\r\r
- * Public accessor to the unique name of the data source instance.\r\r
+ * Public accessor to the unique name of the DataSource instance.\r\r
  *\r\r
- * @return {string} Unique name of the data source instance\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the DataSource instance\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.toString = function() {\r\r
     return "DataSource " + this._sName;\r\r
@@ -1914,10 +2136,10 @@ YAHOO.widget.DataSource.prototype.toString = function() {
  * Retrieves query results, first checking the local cache, then making the\r\r
  * query request to the live data source as defined by the function doQuery.\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to\r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method getResults\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r\r
     \r\r
@@ -1936,10 +2158,10 @@ YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oPa
  * source. Must call the callback function with the response returned from the\r\r
  * query. Populates cache (if enabled).\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function implemented by oParent to\r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
     /* override this */ \r\r
@@ -1947,6 +2169,8 @@ YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParen
 \r\r
 /**\r\r
  * Flushes cache.\r\r
+ *\r\r
+ * @method flushCache\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.flushCache = function() {\r\r
     if(this._aCache) {\r\r
@@ -1958,79 +2182,94 @@ YAHOO.widget.DataSource.prototype.flushCache = function() {
     this.cacheFlushEvent.fire(this);\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public events\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Fired when a query is made to the live data source. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
+ * Fired when a query is made to the live data source.\r\r
+ *\r\r
+ * @event queryEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when a query is made to the local cache. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
+ * Fired when a query is made to the local cache.\r\r
+ *\r\r
+ * @event cacheQueryEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when data is retrieved from the live data source. Subscribers receive\r\r
- * the following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Array of result objects\r\r
+ * Fired when data is retrieved from the live data source.\r\r
+ *\r\r
+ * @event getResultsEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param aResults {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r\r
     \r\r
 /**\r\r
- * Fired when data is retrieved from the local cache. Subscribers receive the\r\r
- * following array :<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Array of result objects\r\r
+ * Fired when data is retrieved from the local cache.\r\r
+ *\r\r
+ * @event getCachedResultsEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param aResults {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when an error is encountered with the live data source. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Error message string\r\r
+ * Fired when an error is encountered with the live data source.\r\r
+ *\r\r
+ * @event dataErrorEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param sMsg {String} Error message string\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.dataErrorEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when the local cache is flushed. Subscribers receive the following\r\r
- * array :<br>\r\r
- *     - args[0] The data source instance\r\r
+ * Fired when the local cache is flushed.\r\r
+ *\r\r
+ * @event cacheFlushEvent\r\r
+ * @param oSelf {Object} The DataSource instance\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;\r\r
 \r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Internal class variable to index multiple data source instances.\r\r
+ * Internal class variable to index multiple DataSource instances.\r\r
  *\r\r
- * @type number\r\r
+ * @property _nIndex\r\r
+ * @type Number\r\r
  * @private\r\r
+ * @static\r\r
  */\r\r
 YAHOO.widget.DataSource._nIndex = 0;\r\r
 \r\r
 /**\r\r
- * Name of data source instance.\r\r
+ * Name of DataSource instance.\r\r
  *\r\r
- * @type string\r\r
+ * @property _sName\r\r
+ * @type String\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._sName = null;\r\r
@@ -2038,18 +2277,23 @@ YAHOO.widget.DataSource.prototype._sName = null;
 /**\r\r
  * Local cache of data result objects indexed chronologically.\r\r
  *\r\r
- * @type array\r\r
+ * @property _aCache\r\r
+ * @type Object[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._aCache = null;\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Initializes data source instance.\r\r
+ * Initializes DataSource instance.\r\r
  *  \r\r
+ * @method _init\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._init = function() {\r\r
@@ -2079,14 +2323,14 @@ YAHOO.widget.DataSource.prototype._init = function() {
  * cache is full. Newer items will have higher indexes, the oldest item will have\r\r
  * index of 0. \r\r
  *\r\r
- * @param {object} resultObj  Object literal of data results, including internal\r\r
- *                            properties and an array of result objects\r\r
+ * @method _addCacheElem\r\r
+ * @param oResult {Object} Data result object, including array of results.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {\r\r
+YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {\r\r
     var aCache = this._aCache;\r\r
     // Don't add if anything important is missing.\r\r
-    if(!aCache || !resultObj || !resultObj.query || !resultObj.results) {\r\r
+    if(!aCache || !oResult || !oResult.query || !oResult.results) {\r\r
         return;\r\r
     }\r\r
     \r\r
@@ -2096,7 +2340,7 @@ YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {
     }\r\r
         \r\r
     // Add to cache, at the end of the array\r\r
-    aCache.push(resultObj);\r\r
+    aCache.push(oResult);\r\r
 };\r\r
 \r\r
 /**\r\r
@@ -2104,12 +2348,11 @@ YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {
  * function is called with the results, and the cached is refreshed so that it\r\r
  * is now the newest element.  \r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
- * @return {array} aResults Result object from local cache if found, otherwise \r\r
- *                          null\r\r
+ * @method _doQueryCache\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
+ * @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r\r
  * @private \r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r\r
@@ -2134,7 +2377,7 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
             var aAllResultItems = resultObj.results;\r\r
             // If case is unimportant, normalize match key for comparison\r\r
             var matchKey = (!this.queryMatchCase) ?\r\r
-                encodeURIComponent(resultObj.query.toLowerCase()):\r\r
+                encodeURIComponent(resultObj.query).toLowerCase():\r\r
                 encodeURIComponent(resultObj.query);\r\r
             \r\r
             // If a cached match key exactly matches the query...\r\r
@@ -2211,14 +2454,15 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
 /**\r\r
  * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r\r
  * query results.\r\r
- * requires YAHOO.util.Connect XMLHTTPRequest library\r\r
- * extends YAHOO.widget.DataSource\r\r
  *  \r\r
+ * @class DS_XHR\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @requires connection\r\r
  * @constructor\r\r
- * @param {string} sScriptURI Absolute or relative URI to script that returns \r\r
- *                            query results as JSON, XML, or delimited flat data\r\r
- * @param {array} aSchema Data schema definition of results\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @param sScriptURI {String} Absolute or relative URI to script that returns query\r\r
+ * results as JSON, XML, or delimited flat-file data.\r\r
+ * @param aSchema {String[]} Data schema definition of results.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2243,71 +2487,95 @@ YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {
 \r\r
 YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public constants\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public constants\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * JSON data type\r\r
+ * JSON data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_JSON\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_JSON = 0;\r\r
+YAHOO.widget.DS_XHR.TYPE_JSON = 0;\r\r
 \r\r
 /**\r\r
- * XML data type\r\r
+ * XML data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_XML\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_XML = 1;\r\r
+YAHOO.widget.DS_XHR.TYPE_XML = 1;\r\r
 \r\r
 /**\r\r
- * Flat file data type\r\r
+ * Flat-file data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_FLAT\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_FLAT = 2;\r\r
+YAHOO.widget.DS_XHR.TYPE_FLAT = 2;\r\r
 \r\r
 /**\r\r
  * Error message for XHR failure.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATAXHR\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR = "XHR response failed";\r\r
+YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Alias to YUI Connection Manager. Allows implementers to specify their own\r\r
+ * subclasses of the YUI Connection Manager utility.\r\r
+ *\r\r
+ * @property connMgr\r\r
+ * @type Object\r\r
+ * @default YAHOO.util.Connect\r\r
+ */\r\r
+YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Number of milliseconds the XHR connection will wait for a server response. A\r\r
  * a value of zero indicates the XHR connection will wait forever. Any value\r\r
  * greater than zero will use the Connection utility's Auto-Abort feature.\r\r
- * Default: 0.\r\r
  *\r\r
- * @type number\r\r
+ * @property connTimeout\r\r
+ * @type Number\r\r
+ * @default 0\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.connTimeout = 0;\r\r
 \r\r
-\r\r
 /**\r\r
  * Absolute or relative URI to script that returns query results. For instance,\r\r
- * queries will be sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput\r\r
+ * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptURI\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptURI = null;\r\r
 \r\r
 /**\r\r
  * Query string parameter name sent to scriptURI. For instance, queries will be\r\r
- * sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput\r\r
- * Default: "query".\r\r
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptQueryParam\r\r
+ * @type String\r\r
+ * @default "query"\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";\r\r
 \r\r
@@ -2315,53 +2583,61 @@ YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";
  * String of key/value pairs to append to requests made to scriptURI. Define\r\r
  * this string when you want to send additional query parameters to your script.\r\r
  * When defined, queries will be sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput&<scriptQueryAppend>\r\r
- * Default: "".\r\r
+ * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptQueryAppend\r\r
+ * @type String\r\r
+ * @default ""\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";\r\r
 \r\r
 /**\r\r
- * XHR response data type. Other types that may be defined are TYPE_XML and\r\r
- * TYPE_FLAT. Default: TYPE_JSON.\r\r
+ * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML\r\r
+ * and YAHOO.widget.DS_XHR.TYPE_FLAT.\r\r
  *\r\r
- * @type type\r\r
+ * @property responseType\r\r
+ * @type String\r\r
+ * @default YAHOO.widget.DS_XHR.TYPE_JSON\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.prototype.TYPE_JSON;\r\r
+YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;\r\r
 \r\r
 /**\r\r
  * String after which to strip results. If the results from the XHR are sent\r\r
  * back as HTML, the gzip HTML comment appears at the end of the data and should\r\r
- * be ignored.  Default: "\n&lt;!--"\r\r
+ * be ignored.\r\r
  *\r\r
- * @type string\r\r
+ * @property responseStripAfter\r\r
+ * @type String\r\r
+ * @default "\n&#60;!-"\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!--";\r\r
+YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Queries the live data source defined by scriptURI for results. Results are\r\r
  * passed back to a callback function.\r\r
  *  \r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
-    var isXML = (this.responseType == this.TYPE_XML);\r\r
+    var isXML = (this.responseType == YAHOO.widget.DS_XHR.TYPE_XML);\r\r
     var sUri = this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;\r\r
     if(this.scriptQueryAppend.length > 0) {\r\r
         sUri += "&" + this.scriptQueryAppend;\r\r
     }\r\r
-    YAHOO.log("Data source is querying URL " + sUri, "info", this.toString());\r\r
+    YAHOO.log("DataSource is querying URL " + sUri, "info", this.toString());\r\r
     var oResponse = null;\r\r
     \r\r
     var oSelf = this;\r\r
-    /**\r\r
+    /*\r\r
      * Sets up ajax request callback\r\r
      *\r\r
      * @param {object} oReq          HTTPXMLRequest object\r\r
@@ -2370,8 +2646,8 @@ YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
     var responseSuccess = function(oResp) {\r\r
         // Response ID does not match last made request ID.\r\r
         if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATANULL);\r\r
-            YAHOO.log(oSelf.ERROR_DATANULL, "error", this.toString());\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());\r\r
             return;\r\r
         }\r\r
 //DEBUG\r\r
@@ -2387,8 +2663,8 @@ YAHOO.log('responseXML.xml: '+oResp.responseXML.xml,'warn');*/
             oResp = oResp.responseXML;\r\r
         }\r\r
         if(oResp === null) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATANULL);\r\r
-            YAHOO.log(oSelf.ERROR_DATANULL, "error", oSelf.toString());\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", oSelf.toString());\r\r
             return;\r\r
         }\r\r
 \r\r
@@ -2397,20 +2673,20 @@ YAHOO.log('responseXML.xml: '+oResp.responseXML.xml,'warn');*/
         resultObj.query = decodeURIComponent(sQuery);\r\r
         resultObj.results = aResults;\r\r
         if(aResults === null) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATAPARSE);\r\r
-            YAHOO.log(oSelf.ERROR_DATAPARSE, "error", oSelf.toString());\r\r
-            return;\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);\r\r
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATAPARSE, "error", oSelf.toString());\r\r
+            aResults = [];\r\r
         }\r\r
         else {\r\r
             oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);\r\r
             oSelf._addCacheElem(resultObj);\r\r
-            oCallbackFn(sQuery, aResults, oParent);\r\r
         }\r\r
+        oCallbackFn(sQuery, aResults, oParent);\r\r
     };\r\r
 \r\r
     var responseFailure = function(oResp) {\r\r
-        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATAXHR);\r\r
-        YAHOO.log(oSelf.ERROR_DATAXHR + ": " + oResp.statusText, "error", oSelf.toString());\r\r
+        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);\r\r
+        YAHOO.log(YAHOO.widget.DS_XHR.ERROR_DATAXHR + ": " + oResp.statusText, "error", oSelf.toString());\r\r
         return;\r\r
     };\r\r
     \r\r
@@ -2424,20 +2700,21 @@ YAHOO.log('responseXML.xml: '+oResp.responseXML.xml,'warn');*/
     }\r\r
     \r\r
     if(this._oConn) {\r\r
-        YAHOO.util.Connect.abort(this._oConn);\r\r
+        this.connMgr.abort(this._oConn);\r\r
     }\r\r
     \r\r
-    oSelf._oConn = YAHOO.util.Connect.asyncRequest("GET", sUri, oCallback, null);\r\r
+    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r\r
 };\r\r
 \r\r
 /**\r\r
  * Parses raw response data into an array of result objects. The result data key\r\r
  * is always stashed in the [0] element of each result object. \r\r
  *\r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oResponse The raw response data to parse\r\r
- * @param {object} oParent The object instance that has requested data\r\r
- * @returns {array} Array of result objects\r\r
+ * @method parseResponse\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oResponse {Object} The raw response data to parse.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
+ * @returns {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {\r\r
     var aSchema = this.schema;\r\r
@@ -2452,7 +2729,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     }\r\r
 \r\r
     switch (this.responseType) {\r\r
-        case this.TYPE_JSON:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_JSON:\r\r
             var jsonList;\r\r
             // Divert KHTML clients from JSON lib\r\r
             if(window.JSON && (navigator.userAgent.toLowerCase().indexOf('khtml')== -1)) {\r\r
@@ -2463,8 +2740,14 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                     break;\r\r
                 }\r\r
                 else {\r\r
-                    // eval is necessary here since aSchema[0] is of unknown depth\r\r
-                    jsonList = eval("jsonObjParsed." + aSchema[0]);\r\r
+                    try {\r\r
+                        // eval is necessary here since aSchema[0] is of unknown depth\r\r
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);\r\r
+                    }\r\r
+                    catch(e) {\r\r
+                        bError = true;\r\r
+                        break;\r\r
+                   }\r\r
                 }\r\r
             }\r\r
             else {\r\r
@@ -2509,6 +2792,10 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                 break;\r\r
             }\r\r
 \r\r
+            if(jsonList.constructor != Array) {\r\r
+                jsonList = [jsonList];\r\r
+            }\r\r
+            \r\r
             // Loop through the array of all responses...\r\r
             for(var i = jsonList.length-1; i >= 0 ; i--) {\r\r
                 var aResultItem = [];\r\r
@@ -2523,11 +2810,15 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                     //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());\r\r
                     aResultItem.unshift(dataFieldValue);\r\r
                 }\r\r
+                // If schema isn't well defined, pass along the entire result object\r\r
+                if(aResultItem.length == 1) {\r\r
+                    aResultItem.push(jsonResult);\r\r
+                }\r\r
                 // Capture the array of data field values in an array of results\r\r
                 aResults.unshift(aResultItem);\r\r
             }\r\r
             break;\r\r
-        case this.TYPE_XML:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_XML:\r\r
             // Get the collection of results\r\r
             var xmlList = oResponse.getElementsByTagName(aSchema[0]);\r\r
             if(!xmlList) {\r\r
@@ -2568,7 +2859,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                 aResults.unshift(aFieldSet);\r\r
             }\r\r
             break;\r\r
-        case this.TYPE_FLAT:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_FLAT:\r\r
             if(oResponse.length > 0) {\r\r
                 // Delete the last line delimiter at the end of the data if it exists\r\r
                 var newLength = oResponse.length-aSchema[0].length;\r\r
@@ -2595,14 +2886,17 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     }\r\r
 };            \r\r
 \r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * XHR connection object.\r\r
  *\r\r
- * @type object\r\r
+ * @property _oConn\r\r
+ * @type Object\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype._oConn = null;\r\r
@@ -2613,15 +2907,14 @@ YAHOO.widget.DS_XHR.prototype._oConn = null;
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript struct as\r\r
+ * Implementation of YAHOO.widget.DataSource using a native Javascript function as\r\r
  * its live data source.\r\r
  *  \r\r
+ * @class DS_JSFunction\r\r
  * @constructor\r\r
- * extends YAHOO.widget.DataSource \r\r
- *  \r\r
- * @param {string} oFunction In-memory Javascript function that returns query\r\r
- *                           results as an array of objects\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @param oFunction {String} In-memory Javascript function that returns query results as an array of objects.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2645,28 +2938,34 @@ YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {
 \r\r
 YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * In-memory Javascript function that returns query results.\r\r
  *\r\r
- * @type function\r\r
+ * @property dataFunction\r\r
+ * @type HTMLFunction\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;\r\r
 \r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Queries the live data source defined by function for results. Results are\r\r
  * passed back to a callback function.\r\r
  *  \r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
     var oFunction = this.dataFunction;\r\r
@@ -2674,8 +2973,8 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
     \r\r
     aResults = oFunction(sQuery);\r\r
     if(aResults === null) {\r\r
-        this.dataErrorEvent.fire(this, oParent, sQuery, this.ERROR_DATANULL);\r\r
-        YAHOO.log(oSelf.ERROR_DATANULL, "error", this.toString());\r\r
+        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
+        YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());\r\r
         return;\r\r
     }\r\r
     \r\r
@@ -2697,11 +2996,11 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
  * Implementation of YAHOO.widget.DataSource using a native Javascript array as\r\r
  * its live data source.\r\r
  *\r\r
+ * @class DS_JSArray\r\r
  * @constructor\r\r
- * extends YAHOO.widget.DataSource\r\r
- *\r\r
- * @param {string} aData In-memory Javascript array of simple string data\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @param aData {String[]} In-memory Javascript array of simple string data.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_JSArray = function(aData, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2725,57 +3024,72 @@ YAHOO.widget.DS_JSArray = function(aData, oConfigs) {
 \r\r
 YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * In-memory Javascript array of strings.\r\r
  *\r\r
- * @type array\r\r
+ * @property data\r\r
+ * @type Array\r\r
  */\r\r
 YAHOO.widget.DS_JSArray.prototype.data = null;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Queries the live data source defined by data for results. Results are passed\r\r
  * back to a callback function.\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to\r\r
- *                             which to return results\r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
-    var aData = this.data;\r\r
-    var aResults = [];\r\r
+    var aData = this.data; // the array\r\r
+    var aResults = []; // container for results\r\r
     var bMatchFound = false;\r\r
     var bMatchContains = this.queryMatchContains;\r\r
-    if(!this.queryMatchCase) {\r\r
-        sQuery = sQuery.toLowerCase();\r\r
-    }\r\r
-\r\r
-    // Loop through each element of the array...\r\r
-    for(var i = aData.length-1; i >= 0; i--) {\r\r
-        var aDataset = [];\r\r
-        if(typeof aData[i] == "string") {\r\r
-            aDataset[0] = aData[i];\r\r
-        }\r\r
-        else {\r\r
-            aDataset = aData[i];\r\r
+    if(sQuery) {\r\r
+        if(!this.queryMatchCase) {\r\r
+            sQuery = sQuery.toLowerCase();\r\r
         }\r\r
 \r\r
-        var sKeyIndex = (this.queryMatchCase) ?\r\r
-            encodeURIComponent(aDataset[0]).indexOf(sQuery):\r\r
-            encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r\r
+        // Loop through each element of the array...\r\r
+        // which can be a string or an array of strings\r\r
+        for(var i = aData.length-1; i >= 0; i--) {\r\r
+            var aDataset = [];\r\r
+\r\r
+            if(aData[i]) {\r\r
+                if(aData[i].constructor == String) {\r\r
+                    aDataset[0] = aData[i];\r\r
+                }\r\r
+                else if(aData[i].constructor == Array) {\r\r
+                    aDataset = aData[i];\r\r
+                }\r\r
+            }\r\r
 \r\r
-        // A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
-        if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
-        // A CONTAINS match is when the query is found anywhere within the key string...\r\r
-        (bMatchContains && (sKeyIndex > -1))) {\r\r
-            // Stash a match into aResults[].\r\r
-            aResults.unshift(aDataset);\r\r
+            if(aDataset[0] && (aDataset[0].constructor == String)) {\r\r
+                var sKeyIndex = (this.queryMatchCase) ?\r\r
+                encodeURIComponent(aDataset[0]).indexOf(sQuery):\r\r
+                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r\r
+\r\r
+                // A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
+                if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
+                // A CONTAINS match is when the query is found anywhere within the key string...\r\r
+                (bMatchContains && (sKeyIndex > -1))) {\r\r
+                    // Stash a match into aResults[].\r\r
+                    aResults.unshift(aDataset);\r\r
+                }\r\r
+            }\r\r
         }\r\r
     }\r\r
 \r\r
index 2ded0d9effb7253adcac4f30f249db33d541dd7f..05c9d8b99078f4de19fa8b66b8482546d0d3eed0 100755 (executable)
@@ -1,31 +1,23 @@
-/*\r\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
-Code licensed under the BSD License:\r\r
-http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.11.0\r\r
-*/\r\r
-\r\r
-\r\r
-YAHOO.widget.AutoComplete=function(inputEl,containerEl,oDataSource,oConfigs){if(inputEl&&containerEl&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}\r\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r\r
+YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}\r\r
 else{return;}\r\r
-if(YAHOO.util.Dom.inDocument(inputEl)){if(typeof inputEl=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl;this._oTextbox=document.getElementById(inputEl);}\r\r
-else{this._sName=(inputEl.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=inputEl;}}\r\r
+if(YAHOO.util.Dom.inDocument(elInput)){if(typeof elInput=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}\r\r
+else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}}\r\r
 else{return;}\r\r
-if(YAHOO.util.Dom.inDocument(containerEl)){if(typeof containerEl=="string"){this._oContainer=document.getElementById(containerEl);}\r\r
-else{this._oContainer=containerEl;}\r\r
+if(YAHOO.util.Dom.inDocument(elContainer)){if(typeof elContainer=="string"){this._oContainer=document.getElementById(elContainer);}\r\r
+else{this._oContainer=elContainer;}\r\r
 if(this._oContainer.style.display=="none"){}}\r\r
 else{return;}\r\r
 if(typeof oConfigs=="object"){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}\r\r
-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,"keypress",oSelf._onTextboxKeyPress,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);}\r\r
-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++;}\r\r
-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.5;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.iFrameSrc="about:blank";YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.getName=function(){return this._sName;};YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}\r\r
+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);}\r\r
+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++;}\r\r
+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.5;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;}\r\r
 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";}}\r\r
 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";}}\r\r
 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";}}\r\r
 else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}\r\r
 this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}\r\r
-else{return"";}};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){if(sQuery){this._sendQuery(sQuery);}\r\r
-else{return;}};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._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}\r\r
+else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oResultItem,sQuery){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};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(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}\r\r
 var maxResultsDisplayed=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}\r\r
 var queryDelay=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5;}\r\r
 var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){if(typeof aDelimChar=="string"){this.delimChar=[aDelimChar];}\r\r
@@ -33,51 +25,29 @@ else if(aDelimChar.constructor!=Array){this.delimChar=null;}}
 var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(animSpeed)||(animSpeed<0)){animSpeed=0.3;}\r\r
 if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim;}\r\r
 else{this._oAnim.duration=animSpeed;}}\r\r
-if(this.forceSelection&&this.delimChar){}\r\r
-if(this.alwaysShowContainer&&(this.useShadow||this.useIFrame)){}\r\r
-if(this.alwaysShowContainer){this._bContainerOpen=true;}};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);}\r\r
-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%";this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){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);}\r\r
+if(this.forceSelection&&this.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);}\r\r
+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(){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);}\r\r
 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;i--){oldListItems[oldi]=null;}}\r\r
 this._oContainer._oContent._oBody.innerHTML="";}\r\r
 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);}\r\r
-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._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}\r\r
-else{oSelf._toggleHighlight(this,"to");}\r\r
-oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}\r\r
-else{oSelf._toggleHighlight(this,"from");}\r\r
-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.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
-if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r\r
-else{oSelf._clearList();}\r\r
-break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
-if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r\r
-else{oSelf._clearList();}\r\r
-break;case 27:oSelf._clearList();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;switch(nKeyCode){case 9:case 13:if((oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}\r\r
-break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sChar=String.fromCharCode(nKeyCode);var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}\r\r
-else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}\r\r
-if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}\r\r
-oSelf._nDelayID=nDelayID;}\r\r
-else{oSelf._sendQuery(sText);}};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<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}\r\r
-return false;};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}\r\r
-else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}\r\r
-if(oSelf._bContainerOpen){oSelf._clearList();}\r\r
-oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}\r\r
-else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){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;}}\r\r
+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<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}\r\r
+return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}\r\r
+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;}}\r\r
 if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}\r\r
 if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}\r\r
 this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}\r\r
 else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}\r\r
-if(sQuery.length<this.minQueryLength){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}\r\r
-this._clearList();return;}\r\r
-sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._clearList=function(){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";}}\r\r
-if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}\r\r
-this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}\r\r
+if(sQuery&&(sQuery.length<this.minQueryLength)||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}\r\r
+this._toggleContainer(false);return;}\r\r
+sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;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);}\r\r
 if(!oSelf._bFocused||!aResults){return;}\r\r
 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();}\r\r
 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;}\r\r
 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;}\r\r
 if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}\r\r
 else{oSelf._oCurItem=null;}\r\r
-oSelf._toggleContainer(true);}\r\r
-else{oSelf._clearList();}\r\r
+var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);}\r\r
+else{oSelf._toggleContainer(false);}\r\r
 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);}\r\r
 else{this._oTextbox.value="";}\r\r
 this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=false;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=true;break;}}\r\r
@@ -85,13 +55,14 @@ return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oIt
 var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}\r\r
 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);}\r\r
 else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}\r\r
-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(this.alwaysShowContainer||bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}\r\r
+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;}\r\r
 else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}\r\r
-if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}\r\r
-else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){if(this.alwaysShowContainer){if(bShow){this.containerExpandEvent.fire(this);}\r\r
-else{this.containerCollapseEvent.fire(this);}\r\r
-this._bContainerOpen=bShow;return;}\r\r
-var oContainer=this._oContainer;if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}\r\r
+if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}\r\r
+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;}\r\r
+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";}}\r\r
+if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}\r\r
+this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}\r\r
+if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}\r\r
 var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}\r\r
 if(oAnim.isAnimated()){oAnim.stop();}\r\r
 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";}\r\r
@@ -104,31 +75,52 @@ else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(
 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);}\r\r
 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;}\r\r
 var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}\r\r
-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]:null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}\r\r
+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;}\r\r
 oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}\r\r
 else{oTextbox.value=sResultKey;}\r\r
 if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}\r\r
-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.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._clearList();};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}\r\r
-else{this._clearList();}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}\r\r
+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.typeAhead){return;}\r\r
+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;}\r\r
 var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}\r\r
 if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}\r\r
 if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}\r\r
 else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}\r\r
 else{this._oTextbox.value=this._sCurQuery;}\r\r
 this._oCurItem=null;return;}\r\r
-if(nNewItemIndex==-2){this._clearList();return;}\r\r
-var oNewItem=this._aListItems[nNewItemIndex];if((YAHOO.util.Dom.getStyle(this._oContainer._oContent,"overflow")=="auto")&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}\r\r
-else if((oNewItem.offsetTop+oNewItem.offsetHeight)<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}}\r\r
-else{if(oNewItem.offsetTop<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}\r\r
-else if(oNewItem.offsetTop>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}}}\r\r
-this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.prototype.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.prototype.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.getName=function(){return this._sName;};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=[];}\r\r
+if(nNewItemIndex==-2){this._toggleContainer(false);return;}\r\r
+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;}\r\r
+else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}\r\r
+else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}\r\r
+else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}\r\r
+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");}\r\r
+else{oSelf._toggleHighlight(this,"to");}\r\r
+oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}\r\r
+else{oSelf._toggleHighlight(this,"from");}\r\r
+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.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
+if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r\r
+else{oSelf._toggleContainer(false);}\r\r
+break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
+if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r\r
+else{oSelf._toggleContainer(false);}\r\r
+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)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
+break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r\r
+break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}\r\r
+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;}\r\r
+else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}\r\r
+if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}\r\r
+oSelf._nDelayID=nDelayID;}\r\r
+else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}\r\r
+else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}\r\r
+if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}\r\r
+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");}\r\r
+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=[];}\r\r
 if(this._aCacheHelper){this._aCacheHelper=[];}\r\r
 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(isNaN(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}\r\r
 if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}\r\r
-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(resultObj){var aCache=this._aCache;if(!aCache||!resultObj||!resultObj.query||!resultObj.results){return;}\r\r
+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;}\r\r
 if(aCache.length>=this.maxCacheEntries){aCache.shift();}\r\r
-aCache.push(resultObj);};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();}\r\r
-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);}\r\r
+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();}\r\r
+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);}\r\r
 break;}\r\r
 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);}}\r\r
 resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}\r\r
@@ -137,18 +129,20 @@ if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults
 return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}\r\r
 if(!aSchema||(aSchema.constructor!=Array)){return;}\r\r
 else{this.schema=aSchema;}\r\r
-this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.prototype.TYPE_JSON=0;YAHOO.widget.DS_XHR.prototype.TYPE_XML=1;YAHOO.widget.DS_XHR.prototype.TYPE_FLAT=2;YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR="XHR response failed";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.prototype.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!--";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==this.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}\r\r
-var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}\r\r
+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;}\r\r
+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;}\r\r
 for(var foo in oResp){}\r\r
 if(!isXML){oResp=oResp.responseText;}\r\r
 else{oResp=oResp.responseXML;}\r\r
-if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}\r\r
-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,oSelf.ERROR_DATAPARSE);return;}\r\r
-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,oSelf.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}\r\r
-if(this._oConn){YAHOO.util.Connect.abort(this._oConn);}\r\r
-oSelf._oConn=YAHOO.util.Connect.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);}\r\r
-switch(this.responseType){case this.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}\r\r
-else{jsonList=eval("jsonObjParsed."+aSchema[0]);}}\r\r
+if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}\r\r
+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=[];}\r\r
+else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}\r\r
+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(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}\r\r
+if(this._oConn){this.connMgr.abort(this._oConn);}\r\r
+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);}\r\r
+switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}\r\r
+else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}\r\r
+catch(e){bError=true;break;}}}\r\r
 else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}\r\r
 if(oResponse.indexOf("{")<0){bError=true;break;}\r\r
 if(oResponse.indexOf("{}")===0){break;}\r\r
@@ -156,26 +150,28 @@ var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
 jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}\r\r
 catch(e){bError=true;break;}}\r\r
 if(!jsonList){bError=true;break;}\r\r
+if(jsonList.constructor!=Array){jsonList=[jsonList];}\r\r
 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="";}\r\r
 aResultItem.unshift(dataFieldValue);}\r\r
+if(aResultItem.length==1){aResultItem.push(jsonResult);}\r\r
 aResults.unshift(aResultItem);}\r\r
-break;case this.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}\r\r
+break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}\r\r
 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;}\r\r
 else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}\r\r
 else{sValue="";}}\r\r
 aFieldSet.unshift(sValue);}\r\r
 aResults.unshift(aFieldSet);}\r\r
-break;case this.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}\r\r
+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);}\r\r
 var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}\r\r
 break;default:break;}\r\r
 sQuery=null;oResponse=null;oParent=null;if(bError){return null;}\r\r
 else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}\r\r
 if(!oFunction||(oFunction.constructor!=Function)){return;}\r\r
-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,this.ERROR_DATANULL);return;}\r\r
+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;}\r\r
 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(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}\r\r
 if(!aData||(aData.constructor!=Array)){return;}\r\r
-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 aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}\r\r
-for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(typeof aData[i]=="string"){aDataset[0]=aData[i];}\r\r
-else{aDataset=aData[i];}\r\r
-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);}}\r\r
-this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};\r\r
+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 aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}\r\r
+for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(aData[i]){if(aData[i].constructor==String){aDataset[0]=aData[i];}\r\r
+else if(aData[i].constructor==Array){aDataset=aData[i];}}\r\r
+if(aDataset[0]&&(aDataset[0].constructor==String)){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);}}}}\r\r
+this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};
\ No newline at end of file
index 98f48f2fdd62cf7c3f1903f7abbb5989ba7d0d07..a5722cc58d88ff655d38e5f5be8c15063b6ef251 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
 Code licensed under the BSD License:\r\r
 http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.11.0\r\r
+version: 0.12.0\r\r
 */\r\r
 \r\r
+ /**\r
+ * The AutoComplete control provides the front-end logic for text-entry suggestion and\r
+ * completion functionality.\r
+ *\r
+ * @module autocomplete\r
+ * @requires yahoo, dom, event, datasource\r
+ * @optional animation, connection, json\r
+ * @namespace YAHOO.widget\r
+ * @title AutoComplete Widget\r
+ */\r
+\r
+/****************************************************************************/\r
+/****************************************************************************/\r
+/****************************************************************************/\r
+\r
+/**\r
+ * The AutoComplete class provides the customizable functionality of a plug-and-play DHTML\r
+ * auto completion widget.  Some key features:\r
+ * <ul>\r
+ * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>\r
+ * <li>The drop down container can "roll down" or "fly out" via configurable\r
+ * animation</li>\r
+ * <li>UI look-and-feel customizable through CSS, including container\r
+ * attributes, borders, position, fonts, etc</li>\r
+ * </ul>\r
+ *\r
+ * @class AutoComplete\r
+ * @constructor\r
+ * @param elInput {HTMLElement} DOM element reference of an input field\r
+ * @param elInput {String} String ID of an input field\r
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV\r
+ * @param elContainer {String} String ID of an existing DIV\r
+ * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params\r
+ */\r
+YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {\r
+    if(elInput && elContainer && oDataSource) {\r
+        // Validate DataSource\r
+        if (oDataSource && (oDataSource instanceof YAHOO.widget.DataSource)) {\r
+            this.dataSource = oDataSource;\r
+        }\r
+        else {\r
+            return;\r
+        }\r
+\r
+        // Validate input element\r
+        if(YAHOO.util.Dom.inDocument(elInput)) {\r
+            if(typeof elInput == "string") {\r
+                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;\r
+                    this._oTextbox = document.getElementById(elInput);\r
+            }\r
+            else {\r
+                this._sName = (elInput.id) ?\r
+                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:\r
+                    "instance" + YAHOO.widget.AutoComplete._nIndex;\r
+                this._oTextbox = elInput;\r
+            }\r
+        }\r
+        else {\r
+            return;\r
+        }\r
+\r
+        // Validate container element\r
+        if(YAHOO.util.Dom.inDocument(elContainer)) {\r
+            if(typeof elContainer == "string") {\r
+                    this._oContainer = document.getElementById(elContainer);\r
+            }\r
+            else {\r
+                this._oContainer = elContainer;\r
+            }\r
+            if(this._oContainer.style.display == "none") {\r
+            }\r
+        }\r
+        else {\r
+            return;\r
+        }\r
+\r
+        // Set any config params passed in to override defaults\r
+        if (typeof oConfigs == "object") {\r
+            for(var sConfig in oConfigs) {\r
+                if (sConfig) {\r
+                    this[sConfig] = oConfigs[sConfig];\r
+                }\r
+            }\r
+        }\r
+\r
+        // Initialization sequence\r
+        this._initContainer();\r
+        this._initProps();\r
+        this._initList();\r
+        this._initContainerHelpers();\r
+\r
+        // Set up events\r
+        var oSelf = this;\r
+        var oTextbox = this._oTextbox;\r
+        // Events are actually for the content module within the container\r
+        var oContent = this._oContainer._oContent;\r
+\r
+        // Dom events\r
+        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);\r
+        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);\r
+        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);\r
+        if(oTextbox.form) {\r
+            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);\r
+        }\r
+        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);\r
+\r
+        // Custom events\r
+        this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);\r
+        this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this);\r
+        this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this);\r
+        this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this);\r
+        this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r
+        this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this);\r
+        this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this);\r
+        this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this);\r
+        this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this);\r
+        this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this);\r
+        this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this);\r
+        this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this);\r
+        this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this);\r
+        this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r
+        this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r
+        this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r
+        \r
+        // Finish up\r
+        oTextbox.setAttribute("autocomplete","off");\r
+        YAHOO.widget.AutoComplete._nIndex++;\r
+    }\r
+    // Required arguments were not found\r
+    else {\r
+    }\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public member variables\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * The DataSource object that encapsulates the data used for auto completion.\r
+ * This object should be an inherited object from YAHOO.widget.DataSource.\r
+ *\r
+ * @property dataSource\r
+ * @type Object\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataSource = null;\r
+\r
+/**\r
+ * Number of characters that must be entered before querying for results. A negative value\r
+ * effectively turns off the widget. A value of 0 allows queries of null or empty string\r
+ * values.\r
+ *\r
+ * @property minQueryLength\r
+ * @type Number\r
+ * @default 1\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;\r
+\r
+/**\r
+ * Maximum number of results to display in results container.\r
+ *\r
+ * @property maxResultsDisplayed\r
+ * @type Number\r
+ * @default 10\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;\r
+\r
+/**\r
+ * Number of seconds to delay before submitting a query request.  If a query\r
+ * request is received before a previous one has completed its delay, the\r
+ * previous request is cancelled and the new request is set to the delay.\r
+ *\r
+ * @property queryDelay\r
+ * @type Number\r
+ * @default 0.5\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.queryDelay = 0.5;\r
+\r
+/**\r
+ * Class name of a highlighted item within results container.\r
+ *\r
+ * @property highlighClassName\r
+ * @type String\r
+ * @default "yui-ac-highlight"\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";\r
+\r
+/**\r
+ * Class name of a pre-highlighted item within results container.\r
+ *\r
+ * @property prehighlightClassName\r
+ * @type String\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;\r
+\r
+/**\r
+ * Query delimiter. A single character separator for multiple delimited\r
+ * selections. Multiple delimiter characteres may be defined as an array of\r
+ * strings. A null value or empty string indicates that query results cannot\r
+ * be delimited. This feature is not recommended if you need forceSelection to\r
+ * be true.\r
+ *\r
+ * @property delimChar\r
+ * @type String | String[]\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.delimChar = null;\r
+\r
+/**\r
+ * Whether or not the first item in results container should be automatically highlighted\r
+ * on expand.\r
+ *\r
+ * @property autoHighlight\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.autoHighlight = true;\r
+\r
+/**\r
+ * Whether or not the input field should be automatically updated\r
+ * with the first query result as the user types, auto-selecting the substring\r
+ * that the user has not typed.\r
+ *\r
+ * @property typeAhead\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.typeAhead = false;\r
+\r
+/**\r
+ * Whether or not to animate the expansion/collapse of the results container in the\r
+ * horizontal direction.\r
+ *\r
+ * @property animHoriz\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animHoriz = false;\r
+\r
+/**\r
+ * Whether or not to animate the expansion/collapse of the results container in the\r
+ * vertical direction.\r
+ *\r
+ * @property animVert\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animVert = true;\r
+\r
+/**\r
+ * Speed of container expand/collapse animation, in seconds..\r
+ *\r
+ * @property animSpeed\r
+ * @type Number\r
+ * @default 0.3\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;\r
+\r
+/**\r
+ * Whether or not to force the user's selection to match one of the query\r
+ * results. Enabling this feature essentially transforms the input field into a\r
+ * &lt;select&gt; field. This feature is not recommended with delimiter character(s)\r
+ * defined.\r
+ *\r
+ * @property forceSelection\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.forceSelection = false;\r
+\r
+/**\r
+ * Whether or not to allow browsers to cache user-typed input in the input\r
+ * field. Disabling this feature will prevent the widget from setting the\r
+ * autocomplete="off" on the input field. When autocomplete="off"\r
+ * and users click the back button after form submission, user-typed input can\r
+ * be prefilled by the browser from its cache. This caching of user input may\r
+ * not be desired for sensitive data, such as credit card numbers, in which\r
+ * case, implementers should consider setting allowBrowserAutocomplete to false.\r
+ *\r
+ * @property allowBrowserAutocomplete\r
+ * @type Boolean\r
+ * @default true\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;\r
+\r
+/**\r
+ * Whether or not the results container should always be displayed.\r
+ * Enabling this feature displays the container when the widget is instantiated\r
+ * and prevents the toggling of the container to a collapsed state.\r
+ *\r
+ * @property alwaysShowContainer\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;\r
+\r
+/**\r
+ * Whether or not to use an iFrame to layer over Windows form elements in\r
+ * IE. Set to true only when the results container will be on top of a\r
+ * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,\r
+ * 5.5 < IE < 7).\r
+ *\r
+ * @property useIFrame\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.useIFrame = false;\r
+\r
+/**\r
+ * Whether or not the results container should have a shadow.\r
+ *\r
+ * @property useShadow\r
+ * @type Boolean\r
+ * @default false\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.useShadow = false;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public methods\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+ /**\r
+ * Public accessor to the unique name of the AutoComplete instance.\r
+ *\r
+ * @method toString\r
+ * @return {String} Unique name of the AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.toString = function() {\r
+    return "AutoComplete " + this._sName;\r
+};\r
+\r
+ /**\r
+ * Returns true if container is in an expanded state, false otherwise.\r
+ *\r
+ * @method isContainerOpen\r
+ * @return {Boolean} Returns true if container is in an expanded state, false otherwise.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() {\r
+    return this._bContainerOpen;\r
+};\r
+\r
+/**\r
+ * Public accessor to the internal array of DOM &lt;li&gt; elements that\r
+ * display query results within the results container.\r
+ *\r
+ * @method getListItems\r
+ * @return {HTMLElement[]} Array of &lt;li&gt; elements within the results container.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.getListItems = function() {\r
+    return this._aListItems;\r
+};\r
+\r
+/**\r
+ * Public accessor to the data held in an &lt;li&gt; element of the\r
+ * results container.\r
+ *\r
+ * @method getListItemData\r
+ * @return {Object | Array} Object or array of result data or null\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {\r
+    if(oListItem._oResultData) {\r
+        return oListItem._oResultData;\r
+    }\r
+    else {\r
+        return false;\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container header. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_hd".\r
+ *\r
+ * @method setHeader\r
+ * @param sHeader {String} HTML markup for results container header.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {\r
+    if(sHeader) {\r
+        if(this._oContainer._oContent._oHeader) {\r
+            this._oContainer._oContent._oHeader.innerHTML = sHeader;\r
+            this._oContainer._oContent._oHeader.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oHeader.innerHTML = "";\r
+        this._oContainer._oContent._oHeader.style.display = "none";\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container footer. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_ft".\r
+ *\r
+ * @method setFooter\r
+ * @param sFooter {String} HTML markup for results container footer.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {\r
+    if(sFooter) {\r
+        if(this._oContainer._oContent._oFooter) {\r
+            this._oContainer._oContent._oFooter.innerHTML = sFooter;\r
+            this._oContainer._oContent._oFooter.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oFooter.innerHTML = "";\r
+        this._oContainer._oContent._oFooter.style.display = "none";\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets HTML markup for the results container body. This markup will be\r
+ * inserted within a &lt;div&gt; tag with a class of "ac_bd".\r
+ *\r
+ * @method setBody\r
+ * @param sHeader {String} HTML markup for results container body.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {\r
+    if(sBody) {\r
+        if(this._oContainer._oContent._oBody) {\r
+            this._oContainer._oContent._oBody.innerHTML = sBody;\r
+            this._oContainer._oContent._oBody.style.display = "block";\r
+            this._oContainer._oContent.style.display = "block";\r
+        }\r
+    }\r
+    else {\r
+        this._oContainer._oContent._oBody.innerHTML = "";\r
+        this._oContainer._oContent.style.display = "none";\r
+    }\r
+    this._maxResultsDisplayed = 0;\r
+};\r
+\r
+/**\r
+ * Overridable method that converts a result item object into HTML markup\r
+ * for display. Return data values are accessible via the oResultItem object,\r
+ * and the key return value will always be oResultItem[0]. Markup will be\r
+ * displayed within &lt;li&gt; element tags in the container.\r
+ *\r
+ * @method formatResult\r
+ * @param oResultItem {Object} Result item representing one query result. Data is held in an array.\r
+ * @param sQuery {String} The current query string.\r
+ * @return {String} HTML markup of formatted result data.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {\r
+    var sResult = oResultItem[0];\r
+    if(sResult) {\r
+        return sResult;\r
+    }\r
+    else {\r
+        return "";\r
+    }\r
+};\r
+\r
+/**\r
+ * Overridable method called before container expands allows implementers to access data\r
+ * and DOM elements.\r
+ *\r
+ * @method doBeforeExpandContainer\r
+ * @return {Boolean} Return true to continue expanding container, false to cancel the expand.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oResultItem, sQuery) {\r
+    return true;\r
+};\r
+\r
+/**\r
+ * Makes query request to the DataSource.\r
+ *\r
+ * @method sendQuery\r
+ * @param sQuery {String} Query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {\r
+    this._sendQuery(sQuery);\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Public events\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Fired when the input field receives focus.\r
+ *\r
+ * @event textboxFocusEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;\r
+\r
+/**\r
+ * Fired when the input field receives key input.\r
+ *\r
+ * @event textboxKeyEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param nKeycode {Number} The keycode number.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance makes a query to the DataSource.\r
+ * \r
+ * @event dataRequestEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance receives query results from the data\r
+ * source.\r
+ *\r
+ * @event dataReturnEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ * @param aResults {Array} Results array.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;\r
+\r
+/**\r
+ * Fired when the AutoComplete instance does not receive query results from the\r
+ * DataSource due to an error.\r
+ *\r
+ * @event dataErrorEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;\r
+\r
+/**\r
+ * Fired when the results container is expanded.\r
+ *\r
+ * @event containerExpandEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;\r
+\r
+/**\r
+ * Fired when the input field has been prefilled by the type-ahead\r
+ * feature. \r
+ *\r
+ * @event typeAheadEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The query string.\r
+ * @param sPrefill {String} The prefill string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been moused over.\r
+ *\r
+ * @event itemMouseOverEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt element item moused to.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been moused out.\r
+ *\r
+ * @event itemMouseOutEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item moused from.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been arrowed to. \r
+ *\r
+ * @event itemArrowToEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed to.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;\r
+\r
+/**\r
+ * Fired when result item has been arrowed away from.\r
+ *\r
+ * @event itemArrowFromEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed from.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;\r
+\r
+/**\r
+ * Fired when an item is selected via mouse click, ENTER key, or TAB key.\r
+ *\r
+ * @event itemSelectEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param elItem {HTMLElement} The selected &lt;li&gt; element item.\r
+ * @param oData {Object} The data returned for the item, either as an object,\r
+ * or mapped from the schema into an array.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;\r
+\r
+/**\r
+ * Fired when a user selection does not match any of the displayed result items.\r
+ * Note that this event may not behave as expected when delimiter characters\r
+ * have been defined. \r
+ *\r
+ * @event unmatchedItemSelectEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @param sQuery {String} The user-typed query string.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;\r
+\r
+/**\r
+ * Fired if forceSelection is enabled and the user's input has been cleared\r
+ * because it did not match one of the returned query results.\r
+ *\r
+ * @event selectionEnforceEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;\r
+\r
+/**\r
+ * Fired when the results container is collapsed.\r
+ *\r
+ * @event containerCollapseEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;\r
+\r
+/**\r
+ * Fired when the input field loses focus.\r
+ *\r
+ * @event textboxBlurEvent\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ */\r
+YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private member variables\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Internal class variable to index multiple AutoComplete instances.\r
+ *\r
+ * @property _nIndex\r
+ * @type Number\r
+ * @default 0\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete._nIndex = 0;\r
+\r
+/**\r
+ * Name of AutoComplete instance.\r
+ *\r
+ * @property _sName\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sName = null;\r
+\r
+/**\r
+ * Text input field DOM element.\r
+ *\r
+ * @property _oTextbox\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oTextbox = null;\r
+\r
+/**\r
+ * Whether or not the input field is currently in focus. If query results come back\r
+ * but the user has already moved on, do not proceed with auto complete behavior.\r
+ *\r
+ * @property _bFocused\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bFocused = true;\r
+\r
+/**\r
+ * Animation instance for container expand/collapse.\r
+ *\r
+ * @property _oAnim\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oAnim = null;\r
+\r
+/**\r
+ * Container DOM element.\r
+ *\r
+ * @property _oContainer\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oContainer = null;\r
+\r
+/**\r
+ * Whether or not the results container is currently open.\r
+ *\r
+ * @property _bContainerOpen\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;\r
+\r
+/**\r
+ * Whether or not the mouse is currently over the results\r
+ * container. This is necessary in order to prevent clicks on container items\r
+ * from being text input field blur events.\r
+ *\r
+ * @property _bOverContainer\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bOverContainer = false;\r
+\r
+/**\r
+ * Array of &lt;li&gt; elements references that contain query results within the\r
+ * results container.\r
+ *\r
+ * @property _aListItems\r
+ * @type Array\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._aListItems = null;\r
+\r
+/**\r
+ * Number of &lt;li&gt; elements currently displayed in results container.\r
+ *\r
+ * @property _nDisplayedItems\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;\r
+\r
+/**\r
+ * Internal count of &lt;li&gt; elements displayed and hidden in results container.\r
+ *\r
+ * @property _maxResultsDisplayed\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;\r
+\r
+/**\r
+ * Current query string\r
+ *\r
+ * @property _sCurQuery\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sCurQuery = null;\r
+\r
+/**\r
+ * Past queries this session (for saving delimited queries).\r
+ *\r
+ * @property _sSavedQuery\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;\r
+\r
+/**\r
+ * Pointer to the currently highlighted &lt;li&gt; element in the container.\r
+ *\r
+ * @property _oCurItem\r
+ * @type HTMLElement\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._oCurItem = null;\r
+\r
+/**\r
+ * Whether or not an item has been selected since the container was populated\r
+ * with results. Reset to false by _populateList, and set to true when item is\r
+ * selected.\r
+ *\r
+ * @property _bItemSelected\r
+ * @type Boolean\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._bItemSelected = false;\r
+\r
+/**\r
+ * Key code of the last key pressed in textbox.\r
+ *\r
+ * @property _nKeyCode\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nKeyCode = null;\r
+\r
+/**\r
+ * Delay timeout ID.\r
+ *\r
+ * @property _nDelayID\r
+ * @type Number\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._nDelayID = -1;\r
+\r
+/**\r
+ * Src to iFrame used when useIFrame = true. Supports implementations over SSL\r
+ * as well.\r
+ *\r
+ * @property _iFrameSrc\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;";\r
+\r
+/**\r
+ * For users typing via certain IMEs, queries must be triggered by intervals,\r
+ * since key events yet supported across all browsers for all IMEs.\r
+ *\r
+ * @property _queryInterval\r
+ * @type Object\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._queryInterval = null;\r
+\r
+/**\r
+ * Internal tracker to last known textbox value, used to determine whether or not\r
+ * to trigger a query via interval for certain IME users.\r
+ *\r
+ * @event _sLastTextboxValue\r
+ * @type String\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null;\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private methods\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Updates and validates latest public config properties.\r
+ *\r
+ * @method __initProps\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initProps = function() {\r
+    // Correct any invalid values\r
+    var minQueryLength = this.minQueryLength;\r
+    if(isNaN(minQueryLength) || (minQueryLength < 1)) {\r
+        minQueryLength = 1;\r
+    }\r
+    var maxResultsDisplayed = this.maxResultsDisplayed;\r
+    if(isNaN(this.maxResultsDisplayed) || (this.maxResultsDisplayed < 1)) {\r
+        this.maxResultsDisplayed = 10;\r
+    }\r
+    var queryDelay = this.queryDelay;\r
+    if(isNaN(this.queryDelay) || (this.queryDelay < 0)) {\r
+        this.queryDelay = 0.5;\r
+    }\r
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r
+    if(aDelimChar) {\r
+        if(typeof aDelimChar == "string") {\r
+            this.delimChar = [aDelimChar];\r
+        }\r
+        else if(aDelimChar.constructor != Array) {\r
+            this.delimChar = null;\r
+        }\r
+    }\r
+    var animSpeed = this.animSpeed;\r
+    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {\r
+        if(isNaN(animSpeed) || (animSpeed < 0)) {\r
+            animSpeed = 0.3;\r
+        }\r
+        if(!this._oAnim ) {\r
+            oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);\r
+            this._oAnim = oAnim;\r
+        }\r
+        else {\r
+            this._oAnim.duration = animSpeed;\r
+        }\r
+    }\r
+    if(this.forceSelection && this.delimChar) {\r
+    }\r
+};\r
+\r
+/**\r
+ * Initializes the results container helpers if they are enabled and do\r
+ * not exist\r
+ *\r
+ * @method _initContainerHelpers\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {\r
+    if(this.useShadow && !this._oContainer._oShadow) {\r
+        var oShadow = document.createElement("div");\r
+        oShadow.className = "yui-ac-shadow";\r
+        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);\r
+    }\r
+    if(this.useIFrame && !this._oContainer._oIFrame) {\r
+        var oIFrame = document.createElement("iframe");\r
+        oIFrame.src = this._iFrameSrc;\r
+        oIFrame.frameBorder = 0;\r
+        oIFrame.scrolling = "no";\r
+        oIFrame.style.position = "absolute";\r
+        oIFrame.style.width = "100%";\r
+        oIFrame.style.height = "100%";\r
+        oIFrame.tabIndex = -1;\r
+        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);\r
+    }\r
+};\r
+\r
+/**\r
+ * Initializes the results container once at object creation\r
+ *\r
+ * @method _initContainer\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initContainer = function() {\r
+    if(!this._oContainer._oContent) {\r
+        // The oContent div helps size the iframe and shadow properly\r
+        var oContent = document.createElement("div");\r
+        oContent.className = "yui-ac-content";\r
+        oContent.style.display = "none";\r
+        this._oContainer._oContent = this._oContainer.appendChild(oContent);\r
+\r
+        var oHeader = document.createElement("div");\r
+        oHeader.className = "yui-ac-hd";\r
+        oHeader.style.display = "none";\r
+        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);\r
+\r
+        var oBody = document.createElement("div");\r
+        oBody.className = "yui-ac-bd";\r
+        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);\r
+\r
+        var oFooter = document.createElement("div");\r
+        oFooter.className = "yui-ac-ft";\r
+        oFooter.style.display = "none";\r
+        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);\r
+    }\r
+    else {\r
+    }\r
+};\r
+\r
+/**\r
+ * Clears out contents of container body and creates up to\r
+ * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an\r
+ * &lt;ul&gt; element.\r
+ *\r
+ * @method _initList\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initList = function() {\r
+    this._aListItems = [];\r
+    while(this._oContainer._oContent._oBody.hasChildNodes()) {\r
+        var oldListItems = this.getListItems();\r
+        if(oldListItems) {\r
+            for(var oldi = oldListItems.length-1; oldi >= 0; i--) {\r
+                oldListItems[oldi] = null;\r
+            }\r
+        }\r
+        this._oContainer._oContent._oBody.innerHTML = "";\r
+    }\r
+\r
+    var oList = document.createElement("ul");\r
+    oList = this._oContainer._oContent._oBody.appendChild(oList);\r
+    for(var i=0; i<this.maxResultsDisplayed; i++) {\r
+        var oItem = document.createElement("li");\r
+        oItem = oList.appendChild(oItem);\r
+        this._aListItems[i] = oItem;\r
+        this._initListItem(oItem, i);\r
+    }\r
+    this._maxResultsDisplayed = this.maxResultsDisplayed;\r
+};\r
+\r
+/**\r
+ * Initializes each &lt;li&gt; element in the container list.\r
+ *\r
+ * @method _initListItem\r
+ * @param oItem {HTMLElement} The &lt;li&gt; DOM element.\r
+ * @param nItemIndex {Number} The index of the element.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._initListItem = function(oItem, nItemIndex) {\r
+    var oSelf = this;\r
+    oItem.style.display = "none";\r
+    oItem._nItemIndex = nItemIndex;\r
+\r
+    oItem.mouseover = oItem.mouseout = oItem.onclick = null;\r
+    YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);\r
+    YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);\r
+    YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);\r
+};\r
+\r
+/**\r
+ * Enables interval detection for  Korean IME support.\r
+ *\r
+ * @method _onIMEDetected\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {\r
+    oSelf._enableIntervalDetection();\r
+};\r
+\r
+/**\r
+ * Enables query triggers based on text input detection by intervals (rather\r
+ * than by key events).\r
+ *\r
+ * @method _enableIntervalDetection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {\r
+    var currValue = this._oTextbox.value;\r
+    var lastValue = this._sLastTextboxValue;\r
+    if(currValue != lastValue) {\r
+        this._sLastTextboxValue = currValue;\r
+        this._sendQuery(currValue);\r
+    }\r
+};\r
+\r
+/**\r
+ * Cancels text input detection by intervals.\r
+ *\r
+ * @method _cancelIntervalDetection\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection = function(oSelf) {\r
+    if(oSelf._queryInterval) {\r
+        clearInterval(oSelf._queryInterval);\r
+    }\r
+};\r
+\r
+/**\r
+ * Whether or not key is functional or should be ignored. Note that the right\r
+ * arrow key is NOT an ignored key since it triggers queries for certain intl\r
+ * charsets.\r
+ *\r
+ * @method _isIgnoreKey\r
+ * @param nKeycode {Number} Code of key pressed.\r
+ * @return {Boolean} True if key should be ignored, false otherwise.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {\r
+    if ((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter\r
+            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl\r
+            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock\r
+            (nKeyCode == 27) || // esc\r
+            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end\r
+            (nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up\r
+            (nKeyCode == 40) || // down\r
+            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert\r
+        return true;\r
+    }\r
+    return false;\r
+};\r
+\r
+/**\r
+ * Makes query request to the DataSource.\r
+ *\r
+ * @method _sendQuery\r
+ * @param sQuery {String} Query string.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {\r
+    // Widget has been effectively turned off\r
+    if(this.minQueryLength == -1) {\r
+        this._toggleContainer(false);\r
+        return;\r
+    }\r
+    // Delimiter has been enabled\r
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r
+    if(aDelimChar) {\r
+        // Loop through all possible delimiters and find the latest one\r
+        // A " " may be a false positive if they are defined as delimiters AND\r
+        // are used to separate delimited queries\r
+        var nDelimIndex = -1;\r
+        for(var i = aDelimChar.length-1; i >= 0; i--) {\r
+            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);\r
+            if(nNewIndex > nDelimIndex) {\r
+                nDelimIndex = nNewIndex;\r
+            }\r
+        }\r
+        // If we think the last delimiter is a space (" "), make sure it is NOT\r
+        // a false positive by also checking the char directly before it\r
+        if(aDelimChar[i] == " ") {\r
+            for (var j = aDelimChar.length-1; j >= 0; j--) {\r
+                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {\r
+                    nDelimIndex--;\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        // A delimiter has been found so extract the latest query\r
+        if (nDelimIndex > -1) {\r
+            var nQueryStart = nDelimIndex + 1;\r
+            // Trim any white space from the beginning...\r
+            while(sQuery.charAt(nQueryStart) == " ") {\r
+                nQueryStart += 1;\r
+            }\r
+            // ...and save the rest of the string for later\r
+            this._sSavedQuery = sQuery.substring(0,nQueryStart);\r
+            // Here is the query itself\r
+            sQuery = sQuery.substr(nQueryStart);\r
+        }\r
+        else if(sQuery.indexOf(this._sSavedQuery) < 0){\r
+            this._sSavedQuery = null;\r
+        }\r
+    }\r
+\r
+    // Don't search queries that are too short\r
+    if (sQuery && (sQuery.length < this.minQueryLength) || (!sQuery && this.minQueryLength > 0)) {\r
+        if (this._nDelayID != -1) {\r
+            clearTimeout(this._nDelayID);\r
+        }\r
+        this._toggleContainer(false);\r
+        return;\r
+    }\r
+\r
+    sQuery = encodeURIComponent(sQuery);\r
+    this._nDelayID = -1;    // Reset timeout ID because request has been made\r
+    this.dataRequestEvent.fire(this, sQuery);\r
+    this.dataSource.getResults(this._populateList, sQuery, this);\r
+};\r
+\r
+/**\r
+ * Populates the array of &lt;li&gt; elements in the container with query\r
+ * results. This method is passed to YAHOO.widget.DataSource#getResults as a\r
+ * callback function so results from the DataSource instance are returned to the\r
+ * AutoComplete instance.\r
+ *\r
+ * @method _populateList\r
+ * @param sQuery {String} The query string.\r
+ * @param aResults {Array} An array of query result objects from the DataSource.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {\r
+    if(aResults === null) {\r
+        oSelf.dataErrorEvent.fire(oSelf, sQuery);\r
+    }\r
+    if (!oSelf._bFocused || !aResults) {\r
+        return;\r
+    }\r
+\r
+    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);\r
+    var contentStyle = oSelf._oContainer._oContent.style;\r
+    contentStyle.width = (!isOpera) ? null : "";\r
+    contentStyle.height = (!isOpera) ? null : "";\r
+\r
+    var sCurQuery = decodeURIComponent(sQuery);\r
+    oSelf._sCurQuery = sCurQuery;\r
+    oSelf._bItemSelected = false;\r
+\r
+    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {\r
+        oSelf._initList();\r
+    }\r
+\r
+    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);\r
+    oSelf._nDisplayedItems = nItems;\r
+    if (nItems > 0) {\r
+        oSelf._initContainerHelpers();\r
+        var aItems = oSelf._aListItems;\r
+\r
+        // Fill items with data\r
+        for(var i = nItems-1; i >= 0; i--) {\r
+            var oItemi = aItems[i];\r
+            var oResultItemi = aResults[i];\r
+            oItemi.innerHTML = oSelf.formatResult(oResultItemi, sCurQuery);\r
+            oItemi.style.display = "list-item";\r
+            oItemi._sResultKey = oResultItemi[0];\r
+            oItemi._oResultData = oResultItemi;\r
+\r
+        }\r
+\r
+        // Empty out remaining items if any\r
+        for(var j = aItems.length-1; j >= nItems ; j--) {\r
+            var oItemj = aItems[j];\r
+            oItemj.innerHTML = null;\r
+            oItemj.style.display = "none";\r
+            oItemj._sResultKey = null;\r
+            oItemj._oResultData = null;\r
+        }\r
+\r
+        if(oSelf.autoHighlight) {\r
+            // Go to the first item\r
+            var oFirstItem = aItems[0];\r
+            oSelf._toggleHighlight(oFirstItem,"to");\r
+            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);\r
+            oSelf._typeAhead(oFirstItem,sQuery);\r
+        }\r
+        else {\r
+            oSelf._oCurItem = null;\r
+        }\r
+\r
+        // Expand the container\r
+        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);\r
+        oSelf._toggleContainer(ok);\r
+    }\r
+    else {\r
+        oSelf._toggleContainer(false);\r
+    }\r
+    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);\r
+};\r
+\r
+/**\r
+ * When forceSelection is true and the user attempts\r
+ * leave the text input box without selecting an item from the query results,\r
+ * the user selection is cleared.\r
+ *\r
+ * @method _clearSelection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._clearSelection = function() {\r
+    var sValue = this._oTextbox.value;\r
+    var sChar = (this.delimChar) ? this.delimChar[0] : null;\r
+    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;\r
+    if(nIndex > -1) {\r
+        this._oTextbox.value = sValue.substring(0,nIndex);\r
+    }\r
+    else {\r
+         this._oTextbox.value = "";\r
+    }\r
+    this._sSavedQuery = this._oTextbox.value;\r
+\r
+    // Fire custom event\r
+    this.selectionEnforceEvent.fire(this);\r
+};\r
+\r
+/**\r
+ * Whether or not user-typed value in the text input box matches any of the\r
+ * query results.\r
+ *\r
+ * @method _textMatchesOption\r
+ * @return {Boolean} True if user-input text matches a result, false otherwise.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {\r
+    var foundMatch = false;\r
+\r
+    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {\r
+        var oItem = this._aListItems[i];\r
+        var sMatch = oItem._sResultKey.toLowerCase();\r
+        if (sMatch == this._sCurQuery.toLowerCase()) {\r
+            foundMatch = true;\r
+            break;\r
+        }\r
+    }\r
+    return(foundMatch);\r
+};\r
+\r
+/**\r
+ * Updates in the text input box with the first query result as the user types,\r
+ * selecting the substring that the user has not typed.\r
+ *\r
+ * @method _typeAhead\r
+ * @param oItem {HTMLElement} The &lt;li&gt; element item whose data populates the input field.\r
+ * @param sQuery {String} Query string.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r
+    // Don't update if turned off\r
+    if (!this.typeAhead) {\r
+        return;\r
+    }\r
+\r
+    var oTextbox = this._oTextbox;\r
+    var sValue = this._oTextbox.value; // any saved queries plus what user has typed\r
+\r
+    // Don't update with type-ahead if text selection is not supported\r
+    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {\r
+        return;\r
+    }\r
+\r
+    // Select the portion of text that the user has not typed\r
+    var nStart = sValue.length;\r
+    this._updateValue(oItem);\r
+    var nEnd = oTextbox.value.length;\r
+    this._selectText(oTextbox,nStart,nEnd);\r
+    var sPrefill = oTextbox.value.substr(nStart,nEnd);\r
+    this.typeAheadEvent.fire(this,sQuery,sPrefill);\r
+};\r
+\r
+/**\r
+ * Selects text in the input field.\r
+ *\r
+ * @method _selectText\r
+ * @param oTextbox {HTMLElement} Text input box element in which to select text.\r
+ * @param nStart {Number} Starting index of text string to select.\r
+ * @param nEnd {Number} Ending index of text selection.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {\r
+    if (oTextbox.setSelectionRange) { // For Mozilla\r
+        oTextbox.setSelectionRange(nStart,nEnd);\r
+    }\r
+    else if (oTextbox.createTextRange) { // For IE\r
+        var oTextRange = oTextbox.createTextRange();\r
+        oTextRange.moveStart("character", nStart);\r
+        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);\r
+        oTextRange.select();\r
+    }\r
+    else {\r
+        oTextbox.select();\r
+    }\r
+};\r
+\r
+/**\r
+ * Syncs results container with its helpers.\r
+ *\r
+ * @method _toggleContainerHelpers\r
+ * @param bShow {Boolean} True if container is expanded, false if collapsed\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {\r
+    var bFireEvent = false;\r
+    var width = this._oContainer._oContent.offsetWidth + "px";\r
+    var height = this._oContainer._oContent.offsetHeight + "px";\r
+\r
+    if(this.useIFrame && this._oContainer._oIFrame) {\r
+        bFireEvent = true;\r
+        if(bShow) {\r
+            this._oContainer._oIFrame.style.width = width;\r
+            this._oContainer._oIFrame.style.height = height;\r
+        }\r
+        else {\r
+            this._oContainer._oIFrame.style.width = 0;\r
+            this._oContainer._oIFrame.style.height = 0;\r
+        }\r
+    }\r
+    if(this.useShadow && this._oContainer._oShadow) {\r
+        bFireEvent = true;\r
+        if(bShow) {\r
+            this._oContainer._oShadow.style.width = width;\r
+            this._oContainer._oShadow.style.height = height;\r
+        }\r
+        else {\r
+           this._oContainer._oShadow.style.width = 0;\r
+            this._oContainer._oShadow.style.height = 0;\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Animates expansion or collapse of the container.\r
+ *\r
+ * @method _toggleContainer\r
+ * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {\r
+    var oContainer = this._oContainer;\r
+\r
+    // Implementer has container always open so don't mess with it\r
+    if(this.alwaysShowContainer && this._bContainerOpen) {\r
+        return;\r
+    }\r
+    \r
+    // Clear contents of container\r
+    if(!bShow) {\r
+        this._oContainer._oContent.scrollTop = 0;\r
+        var aItems = this._aListItems;\r
+\r
+        if(aItems && (aItems.length > 0)) {\r
+            for(var i = aItems.length-1; i >= 0 ; i--) {\r
+                aItems[i].style.display = "none";\r
+            }\r
+        }\r
+\r
+        if (this._oCurItem) {\r
+            this._toggleHighlight(this._oCurItem,"from");\r
+        }\r
+\r
+        this._oCurItem = null;\r
+        this._nDisplayedItems = 0;\r
+        this._sCurQuery = null;\r
+    }\r
+\r
+    // Container is already closed\r
+    if (!bShow && !this._bContainerOpen) {\r
+        oContainer._oContent.style.display = "none";\r
+        return;\r
+    }\r
+\r
+    // If animation is enabled...\r
+    var oAnim = this._oAnim;\r
+    if (oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {\r
+        // If helpers need to be collapsed, do it right away...\r
+        // but if helpers need to be expanded, wait until after the container expands\r
+        if(!bShow) {\r
+            this._toggleContainerHelpers(bShow);\r
+        }\r
+\r
+        if(oAnim.isAnimated()) {\r
+            oAnim.stop();\r
+        }\r
+\r
+        // Clone container to grab current size offscreen\r
+        var oClone = oContainer._oContent.cloneNode(true);\r
+        oContainer.appendChild(oClone);\r
+        oClone.style.top = "-9000px";\r
+        oClone.style.display = "block";\r
+\r
+        // Current size of the container is the EXPANDED size\r
+        var wExp = oClone.offsetWidth;\r
+        var hExp = oClone.offsetHeight;\r
+\r
+        // Calculate COLLAPSED sizes based on horiz and vert anim\r
+        var wColl = (this.animHoriz) ? 0 : wExp;\r
+        var hColl = (this.animVert) ? 0 : hExp;\r
+\r
+        // Set animation sizes\r
+        oAnim.attributes = (bShow) ?\r
+            {width: { to: wExp }, height: { to: hExp }} :\r
+            {width: { to: wColl}, height: { to: hColl }};\r
+\r
+        // If opening anew, set to a collapsed size...\r
+        if(bShow && !this._bContainerOpen) {\r
+            oContainer._oContent.style.width = wColl+"px";\r
+            oContainer._oContent.style.height = hColl+"px";\r
+        }\r
+        // Else, set it to its last known size.\r
+        else {\r
+            oContainer._oContent.style.width = wExp+"px";\r
+            oContainer._oContent.style.height = hExp+"px";\r
+        }\r
+\r
+        oContainer.removeChild(oClone);\r
+        oClone = null;\r
+\r
+       var oSelf = this;\r
+       var onAnimComplete = function() {\r
+            // Finish the collapse\r
+               oAnim.onComplete.unsubscribeAll();\r
+\r
+            if(bShow) {\r
+                oSelf.containerExpandEvent.fire(oSelf);\r
+            }\r
+            else {\r
+                oContainer._oContent.style.display = "none";\r
+                oSelf.containerCollapseEvent.fire(oSelf);\r
+            }\r
+            oSelf._toggleContainerHelpers(bShow);\r
+       };\r
+\r
+        // Display container and animate it\r
+        oContainer._oContent.style.display = "block";\r
+        oAnim.onComplete.subscribe(onAnimComplete);\r
+        oAnim.animate();\r
+        this._bContainerOpen = bShow;\r
+    }\r
+    // Else don't animate, just show or hide\r
+    else {\r
+        if(bShow) {\r
+            oContainer._oContent.style.display = "block";\r
+            this.containerExpandEvent.fire(this);\r
+        }\r
+        else {\r
+            oContainer._oContent.style.display = "none";\r
+            this.containerCollapseEvent.fire(this);\r
+        }\r
+        this._toggleContainerHelpers(bShow);\r
+        this._bContainerOpen = bShow;\r
+   }\r
+\r
+};\r
+\r
+/**\r
+ * Toggles the highlight on or off for an item in the container, and also cleans\r
+ * up highlighting of any previous item.\r
+ *\r
+ * @method _toggleHighlight\r
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.\r
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {\r
+    var sHighlight = this.highlightClassName;\r
+    if(this._oCurItem) {\r
+        // Remove highlight from old item\r
+        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);\r
+    }\r
+\r
+    if((sType == "to") && sHighlight) {\r
+        // Apply highlight to new item\r
+        YAHOO.util.Dom.addClass(oNewItem, sHighlight);\r
+        this._oCurItem = oNewItem;\r
+    }\r
+};\r
+\r
+/**\r
+ * Toggles the pre-highlight on or off for an item in the container.\r
+ *\r
+ * @method _togglePrehighlight\r
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.\r
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {\r
+    if(oNewItem == this._oCurItem) {\r
+        return;\r
+    }\r
+\r
+    var sPrehighlight = this.prehighlightClassName;\r
+    if((sType == "mouseover") && sPrehighlight) {\r
+        // Apply prehighlight to new item\r
+        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);\r
+    }\r
+    else {\r
+        // Remove prehighlight from old item\r
+        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);\r
+    }\r
+};\r
+\r
+/**\r
+ * Updates the text input box value with selected query result. If a delimiter\r
+ * has been defined, then the value gets appended with the delimiter.\r
+ *\r
+ * @method _updateValue\r
+ * @param oItem {HTMLElement} The &lt;li&gt; element item with which to update the value.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {\r
+    var oTextbox = this._oTextbox;\r
+    var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null;\r
+    var sSavedQuery = this._sSavedQuery;\r
+    var sResultKey = oItem._sResultKey;\r
+    oTextbox.focus();\r
+\r
+    // First clear text field\r
+    oTextbox.value = "";\r
+    // Grab data to put into text field\r
+    if(sDelimChar) {\r
+        if(sSavedQuery) {\r
+            oTextbox.value = sSavedQuery;\r
+        }\r
+        oTextbox.value += sResultKey + sDelimChar;\r
+        if(sDelimChar != " ") {\r
+            oTextbox.value += " ";\r
+        }\r
+    }\r
+    else { oTextbox.value = sResultKey; }\r
+\r
+    // scroll to bottom of textarea if necessary\r
+    if(oTextbox.type == "textarea") {\r
+        oTextbox.scrollTop = oTextbox.scrollHeight;\r
+    }\r
+\r
+    // move cursor to end\r
+    var end = oTextbox.value.length;\r
+    this._selectText(oTextbox,end,end);\r
+\r
+    this._oCurItem = oItem;\r
+};\r
+\r
+/**\r
+ * Selects a result item from the container\r
+ *\r
+ * @method _selectItem\r
+ * @param oItem {HTMLElement} The selected &lt;li&gt; element item.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._selectItem = function(oItem) {\r
+    this._bItemSelected = true;\r
+    this._updateValue(oItem);\r
+    this._cancelIntervalDetection(this);\r
+    this.itemSelectEvent.fire(this, oItem, oItem._oResultData);\r
+    this._toggleContainer(false);\r
+};\r
+\r
+/**\r
+ * For values updated by type-ahead, the right arrow key jumps to the end\r
+ * of the textbox, otherwise the container is closed.\r
+ *\r
+ * @method _jumpSelection\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {\r
+    if(!this.typeAhead) {\r
+        return;\r
+    }\r
+    else {\r
+        this._toggleContainer(false);\r
+    }\r
+};\r
+\r
+/**\r
+ * Triggered by up and down arrow keys, changes the current highlighted\r
+ * &lt;li&gt; element item. Scrolls container if necessary.\r
+ *\r
+ * @method _moveSelection\r
+ * @param nKeyCode {Number} Code of key pressed.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {\r
+    if(this._bContainerOpen) {\r
+        // Determine current item's id number\r
+        var oCurItem = this._oCurItem;\r
+        var nCurItemIndex = -1;\r
+\r
+        if (oCurItem) {\r
+            nCurItemIndex = oCurItem._nItemIndex;\r
+        }\r
+\r
+        var nNewItemIndex = (nKeyCode == 40) ?\r
+                (nCurItemIndex + 1) : (nCurItemIndex - 1);\r
+\r
+        // Out of bounds\r
+        if (nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {\r
+            return;\r
+        }\r
+\r
+        if (oCurItem) {\r
+            // Unhighlight current item\r
+            this._toggleHighlight(oCurItem, "from");\r
+            this.itemArrowFromEvent.fire(this, oCurItem);\r
+        }\r
+        if (nNewItemIndex == -1) {\r
+           // Go back to query (remove type-ahead string)\r
+            if(this.delimChar && this._sSavedQuery) {\r
+                if (!this._textMatchesOption()) {\r
+                    this._oTextbox.value = this._sSavedQuery;\r
+                }\r
+                else {\r
+                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;\r
+                }\r
+            }\r
+            else {\r
+                this._oTextbox.value = this._sCurQuery;\r
+            }\r
+            this._oCurItem = null;\r
+            return;\r
+        }\r
+        if (nNewItemIndex == -2) {\r
+            // Close container\r
+            this._toggleContainer(false);\r
+            return;\r
+        }\r
+\r
+        var oNewItem = this._aListItems[nNewItemIndex];\r
+\r
+        // Scroll the container if necessary\r
+        var oContent = this._oContainer._oContent;\r
+        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||\r
+            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));\r
+        if(scrollOn && (nNewItemIndex > -1) &&\r
+        (nNewItemIndex < this._nDisplayedItems)) {\r
+            // User is keying down\r
+            if(nKeyCode == 40) {\r
+                // Bottom of selected item is below scroll area...\r
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {\r
+                    // Set bottom of scroll area to bottom of selected item\r
+                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;\r
+                }\r
+                // Bottom of selected item is above scroll area...\r
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {\r
+                    // Set top of selected item to top of scroll area\r
+                    oContent.scrollTop = oNewItem.offsetTop;\r
+\r
+                }\r
+            }\r
+            // User is keying up\r
+            else {\r
+                // Top of selected item is above scroll area\r
+                if(oNewItem.offsetTop < oContent.scrollTop) {\r
+                    // Set top of scroll area to top of selected item\r
+                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r
+                }\r
+                // Top of selected item is below scroll area\r
+                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {\r
+                    // Set bottom of selected item to bottom of scroll area\r
+                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;\r
+                }\r
+            }\r
+        }\r
+\r
+        this._toggleHighlight(oNewItem, "to");\r
+        this.itemArrowToEvent.fire(this, oNewItem);\r
+        if(this.typeAhead) {\r
+            this._updateValue(oNewItem);\r
+        }\r
+    }\r
+};\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Private event handlers\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+/**\r
+ * Handles &lt;li&gt; element mouseover events in the container.\r
+ *\r
+ * @method _onItemMouseover\r
+ * @param v {HTMLEvent} The mouseover event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {\r
+    if(oSelf.prehighlightClassName) {\r
+        oSelf._togglePrehighlight(this,"mouseover");\r
+    }\r
+    else {\r
+        oSelf._toggleHighlight(this,"to");\r
+    }\r
+\r
+    oSelf.itemMouseOverEvent.fire(oSelf, this);\r
+};\r
+\r
+/**\r
+ * Handles &lt;li&gt; element mouseout events in the container.\r
+ *\r
+ * @method _onItemMouseout\r
+ * @param v {HTMLEvent} The mouseout event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {\r
+    if(oSelf.prehighlightClassName) {\r
+        oSelf._togglePrehighlight(this,"mouseout");\r
+    }\r
+    else {\r
+        oSelf._toggleHighlight(this,"from");\r
+    }\r
+\r
+    oSelf.itemMouseOutEvent.fire(oSelf, this);\r
+};\r
+\r
+/**\r
+ * Handles &lt;li&gt; element click events in the container.\r
+ *\r
+ * @method _onItemMouseclick\r
+ * @param v {HTMLEvent} The click event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {\r
+    // In case item has not been moused over\r
+    oSelf._toggleHighlight(this,"to");\r
+    oSelf._selectItem(this);\r
+};\r
+\r
+/**\r
+ * Handles container mouseover events.\r
+ *\r
+ * @method _onContainerMouseover\r
+ * @param v {HTMLEvent} The mouseover event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {\r
+    oSelf._bOverContainer = true;\r
+};\r
+\r
+/**\r
+ * Handles container mouseout events.\r
+ *\r
+ * @method _onContainerMouseout\r
+ * @param v {HTMLEvent} The mouseout event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {\r
+    oSelf._bOverContainer = false;\r
+    // If container is still active\r
+    if(oSelf._oCurItem) {\r
+        oSelf._toggleHighlight(oSelf._oCurItem,"to");\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles container scroll events.\r
+ *\r
+ * @method _onContainerScroll\r
+ * @param v {HTMLEvent} The scroll event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {\r
+    oSelf._oTextbox.focus();\r
+};\r
+\r
+/**\r
+ * Handles container resize events.\r
+ *\r
+ * @method _onContainerResize\r
+ * @param v {HTMLEvent} The resize event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {\r
+    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);\r
+};\r
+\r
+/**\r
+ * Handles textbox keydown events of functional keys, mainly for UI behavior.\r
+ *\r
+ * @method _onTextboxKeyDown\r
+ * @param v {HTMLEvent} The keydown event.\r
+ * @param oSelf {object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {\r
+    var nKeyCode = v.keyCode;\r
+\r
+    switch (nKeyCode) {\r
+        case 9: // tab\r
+            if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r
+                if(oSelf._bContainerOpen) {\r
+                    YAHOO.util.Event.stopEvent(v);\r
+                }\r
+            }\r
+            // select an item or clear out\r
+            if(oSelf._oCurItem) {\r
+                oSelf._selectItem(oSelf._oCurItem);\r
+            }\r
+            else {\r
+                oSelf._toggleContainer(false);\r
+            }\r
+            break;\r
+        case 13: // enter\r
+            if(oSelf._nKeyCode != nKeyCode) {\r
+                if(oSelf._bContainerOpen) {\r
+                    YAHOO.util.Event.stopEvent(v);\r
+                }\r
+            }\r
+            if(oSelf._oCurItem) {\r
+                oSelf._selectItem(oSelf._oCurItem);\r
+            }\r
+            else {\r
+                oSelf._toggleContainer(false);\r
+            }\r
+            break;\r
+        case 27: // esc\r
+            oSelf._toggleContainer(false);\r
+            return;\r
+        case 39: // right\r
+            oSelf._jumpSelection();\r
+            break;\r
+        case 38: // up\r
+            YAHOO.util.Event.stopEvent(v);\r
+            oSelf._moveSelection(nKeyCode);\r
+            break;\r
+        case 40: // down\r
+            YAHOO.util.Event.stopEvent(v);\r
+            oSelf._moveSelection(nKeyCode);\r
+            break;\r
+        default:\r
+            break;\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles textbox keypress events.\r
+ * @method _onTextboxKeyPress\r
+ * @param v {HTMLEvent} The keypress event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {\r
+    var nKeyCode = v.keyCode;\r
+\r
+        //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)\r
+        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);\r
+        if(isMac) {\r
+            switch (nKeyCode) {\r
+            case 9: // tab\r
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r
+                    if(oSelf._bContainerOpen) {\r
+                        YAHOO.util.Event.stopEvent(v);\r
+                    }\r
+                }\r
+                break;\r
+            case 13: // enter\r
+                    if(oSelf._nKeyCode != nKeyCode) {\r
+                        if(oSelf._bContainerOpen) {\r
+                            YAHOO.util.Event.stopEvent(v);\r
+                        }\r
+                    }\r
+                break;\r
+            case 38: // up\r
+            case 40: // down\r
+                YAHOO.util.Event.stopEvent(v);\r
+                break;\r
+            default:\r
+                break;\r
+            }\r
+        }\r
+\r
+        //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948)\r
+        // Korean IME detected\r
+        else if(nKeyCode == 229) {\r
+            oSelf._queryInterval = setInterval(function() { oSelf._onIMEDetected(oSelf); },500);\r
+        }\r
+};\r
+\r
+/**\r
+ * Handles textbox keyup events that trigger queries.\r
+ *\r
+ * @method _onTextboxKeyUp\r
+ * @param v {HTMLEvent} The keyup event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {\r
+    // Check to see if any of the public properties have been updated\r
+    oSelf._initProps();\r
+\r
+    var nKeyCode = v.keyCode;\r
+    oSelf._nKeyCode = nKeyCode;\r
+    var sText = this.value; //string in textbox\r
+\r
+    // Filter out chars that don't trigger queries\r
+    if (oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {\r
+        return;\r
+    }\r
+    else {\r
+        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);\r
+    }\r
+\r
+    // Set timeout on the request\r
+    if (oSelf.queryDelay > 0) {\r
+        var nDelayID =\r
+            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));\r
+\r
+        if (oSelf._nDelayID != -1) {\r
+            clearTimeout(oSelf._nDelayID);\r
+        }\r
+\r
+        oSelf._nDelayID = nDelayID;\r
+    }\r
+    else {\r
+        // No delay so send request immediately\r
+        oSelf._sendQuery(sText);\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles text input box receiving focus.\r
+ *\r
+ * @method _onTextboxFocus\r
+ * @param v {HTMLEvent} The focus event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {\r
+    oSelf._oTextbox.setAttribute("autocomplete","off");\r
+    oSelf._bFocused = true;\r
+    oSelf.textboxFocusEvent.fire(oSelf);\r
+};\r
+\r
+/**\r
+ * Handles text input box losing focus.\r
+ *\r
+ * @method _onTextboxBlur\r
+ * @param v {HTMLEvent} The focus event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {\r
+    // Don't treat as a blur if it was a selection via mouse click\r
+    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {\r
+        // Current query needs to be validated\r
+        if(!oSelf._bItemSelected) {\r
+            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && !oSelf._textMatchesOption())) {\r
+                if(oSelf.forceSelection) {\r
+                    oSelf._clearSelection();\r
+                }\r
+                else {\r
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);\r
+                }\r
+            }\r
+        }\r
+\r
+        if(oSelf._bContainerOpen) {\r
+            oSelf._toggleContainer(false);\r
+        }\r
+        oSelf._cancelIntervalDetection(oSelf);\r
+        oSelf._bFocused = false;\r
+        oSelf.textboxBlurEvent.fire(oSelf);\r
+    }\r
+};\r
+\r
+/**\r
+ * Handles form submission event.\r
+ *\r
+ * @method _onFormSubmit\r
+ * @param v {HTMLEvent} The submit event.\r
+ * @param oSelf {Object} The AutoComplete instance.\r
+ * @private\r
+ */\r
+YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {\r
+    if(oSelf.allowBrowserAutocomplete) {\r
+        oSelf._oTextbox.setAttribute("autocomplete","on");\r
+    }\r
+    else {\r
+        oSelf._oTextbox.setAttribute("autocomplete","off");\r
+    }\r
+};\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Class providing the customizable functionality of a plug-and-play DHTML\r\r
- * auto complete widget.  Some key features:\r\r
- * <ul>\r\r
- * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>\r\r
- * <li>The drop down container can "roll down" or "fly out" via configurable\r\r
- * animation</li>\r\r
- * <li>UI look-and-feel customizable through CSS, including container\r\r
- * attributes, borders, position, fonts, etc</li>\r\r
- * </ul>\r\r
- *\r\r
- * requires YAHOO.util.Dom Dom utility\r\r
- * requires YAHOO.util.Event Event utility\r\r
- * requires YAHOO.widget.DataSource Data source class\r\r
- * see YAHOO.util.Animation Animation utility\r\r
- * see JSON JSON library\r\r
- *\r\r
- * @constructor\r\r
- * @param {element | string} inputEl DOM element reference or string ID of the auto complete input field\r\r
- * @param {element | string} containerEl DOM element reference or string ID of the auto complete &lt;div&gt;\r\r
- *                              container\r\r
- * @param {object} oDataSource Instance of YAHOO.widget.DataSource for query/results\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
- */\r\r
-YAHOO.widget.AutoComplete = function(inputEl,containerEl,oDataSource,oConfigs) {\r\r
-    if(inputEl && containerEl && oDataSource) {\r\r
-        // Validate data source\r\r
-        if (oDataSource && (oDataSource instanceof YAHOO.widget.DataSource)) {\r\r
-            this.dataSource = oDataSource;\r\r
-        }\r\r
-        else {\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Validate input element\r\r
-        if(YAHOO.util.Dom.inDocument(inputEl)) {\r\r
-            if(typeof inputEl == "string") {\r\r
-                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + inputEl;\r\r
-                    this._oTextbox = document.getElementById(inputEl);\r\r
-            }\r\r
-            else {\r\r
-                this._sName = (inputEl.id) ?\r\r
-                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + inputEl.id:\r\r
-                    "instance" + YAHOO.widget.AutoComplete._nIndex;\r\r
-                this._oTextbox = inputEl;\r\r
-            }\r\r
-        }\r\r
-        else {\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Validate container element\r\r
-        if(YAHOO.util.Dom.inDocument(containerEl)) {\r\r
-            if(typeof containerEl == "string") {\r\r
-                    this._oContainer = document.getElementById(containerEl);\r\r
-            }\r\r
-            else {\r\r
-                this._oContainer = containerEl;\r\r
-            }\r\r
-            if(this._oContainer.style.display == "none") {\r\r
-            }\r\r
-        }\r\r
-        else {\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        // Set any config params passed in to override defaults\r\r
-        if (typeof oConfigs == "object") {\r\r
-            for(var sConfig in oConfigs) {\r\r
-                if (sConfig) {\r\r
-                    this[sConfig] = oConfigs[sConfig];\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        // Initialization sequence\r\r
-        this._initContainer();\r\r
-        this._initProps();\r\r
-        this._initList();\r\r
-        this._initContainerHelpers();\r\r
-\r\r
-        // Set up events\r\r
-        var oSelf = this;\r\r
-        var oTextbox = this._oTextbox;\r\r
-        // Events are actually for the content module within the container\r\r
-        var oContent = this._oContainer._oContent;\r\r
-\r\r
-        // Dom events\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);\r\r
-        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);\r\r
-        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);\r\r
-        if(oTextbox.form) {\r\r
-            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);\r\r
-        }\r\r
-\r\r
-        // Custom events\r\r
-        this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this);\r\r
-        this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this);\r\r
-        this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this);\r\r
-        this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this);\r\r
-        this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r\r
-        this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this);\r\r
-        this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this);\r\r
-        this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this);\r\r
-        this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this);\r\r
-        this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this);\r\r
-        this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this);\r\r
-        this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this);\r\r
-        this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this);\r\r
-        this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r\r
-        this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r\r
-        this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r\r
-        \r\r
-        // Finish up\r\r
-        oTextbox.setAttribute("autocomplete","off");\r\r
-        YAHOO.widget.AutoComplete._nIndex++;\r\r
-    }\r\r
-    // Required arguments were not found\r\r
-    else {\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * The data source object that encapsulates the data used for auto completion.\r\r
- * This object should be an inherited object from YAHOO.widget.DataSource.\r\r
- *\r\r
- * @type object\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataSource = null;\r\r
-\r\r
-/**\r\r
- * Number of characters that must be entered before querying for results.\r\r
- * Default: 1.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;\r\r
-\r\r
-/**\r\r
- * Maximum number of results to display in auto complete container. Default: 10.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;\r\r
-\r\r
-/**\r\r
- * Number of seconds to delay before submitting a query request.  If a query\r\r
- * request is received before a previous one has completed its delay, the\r\r
- * previous request is cancelled and the new request is set to the delay.\r\r
- * Default: 0.5.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.queryDelay = 0.5;\r\r
-\r\r
-/**\r\r
- * Class name of a highlighted item within the auto complete container.\r\r
- * Default: "yui-ac-highlight".\r\r
- *\r\r
- * @type string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";\r\r
-\r\r
-/**\r\r
- * Class name of a pre-highlighted item within the auto complete container.\r\r
- * Default: null.\r\r
- *\r\r
- * @type string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;\r\r
-\r\r
-/**\r\r
- * Query delimiter. A single character separator for multiple delimited\r\r
- * selections. Multiple delimiter characteres may be defined as an array of\r\r
- * strings. A null value or empty string indicates that query results cannot\r\r
- * be delimited. This feature is not recommended if you need forceSelection to\r\r
- * be true. Default: null.\r\r
- *\r\r
- * @type string or array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.delimChar = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the first item in the auto complete container should be\r\r
- * automatically highlighted on expand. Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.autoHighlight = true;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete input field should be automatically updated\r\r
- * with the first query result as the user types, auto-selecting the substring\r\r
- * that the user has not typed. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.typeAhead = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to animate the expansion/collapse of the auto complete\r\r
- * container in the horizontal direction. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animHoriz = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to animate the expansion/collapse of the auto complete\r\r
- * container in the vertical direction. Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animVert = true;\r\r
-\r\r
-/**\r\r
- * Speed of container expand/collapse animation, in seconds. Default: 0.3.\r\r
- *\r\r
- * @type number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;\r\r
-\r\r
-/**\r\r
- * Whether or not to force the user's selection to match one of the query\r\r
- * results. Enabling this feature essentially transforms the auto complete form\r\r
- * input field into a &lt;select&gt; field. This feature is not recommended\r\r
- * with delimiter character(s) defined. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.forceSelection = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to allow browsers to cache user-typed input in the input\r\r
- * field. Disabling this feature will prevent the widget from setting the\r\r
- * autocomplete="off" on the auto complete input field. When autocomplete="off"\r\r
- * and users click the back button after form submission, user-typed input can\r\r
- * be prefilled by the browser from its cache. This caching of user input may\r\r
- * not be desired for sensitive data, such as credit card numbers, in which\r\r
- * case, implementers should consider setting allowBrowserAutocomplete to false.\r\r
- * Default: true.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container should always be displayed.\r\r
- * Enabling this feature prevents the toggling of the container to a collapsed\r\r
- * state. Default: false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;\r\r
-\r\r
-/**\r\r
- * Whether or not to use an iFrame to layer over Windows form elements in\r\r
- * IE. Set to true only when the auto complete container will be on top of a\r\r
- * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,\r\r
- * 5.5 < IE < 7). Default:false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.useIFrame = false;\r\r
-\r\r
-/**\r\r
- * Configurable iFrame src used when useIFrame = true. Implementations over SSL\r\r
- * should set this parameter to an appropriate https location in order to avoid\r\r
- * security-related browser errors. Default:"about:blank".\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.iFrameSrc = "about:blank";\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container should have a shadow. Default:false.\r\r
- *\r\r
- * @type boolean\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.useShadow = false;\r\r
-\r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
- /**\r\r
- * Public accessor to the unique name of the auto complete instance.\r\r
- *\r\r
- * @return {string} Unique name of the auto complete instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getName = function() {\r\r
-    return this._sName;\r\r
-};\r\r
-\r\r
- /**\r\r
- * Public accessor to the unique name of the auto complete instance.\r\r
- *\r\r
- * @return {string} Unique name of the auto complete instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.toString = function() {\r\r
-    return "AutoComplete " + this._sName;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to the internal array of DOM &lt;li&gt; elements that\r\r
- * display query results within the auto complete container.\r\r
- *\r\r
- * @return {array} Array of &lt;li&gt; elements within the auto complete\r\r
- *                 container\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getListItems = function() {\r\r
-    return this._aListItems;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to the data held in an &lt;li&gt; element of the\r\r
- * auto complete container.\r\r
- *\r\r
- * @return {object or array} Object or array of result data or null\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {\r\r
-    if(oListItem._oResultData) {\r\r
-        return oListItem._oResultData;\r\r
-    }\r\r
-    else {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container header. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_hd".\r\r
- *\r\r
- * @param {string} sHeader HTML markup for container header\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {\r\r
-    if(sHeader) {\r\r
-        if(this._oContainer._oContent._oHeader) {\r\r
-            this._oContainer._oContent._oHeader.innerHTML = sHeader;\r\r
-            this._oContainer._oContent._oHeader.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oHeader.innerHTML = "";\r\r
-        this._oContainer._oContent._oHeader.style.display = "none";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container footer. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_ft".\r\r
- *\r\r
- * @param {string} sFooter HTML markup for container footer\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {\r\r
-    if(sFooter) {\r\r
-        if(this._oContainer._oContent._oFooter) {\r\r
-            this._oContainer._oContent._oFooter.innerHTML = sFooter;\r\r
-            this._oContainer._oContent._oFooter.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oFooter.innerHTML = "";\r\r
-        this._oContainer._oContent._oFooter.style.display = "none";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Sets HTML markup for the auto complete container body. This markup will be\r\r
- * inserted within a &lt;div&gt; tag with a class of "ac_bd".\r\r
- *\r\r
- * @param {string} sHeader HTML markup for container body\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {\r\r
-    if(sBody) {\r\r
-        if(this._oContainer._oContent._oBody) {\r\r
-            this._oContainer._oContent._oBody.innerHTML = sBody;\r\r
-            this._oContainer._oContent._oBody.style.display = "block";\r\r
-            this._oContainer._oContent.style.display = "block";\r\r
-        }\r\r
-    }\r\r
-    else {\r\r
-        this._oContainer._oContent._oBody.innerHTML = "";\r\r
-        this._oContainer._oContent.style.display = "none";\r\r
-    }\r\r
-    this._maxResultsDisplayed = 0;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Overridable method that converts a result item object into HTML markup\r\r
- * for display. Return data values are accessible via the oResultItem object,\r\r
- * and the key return value will always be oResultItem[0]. Markup will be\r\r
- * displayed within &lt;li&gt; element tags in the container.\r\r
- *\r\r
- * @param {object} oResultItem Result item object representing one query result\r\r
- * @param {string} sQuery The current query string\r\r
- * @return {string} HTML markup of formatted result data\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {\r\r
-    var sResult = oResultItem[0];\r\r
-    if(sResult) {\r\r
-        return sResult;\r\r
-    }\r\r
-    else {\r\r
-        return "";\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Makes query request to the data source.\r\r
- *\r\r
- * @param {string} sQuery Query string.\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {\r\r
-    if(sQuery) {\r\r
-        this._sendQuery(sQuery);\r\r
-    }\r\r
-    else {\r\r
-        return;\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Fired when the auto complete text input box receives focus. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     -  args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete text input box receives key input. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The keycode number\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance makes a query to the data source.\r\r
- * Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance receives query results from the data\r\r
- * source. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- *     - args[2] Results array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete instance does not receive query results from the\r\r
- * data source due to an error. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete container is expanded. If alwaysShowContainer is\r\r
- * enabled, then containerExpandEvent will be fired when the container is\r\r
- * populated with results. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete textbox has been prefilled by the type-ahead\r\r
- * feature. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The query string\r\r
- *     - args[2] The prefill string\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been moused over. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt element item moused to\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been moused out. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item moused from\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been arrowed to. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item arrowed to\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when result item has been arrowed away from. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The &lt;li&gt; element item arrowed from\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when an item is selected via mouse click, ENTER key, or TAB key.\r\r
- * Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The selected &lt;li&gt; element item\r\r
- *     - args[2] The data returned for the item, either as an object, or mapped from the schema into an array\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when an user selection does not match any of the displayed result items.\r\r
- * Note that this event may not behave as expected when delimiter characters\r\r
- * have been defined. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- *     - args[1] The user selection\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired if forceSelection is enabled and the user's input has been cleared\r\r
- * because it did not match one of the returned query results. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete container is collapsed. If alwaysShowContainer is\r\r
- * enabled, then containerCollapseEvent will be fired when the container is\r\r
- * cleared of results. Subscribers receive the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;\r\r
-\r\r
-/**\r\r
- * Fired when the auto complete text input box loses focus. Subscribers receive\r\r
- * an array of the following array:<br>\r\r
- *     - args[0] The auto complete object instance\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;\r\r
-\r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Internal class variable to index multiple auto complete instances.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete._nIndex = 0;\r\r
-\r\r
-/**\r\r
- * Name of auto complete instance.\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sName = null;\r\r
-\r\r
-/**\r\r
- * Text input box DOM element.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oTextbox = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the textbox is currently in focus. If query results come back\r\r
- * but the user has already moved on, do not proceed with auto complete behavior.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bFocused = true;\r\r
-\r\r
-/**\r\r
- * Animation instance for container expand/collapse.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oAnim = null;\r\r
-\r\r
-/**\r\r
- * Container DOM element.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oContainer = null;\r\r
-\r\r
-/**\r\r
- * Whether or not the auto complete container is currently open.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;\r\r
-\r\r
-/**\r\r
- * Whether or not the mouse is currently over the auto complete\r\r
- * container. This is necessary in order to prevent clicks on container items\r\r
- * from being text input box blur events.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bOverContainer = false;\r\r
-\r\r
-/**\r\r
- * Array of &lt;li&gt; elements references that contain query results within the\r\r
- * auto complete container.\r\r
- *\r\r
- * @type array\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._aListItems = null;\r\r
-\r\r
-/**\r\r
- * Number of &lt;li&gt; elements currently displayed in auto complete container.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;\r\r
-\r\r
-/**\r\r
- * Internal count of &lt;li&gt; elements displayed and hidden in auto complete container.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;\r\r
-\r\r
-/**\r\r
- * Current query string\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sCurQuery = null;\r\r
-\r\r
-/**\r\r
- * Past queries this session (for saving delimited queries).\r\r
- *\r\r
- * @type string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;\r\r
-\r\r
-/**\r\r
- * Pointer to the currently highlighted &lt;li&gt; element in the container.\r\r
- *\r\r
- * @type object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._oCurItem = null;\r\r
-\r\r
-/**\r\r
- * Whether or not an item has been selected since the container was populated\r\r
- * with results. Reset to false by _populateList, and set to true when item is\r\r
- * selected.\r\r
- *\r\r
- * @type boolean\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._bItemSelected = false;\r\r
-\r\r
-/**\r\r
- * Key code of the last key pressed in textbox.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nKeyCode = null;\r\r
-\r\r
-/**\r\r
- * Delay timeout ID.\r\r
- *\r\r
- * @type number\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._nDelayID = -1;\r\r
-\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Updates and validates latest public config properties.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initProps = function() {\r\r
-    // Correct any invalid values\r\r
-    var minQueryLength = this.minQueryLength;\r\r
-    if(isNaN(minQueryLength) || (minQueryLength < 1)) {\r\r
-        minQueryLength = 1;\r\r
-    }\r\r
-    var maxResultsDisplayed = this.maxResultsDisplayed;\r\r
-    if(isNaN(this.maxResultsDisplayed) || (this.maxResultsDisplayed < 1)) {\r\r
-        this.maxResultsDisplayed = 10;\r\r
-    }\r\r
-    var queryDelay = this.queryDelay;\r\r
-    if(isNaN(this.queryDelay) || (this.queryDelay < 0)) {\r\r
-        this.queryDelay = 0.5;\r\r
-    }\r\r
-    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r\r
-    if(aDelimChar) {\r\r
-        if(typeof aDelimChar == "string") {\r\r
-            this.delimChar = [aDelimChar];\r\r
-        }\r\r
-        else if(aDelimChar.constructor != Array) {\r\r
-            this.delimChar = null;\r\r
-        }\r\r
-    }\r\r
-    var animSpeed = this.animSpeed;\r\r
-    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {\r\r
-        if(isNaN(animSpeed) || (animSpeed < 0)) {\r\r
-            animSpeed = 0.3;\r\r
-        }\r\r
-        if(!this._oAnim ) {\r\r
-            oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);\r\r
-            this._oAnim = oAnim;\r\r
-        }\r\r
-        else {\r\r
-            this._oAnim.duration = animSpeed;\r\r
-        }\r\r
-    }\r\r
-    if(this.forceSelection && this.delimChar) {\r\r
-    }\r\r
-    if(this.alwaysShowContainer && (this.useShadow || this.useIFrame)) {\r\r
-    }\r\r
-\r\r
-    if(this.alwaysShowContainer) {\r\r
-        this._bContainerOpen = true;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes the auto complete container helpers if they are enabled and do\r\r
- * not exist\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {\r\r
-    if(this.useShadow && !this._oContainer._oShadow) {\r\r
-        var oShadow = document.createElement("div");\r\r
-        oShadow.className = "yui-ac-shadow";\r\r
-        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);\r\r
-    }\r\r
-    if(this.useIFrame && !this._oContainer._oIFrame) {\r\r
-        var oIFrame = document.createElement("iframe");\r\r
-        oIFrame.src = this.iFrameSrc;\r\r
-        oIFrame.frameBorder = 0;\r\r
-        oIFrame.scrolling = "no";\r\r
-        oIFrame.style.position = "absolute";\r\r
-        oIFrame.style.width = "100%";\r\r
-        oIFrame.style.height = "100%";\r\r
-        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes the auto complete container once at object creation\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initContainer = function() {\r\r
-    if(!this._oContainer._oContent) {\r\r
-        // The oContent div helps size the iframe and shadow properly\r\r
-        var oContent = document.createElement("div");\r\r
-        oContent.className = "yui-ac-content";\r\r
-        oContent.style.display = "none";\r\r
-        this._oContainer._oContent = this._oContainer.appendChild(oContent);\r\r
-\r\r
-        var oHeader = document.createElement("div");\r\r
-        oHeader.className = "yui-ac-hd";\r\r
-        oHeader.style.display = "none";\r\r
-        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);\r\r
-\r\r
-        var oBody = document.createElement("div");\r\r
-        oBody.className = "yui-ac-bd";\r\r
-        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);\r\r
-\r\r
-        var oFooter = document.createElement("div");\r\r
-        oFooter.className = "yui-ac-ft";\r\r
-        oFooter.style.display = "none";\r\r
-        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);\r\r
-    }\r\r
-    else {\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Clears out contents of container body and creates up to\r\r
- * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an\r\r
- * &lt;ul&gt; element.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initList = function() {\r\r
-    this._aListItems = [];\r\r
-    while(this._oContainer._oContent._oBody.hasChildNodes()) {\r\r
-        var oldListItems = this.getListItems();\r\r
-        if(oldListItems) {\r\r
-            for(var oldi = oldListItems.length-1; oldi >= 0; i--) {\r\r
-                oldListItems[oldi] = null;\r\r
-            }\r\r
-        }\r\r
-        this._oContainer._oContent._oBody.innerHTML = "";\r\r
-    }\r\r
-\r\r
-    var oList = document.createElement("ul");\r\r
-    oList = this._oContainer._oContent._oBody.appendChild(oList);\r\r
-    for(var i=0; i<this.maxResultsDisplayed; i++) {\r\r
-        var oItem = document.createElement("li");\r\r
-        oItem = oList.appendChild(oItem);\r\r
-        this._aListItems[i] = oItem;\r\r
-        this._initListItem(oItem, i);\r\r
-    }\r\r
-    this._maxResultsDisplayed = this.maxResultsDisplayed;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Initializes each &lt;li&gt; element in the container list.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; DOM element\r\r
- * @param {number} nItemIndex The index of the element\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._initListItem = function(oItem, nItemIndex) {\r\r
-    var oSelf = this;\r\r
-    oItem.style.display = "none";\r\r
-    oItem._nItemIndex = nItemIndex;\r\r
-\r\r
-    oItem.mouseover = oItem.mouseout = oItem.onclick = null;\r\r
-    YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);\r\r
-    YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);\r\r
-    YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element mouseover events in the container.\r\r
- *\r\r
- * @param {event} v The mouseover event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {\r\r
-    if(oSelf.prehighlightClassName) {\r\r
-        oSelf._togglePrehighlight(this,"mouseover");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._toggleHighlight(this,"to");\r\r
-    }\r\r
-\r\r
-    oSelf.itemMouseOverEvent.fire(oSelf, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element mouseout events in the container.\r\r
- *\r\r
- * @param {event} v The mouseout event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {\r\r
-    if(oSelf.prehighlightClassName) {\r\r
-        oSelf._togglePrehighlight(this,"mouseout");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._toggleHighlight(this,"from");\r\r
-    }\r\r
-\r\r
-    oSelf.itemMouseOutEvent.fire(oSelf, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles &lt;li&gt; element click events in the container.\r\r
- *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {\r\r
-    // In case item has not been moused over\r\r
-    oSelf._toggleHighlight(this,"to");\r\r
-    oSelf._selectItem(this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container mouseover events.\r\r
- *\r\r
- * @param {event} v The mouseover event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {\r\r
-    oSelf._bOverContainer = true;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container mouseout events.\r\r
- *\r\r
- * @param {event} v The mouseout event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {\r\r
-    oSelf._bOverContainer = false;\r\r
-    // If container is still active\r\r
-    if(oSelf._oCurItem) {\r\r
-        oSelf._toggleHighlight(oSelf._oCurItem,"to");\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container scroll events.\r\r
- *\r\r
- * @param {event} v The scroll event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {\r\r
-    oSelf._oTextbox.focus();\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles container resize events.\r\r
- *\r\r
- * @param {event} v The resize event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {\r\r
-    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles textbox keydown events of functional keys, mainly for UI behavior.\r\r
- *\r\r
- * @param {event} v The keydown event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {\r\r
-    var nKeyCode = v.keyCode;\r\r
-\r\r
-    switch (nKeyCode) {\r\r
-        case 9: // tab\r\r
-            if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {\r\r
-                if(oSelf._bContainerOpen) {\r\r
-                    YAHOO.util.Event.stopEvent(v);\r\r
-                }\r\r
-            }\r\r
-            // select an item or clear out\r\r
-            if(oSelf._oCurItem) {\r\r
-                oSelf._selectItem(oSelf._oCurItem);\r\r
-            }\r\r
-            else {\r\r
-                oSelf._clearList();\r\r
-            }\r\r
-            break;\r\r
-        case 13: // enter\r\r
-            if(oSelf._nKeyCode != nKeyCode) {\r\r
-                if(oSelf._bContainerOpen) {\r\r
-                    YAHOO.util.Event.stopEvent(v);\r\r
-                }\r\r
-            }\r\r
-            if(oSelf._oCurItem) {\r\r
-                oSelf._selectItem(oSelf._oCurItem);\r\r
-            }\r\r
-            else {\r\r
-                oSelf._clearList();\r\r
-            }\r\r
-            break;\r\r
-        case 27: // esc\r\r
-            oSelf._clearList();\r\r
-            return;\r\r
-        case 39: // right\r\r
-            oSelf._jumpSelection();\r\r
-            break;\r\r
-        case 38: // up\r\r
-            YAHOO.util.Event.stopEvent(v);\r\r
-            oSelf._moveSelection(nKeyCode);\r\r
-            break;\r\r
-        case 40: // down\r\r
-            YAHOO.util.Event.stopEvent(v);\r\r
-            oSelf._moveSelection(nKeyCode);\r\r
-            break;\r\r
-        default:\r\r
-            break;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles textbox keypress events, mainly for stopEvent in Safari.\r\r
- *\r\r
- * @param {event} v The keyup event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {\r\r
-    var nKeyCode = v.keyCode;\r\r
-\r\r
-    switch (nKeyCode) {\r\r
-    case 9: // tab\r\r
-    case 13: // enter\r\r
-        if((oSelf._nKeyCode != nKeyCode)) {\r\r
-                YAHOO.util.Event.stopEvent(v);\r\r
-        }\r\r
-        break;\r\r
-    case 38: // up\r\r
-    case 40: // down\r\r
-        YAHOO.util.Event.stopEvent(v);\r\r
-        break;\r\r
-    default:\r\r
-        break;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles textbox keyup events that trigger queries.\r\r
- *\r\r
- * @param {event} v The keyup event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {\r\r
-    // Check to see if any of the public properties have been updated\r\r
-    oSelf._initProps();\r\r
-\r\r
-    var nKeyCode = v.keyCode;\r\r
-    oSelf._nKeyCode = nKeyCode;\r\r
-    var sChar = String.fromCharCode(nKeyCode);\r\r
-    var sText = this.value; //string in textbox\r\r
-\r\r
-    // Filter out chars that don't trigger queries\r\r
-    if (oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {\r\r
-        return;\r\r
-    }\r\r
-    else {\r\r
-        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);\r\r
-    }\r\r
-\r\r
-    // Set timeout on the request\r\r
-    if (oSelf.queryDelay > 0) {\r\r
-        var nDelayID =\r\r
-            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));\r\r
-\r\r
-        if (oSelf._nDelayID != -1) {\r\r
-            clearTimeout(oSelf._nDelayID);\r\r
-        }\r\r
-\r\r
-        oSelf._nDelayID = nDelayID;\r\r
-    }\r\r
-    else {\r\r
-        // No delay so send request immediately\r\r
-        oSelf._sendQuery(sText);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Whether or not key is functional or should be ignored. Note that the right\r\r
- * arrow key is NOT an ignored key since it triggers queries for certain intl\r\r
- * charsets.\r\r
- *\r\r
- * @param {number} nKeycode Code of key pressed\r\r
- * @return {boolean} Whether or not to be ignore key\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {\r\r
-    if ((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter\r\r
-            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl\r\r
-            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock\r\r
-            (nKeyCode == 27) || // esc\r\r
-            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end\r\r
-            (nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up\r\r
-            (nKeyCode == 40) || // down\r\r
-            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert\r\r
-        return true;\r\r
-    }\r\r
-    return false;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles text input box receiving focus.\r\r
- *\r\r
- * @param {event} v The focus event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {\r\r
-    oSelf._oTextbox.setAttribute("autocomplete","off");\r\r
-    oSelf._bFocused = true;\r\r
-    oSelf.textboxFocusEvent.fire(oSelf);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles text input box losing focus.\r\r
- *\r\r
- * @param {event} v The focus event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {\r\r
-    // Don't treat as a blur if it was a selection via mouse click\r\r
-    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {\r\r
-        // Current query needs to be validated\r\r
-        if(!oSelf._bItemSelected) {\r\r
-            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && !oSelf._textMatchesOption())) {\r\r
-                if(oSelf.forceSelection) {\r\r
-                    oSelf._clearSelection();\r\r
-                }\r\r
-                else {\r\r
-                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        if(oSelf._bContainerOpen) {\r\r
-            oSelf._clearList();\r\r
-        }\r\r
-        oSelf._bFocused = false;\r\r
-        oSelf.textboxBlurEvent.fire(oSelf);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handles form submission event.\r\r
- *\r\r
- * @param {event} v The submit event\r\r
- * @param {object} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {\r\r
-    if(oSelf.allowBrowserAutocomplete) {\r\r
-        oSelf._oTextbox.setAttribute("autocomplete","on");\r\r
-    }\r\r
-    else {\r\r
-        oSelf._oTextbox.setAttribute("autocomplete","off");\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Makes query request to the data source.\r\r
- *\r\r
- * @param {string} sQuery Query string.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {\r\r
-    // Delimiter has been enabled\r\r
-    var aDelimChar = (this.delimChar) ? this.delimChar : null;\r\r
-    if(aDelimChar) {\r\r
-        // Loop through all possible delimiters and find the latest one\r\r
-        // A " " may be a false positive if they are defined as delimiters AND\r\r
-        // are used to separate delimited queries\r\r
-        var nDelimIndex = -1;\r\r
-        for(var i = aDelimChar.length-1; i >= 0; i--) {\r\r
-            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);\r\r
-            if(nNewIndex > nDelimIndex) {\r\r
-                nDelimIndex = nNewIndex;\r\r
-            }\r\r
-        }\r\r
-        // If we think the last delimiter is a space (" "), make sure it is NOT\r\r
-        // a false positive by also checking the char directly before it\r\r
-        if(aDelimChar[i] == " ") {\r\r
-            for (var j = aDelimChar.length-1; j >= 0; j--) {\r\r
-                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {\r\r
-                    nDelimIndex--;\r\r
-                    break;\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-        // A delimiter has been found so extract the latest query\r\r
-        if (nDelimIndex > -1) {\r\r
-            var nQueryStart = nDelimIndex + 1;\r\r
-            // Trim any white space from the beginning...\r\r
-            while(sQuery.charAt(nQueryStart) == " ") {\r\r
-                nQueryStart += 1;\r\r
-            }\r\r
-            // ...and save the rest of the string for later\r\r
-            this._sSavedQuery = sQuery.substring(0,nQueryStart);\r\r
-            // Here is the query itself\r\r
-            sQuery = sQuery.substr(nQueryStart);\r\r
-        }\r\r
-        else if(sQuery.indexOf(this._sSavedQuery) < 0){\r\r
-            this._sSavedQuery = null;\r\r
-        }\r\r
-    }\r\r
-\r\r
-    // Don't search queries that are too short\r\r
-    if (sQuery.length < this.minQueryLength) {\r\r
-        if (this._nDelayID != -1) {\r\r
-            clearTimeout(this._nDelayID);\r\r
-        }\r\r
-        this._clearList();\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    sQuery = encodeURIComponent(sQuery);\r\r
-    this._nDelayID = -1;    // Reset timeout ID because request has been made\r\r
-    this.dataRequestEvent.fire(this, sQuery);\r\r
-    this.dataSource.getResults(this._populateList, sQuery, this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Hides all visuals related to the array of &lt;li&gt; elements in the container.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._clearList = function() {\r\r
-    this._oContainer._oContent.scrollTop = 0;\r\r
-    var aItems = this._aListItems;\r\r
-\r\r
-    if(aItems && (aItems.length > 0)) {\r\r
-        for(var i = aItems.length-1; i >= 0 ; i--) {\r\r
-            aItems[i].style.display = "none";\r\r
-        }\r\r
-    }\r\r
-\r\r
-    if (this._oCurItem) {\r\r
-        this._toggleHighlight(this._oCurItem,"from");\r\r
-    }\r\r
-\r\r
-    this._oCurItem = null;\r\r
-    this._nDisplayedItems = 0;\r\r
-    this._sCurQuery = null;\r\r
-    this._toggleContainer(false);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Populates the array of &lt;li&gt; elements in the container with query\r\r
- * results. This method is passed to YAHOO.widget.DataSource#getResults as a\r\r
- * callback function so results from the datasource are returned to the\r\r
- * auto complete instance.\r\r
- *\r\r
- * @param {string} sQuery The query string\r\r
- * @param {object} aResults An array of query result objects from the data source\r\r
- * @param {string} oSelf The auto complete instance\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {\r\r
-    if(aResults === null) {\r\r
-        oSelf.dataErrorEvent.fire(oSelf, sQuery);\r\r
-    }\r\r
-    if (!oSelf._bFocused || !aResults) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);\r\r
-    var contentStyle = oSelf._oContainer._oContent.style;\r\r
-    contentStyle.width = (!isOpera) ? null : "";\r\r
-    contentStyle.height = (!isOpera) ? null : "";\r\r
-\r\r
-    var sCurQuery = decodeURIComponent(sQuery);\r\r
-    oSelf._sCurQuery = sCurQuery;\r\r
-    oSelf._bItemSelected = false;\r\r
-\r\r
-    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {\r\r
-        oSelf._initList();\r\r
-    }\r\r
-\r\r
-    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);\r\r
-    oSelf._nDisplayedItems = nItems;\r\r
-    if (nItems > 0) {\r\r
-        oSelf._initContainerHelpers();\r\r
-        var aItems = oSelf._aListItems;\r\r
-\r\r
-        // Fill items with data\r\r
-        for(var i = nItems-1; i >= 0; i--) {\r\r
-            var oItemi = aItems[i];\r\r
-            var oResultItemi = aResults[i];\r\r
-            oItemi.innerHTML = oSelf.formatResult(oResultItemi, sCurQuery);\r\r
-            oItemi.style.display = "list-item";\r\r
-            oItemi._sResultKey = oResultItemi[0];\r\r
-            oItemi._oResultData = oResultItemi;\r\r
-\r\r
-        }\r\r
-\r\r
-        // Empty out remaining items if any\r\r
-        for(var j = aItems.length-1; j >= nItems ; j--) {\r\r
-            var oItemj = aItems[j];\r\r
-            oItemj.innerHTML = null;\r\r
-            oItemj.style.display = "none";\r\r
-            oItemj._sResultKey = null;\r\r
-            oItemj._oResultData = null;\r\r
-        }\r\r
-\r\r
-        if(oSelf.autoHighlight) {\r\r
-            // Go to the first item\r\r
-            var oFirstItem = aItems[0];\r\r
-            oSelf._toggleHighlight(oFirstItem,"to");\r\r
-            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);\r\r
-            oSelf._typeAhead(oFirstItem,sQuery);\r\r
-        }\r\r
-        else {\r\r
-            oSelf._oCurItem = null;\r\r
-        }\r\r
-\r\r
-        // Expand the container\r\r
-        oSelf._toggleContainer(true);\r\r
-    }\r\r
-    else {\r\r
-        oSelf._clearList();\r\r
-    }\r\r
-    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);\r\r
-};\r\r
-\r\r
-/**\r\r
- * When YAHOO.widget.AutoComplete#bForceSelection is true and the user attempts\r\r
- * leave the text input box without selecting an item from the query results,\r\r
- * the user selection is cleared.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._clearSelection = function() {\r\r
-    var sValue = this._oTextbox.value;\r\r
-    var sChar = (this.delimChar) ? this.delimChar[0] : null;\r\r
-    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;\r\r
-    if(nIndex > -1) {\r\r
-        this._oTextbox.value = sValue.substring(0,nIndex);\r\r
-    }\r\r
-    else {\r\r
-         this._oTextbox.value = "";\r\r
-    }\r\r
-    this._sSavedQuery = this._oTextbox.value;\r\r
-\r\r
-    // Fire custom event\r\r
-    this.selectionEnforceEvent.fire(this);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Whether or not user-typed value in the text input box matches any of the\r\r
- * query results.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {\r\r
-    var foundMatch = false;\r\r
-\r\r
-    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {\r\r
-        var oItem = this._aListItems[i];\r\r
-        var sMatch = oItem._sResultKey.toLowerCase();\r\r
-        if (sMatch == this._sCurQuery.toLowerCase()) {\r\r
-            foundMatch = true;\r\r
-            break;\r\r
-        }\r\r
-    }\r\r
-    return(foundMatch);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Updates in the text input box with the first query result as the user types,\r\r
- * selecting the substring that the user has not typed.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; element item whose data populates the input field\r\r
- * @param {string} sQuery Query string\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r\r
-    // Don't update if turned off\r\r
-    if (!this.typeAhead) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var oTextbox = this._oTextbox;\r\r
-    var sValue = this._oTextbox.value; // any saved queries plus what user has typed\r\r
-\r\r
-    // Don't update with type-ahead if text selection is not supported\r\r
-    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    // Select the portion of text that the user has not typed\r\r
-    var nStart = sValue.length;\r\r
-    this._updateValue(oItem);\r\r
-    var nEnd = oTextbox.value.length;\r\r
-    this._selectText(oTextbox,nStart,nEnd);\r\r
-    var sPrefill = oTextbox.value.substr(nStart,nEnd);\r\r
-    this.typeAheadEvent.fire(this,sQuery,sPrefill);\r\r
-};\r\r
-\r\r
-/**\r\r
- * Selects text in a text input box.\r\r
- *\r\r
- * @param {object} oTextbox Text input box element in which to select text\r\r
- * @param {number} nStart Starting index of text string to select\r\r
- * @param {number} nEnd Ending index of text selection\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {\r\r
-    if (oTextbox.setSelectionRange) { // For Mozilla\r\r
-        oTextbox.setSelectionRange(nStart,nEnd);\r\r
-    }\r\r
-    else if (oTextbox.createTextRange) { // For IE\r\r
-        var oTextRange = oTextbox.createTextRange();\r\r
-        oTextRange.moveStart("character", nStart);\r\r
-        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);\r\r
-        oTextRange.select();\r\r
-    }\r\r
-    else {\r\r
-        oTextbox.select();\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Syncs auto complete container with its helpers.\r\r
- *\r\r
- * @param {boolean} bShow True if container is expanded, false if collapsed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {\r\r
-    var bFireEvent = false;\r\r
-    var width = this._oContainer._oContent.offsetWidth + "px";\r\r
-    var height = this._oContainer._oContent.offsetHeight + "px";\r\r
-\r\r
-    if(this.useIFrame && this._oContainer._oIFrame) {\r\r
-        bFireEvent = true;\r\r
-        if(this.alwaysShowContainer || bShow) {\r\r
-            this._oContainer._oIFrame.style.width = width;\r\r
-            this._oContainer._oIFrame.style.height = height;\r\r
-        }\r\r
-        else {\r\r
-            this._oContainer._oIFrame.style.width = 0;\r\r
-            this._oContainer._oIFrame.style.height = 0;\r\r
-        }\r\r
-    }\r\r
-    if(this.useShadow && this._oContainer._oShadow) {\r\r
-        bFireEvent = true;\r\r
-        if(this.alwaysShowContainer || bShow) {\r\r
-            this._oContainer._oShadow.style.width = width;\r\r
-            this._oContainer._oShadow.style.height = height;\r\r
-        }\r\r
-        else {\r\r
-           this._oContainer._oShadow.style.width = 0;\r\r
-            this._oContainer._oShadow.style.height = 0;\r\r
-        }\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Animates expansion or collapse of the container.\r\r
- *\r\r
- * @param {boolean} bShow True if container should be expanded, false if\r\r
- *                        container should be collapsed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {\r\r
-    // Implementer has container always open so don't mess with it\r\r
-    if(this.alwaysShowContainer) {\r\r
-        // Fire these events to give implementers a hook into the container\r\r
-        // being populated and being emptied\r\r
-        if(bShow) {\r\r
-            this.containerExpandEvent.fire(this);\r\r
-        }\r\r
-        else {\r\r
-            this.containerCollapseEvent.fire(this);\r\r
-        }\r\r
-        this._bContainerOpen = bShow;\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var oContainer = this._oContainer;\r\r
-    // Container is already closed\r\r
-    if (!bShow && !this._bContainerOpen) {\r\r
-        oContainer._oContent.style.display = "none";\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    // If animation is enabled...\r\r
-    var oAnim = this._oAnim;\r\r
-    if (oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {\r\r
-        // If helpers need to be collapsed, do it right away...\r\r
-        // but if helpers need to be expanded, wait until after the container expands\r\r
-        if(!bShow) {\r\r
-            this._toggleContainerHelpers(bShow);\r\r
-        }\r\r
-\r\r
-        if(oAnim.isAnimated()) {\r\r
-            oAnim.stop();\r\r
-        }\r\r
-\r\r
-        // Clone container to grab current size offscreen\r\r
-        var oClone = oContainer._oContent.cloneNode(true);\r\r
-        oContainer.appendChild(oClone);\r\r
-        oClone.style.top = "-9000px";\r\r
-        oClone.style.display = "block";\r\r
-\r\r
-        // Current size of the container is the EXPANDED size\r\r
-        var wExp = oClone.offsetWidth;\r\r
-        var hExp = oClone.offsetHeight;\r\r
-\r\r
-        // Calculate COLLAPSED sizes based on horiz and vert anim\r\r
-        var wColl = (this.animHoriz) ? 0 : wExp;\r\r
-        var hColl = (this.animVert) ? 0 : hExp;\r\r
-\r\r
-        // Set animation sizes\r\r
-        oAnim.attributes = (bShow) ?\r\r
-            {width: { to: wExp }, height: { to: hExp }} :\r\r
-            {width: { to: wColl}, height: { to: hColl }};\r\r
-\r\r
-        // If opening anew, set to a collapsed size...\r\r
-        if(bShow && !this._bContainerOpen) {\r\r
-            oContainer._oContent.style.width = wColl+"px";\r\r
-            oContainer._oContent.style.height = hColl+"px";\r\r
-        }\r\r
-        // Else, set it to its last known size.\r\r
-        else {\r\r
-            oContainer._oContent.style.width = wExp+"px";\r\r
-            oContainer._oContent.style.height = hExp+"px";\r\r
-        }\r\r
-\r\r
-        oContainer.removeChild(oClone);\r\r
-        oClone = null;\r\r
-\r\r
-       var oSelf = this;\r\r
-       var onAnimComplete = function() {\r\r
-            // Finish the collapse\r\r
-               oAnim.onComplete.unsubscribeAll();\r\r
-\r\r
-            if(bShow) {\r\r
-                oSelf.containerExpandEvent.fire(oSelf);\r\r
-            }\r\r
-            else {\r\r
-                oContainer._oContent.style.display = "none";\r\r
-                oSelf.containerCollapseEvent.fire(oSelf);\r\r
-            }\r\r
-            oSelf._toggleContainerHelpers(bShow);\r\r
-       };\r\r
-\r\r
-        // Display container and animate it\r\r
-        oContainer._oContent.style.display = "block";\r\r
-        oAnim.onComplete.subscribe(onAnimComplete);\r\r
-        oAnim.animate();\r\r
-        this._bContainerOpen = bShow;\r\r
-    }\r\r
-    // Else don't animate, just show or hide\r\r
-    else {\r\r
-        if(bShow) {\r\r
-            oContainer._oContent.style.display = "block";\r\r
-            this.containerExpandEvent.fire(this);\r\r
-        }\r\r
-        else {\r\r
-            oContainer._oContent.style.display = "none";\r\r
-            this.containerCollapseEvent.fire(this);\r\r
-        }\r\r
-        this._toggleContainerHelpers(bShow);\r\r
-        this._bContainerOpen = bShow;\r\r
-   }\r\r
-\r\r
-};\r\r
-\r\r
-/**\r\r
- * Toggles the highlight on or off for an item in the container, and also cleans\r\r
- * up highlighting of any previous item.\r\r
- *\r\r
- * @param {object} oNewItem New The &lt;li&gt; element item to receive highlight\r\r
- *                              behavior\r\r
- * @param {string} sType "mouseover" will toggle highlight on, and "mouseout"\r\r
- *                       will toggle highlight off.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {\r\r
-    var sHighlight = this.highlightClassName;\r\r
-    if(this._oCurItem) {\r\r
-        // Remove highlight from old item\r\r
-        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);\r\r
-    }\r\r
-\r\r
-    if((sType == "to") && sHighlight) {\r\r
-        // Apply highlight to new item\r\r
-        YAHOO.util.Dom.addClass(oNewItem, sHighlight);\r\r
-        this._oCurItem = oNewItem;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Toggles the pre-highlight on or off for an item in the container.\r\r
- *\r\r
- * @param {object} oNewItem New The &lt;li&gt; element item to receive highlight\r\r
- *                              behavior\r\r
- * @param {string} sType "mouseover" will toggle highlight on, and "mouseout"\r\r
- *                       will toggle highlight off.\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {\r\r
-    if(oNewItem == this._oCurItem) {\r\r
-        return;\r\r
-    }\r\r
-\r\r
-    var sPrehighlight = this.prehighlightClassName;\r\r
-    if((sType == "mouseover") && sPrehighlight) {\r\r
-        // Apply prehighlight to new item\r\r
-        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);\r\r
-    }\r\r
-    else {\r\r
-        // Remove prehighlight from old item\r\r
-        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Updates the text input box value with selected query result. If a delimiter\r\r
- * has been defined, then the value gets appended with the delimiter.\r\r
- *\r\r
- * @param {object} oItem The &lt;li&gt; element item with which to update the value\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._updateValue = function(oItem) {\r\r
-    var oTextbox = this._oTextbox;\r\r
-    var sDelimChar = (this.delimChar) ? this.delimChar[0] : null;\r\r
-    var sSavedQuery = this._sSavedQuery;\r\r
-    var sResultKey = oItem._sResultKey;\r\r
-    oTextbox.focus();\r\r
-\r\r
-    // First clear text field\r\r
-    oTextbox.value = "";\r\r
-    // Grab data to put into text field\r\r
-    if(sDelimChar) {\r\r
-        if(sSavedQuery) {\r\r
-            oTextbox.value = sSavedQuery;\r\r
-        }\r\r
-        oTextbox.value += sResultKey + sDelimChar;\r\r
-        if(sDelimChar != " ") {\r\r
-            oTextbox.value += " ";\r\r
-        }\r\r
-    }\r\r
-    else { oTextbox.value = sResultKey; }\r\r
-\r\r
-    // scroll to bottom of textarea if necessary\r\r
-    if(oTextbox.type == "textarea") {\r\r
-        oTextbox.scrollTop = oTextbox.scrollHeight;\r\r
-    }\r\r
-\r\r
-    // move cursor to end\r\r
-    var end = oTextbox.value.length;\r\r
-    this._selectText(oTextbox,end,end);\r\r
-\r\r
-    this._oCurItem = oItem;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Selects a result item from the container\r\r
- *\r\r
- * @param {object} oItem The selected &lt;li&gt; element item\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._selectItem = function(oItem) {\r\r
-    this._bItemSelected = true;\r\r
-    this._updateValue(oItem);\r\r
-    this.itemSelectEvent.fire(this, oItem, oItem._oResultData);\r\r
-    this._clearList();\r\r
-};\r\r
-\r\r
-/**\r\r
- * For values updated by type-ahead, the right arrow key jumps to the end\r\r
- * of the textbox, otherwise the container is closed.\r\r
- *\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {\r\r
-    if(!this.typeAhead) {\r\r
-        return;\r\r
-    }\r\r
-    else {\r\r
-        this._clearList();\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Triggered by up and down arrow keys, changes the current highlighted\r\r
- * &lt;li&gt; element item. Scrolls container if necessary.\r\r
- *\r\r
- * @param {number} nKeyCode Code of key pressed\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {\r\r
-    if(this._bContainerOpen) {\r\r
-        // Determine current item's id number\r\r
-        var oCurItem = this._oCurItem;\r\r
-        var nCurItemIndex = -1;\r\r
-\r\r
-        if (oCurItem) {\r\r
-            nCurItemIndex = oCurItem._nItemIndex;\r\r
-        }\r\r
-\r\r
-        var nNewItemIndex = (nKeyCode == 40) ?\r\r
-                (nCurItemIndex + 1) : (nCurItemIndex - 1);\r\r
-\r\r
-        // Out of bounds\r\r
-        if (nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        if (oCurItem) {\r\r
-            // Unhighlight current item\r\r
-            this._toggleHighlight(oCurItem, "from");\r\r
-            this.itemArrowFromEvent.fire(this, oCurItem);\r\r
-        }\r\r
-        if (nNewItemIndex == -1) {\r\r
-           // Go back to query (remove type-ahead string)\r\r
-            if(this.delimChar && this._sSavedQuery) {\r\r
-                if (!this._textMatchesOption()) {\r\r
-                    this._oTextbox.value = this._sSavedQuery;\r\r
-                }\r\r
-                else {\r\r
-                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;\r\r
-                }\r\r
-            }\r\r
-            else {\r\r
-                this._oTextbox.value = this._sCurQuery;\r\r
-            }\r\r
-            this._oCurItem = null;\r\r
-            return;\r\r
-        }\r\r
-        if (nNewItemIndex == -2) {\r\r
-            // Close container\r\r
-            this._clearList();\r\r
-            return;\r\r
-        }\r\r
-\r\r
-        var oNewItem = this._aListItems[nNewItemIndex];\r\r
-\r\r
-        // Scroll the container if necessary\r\r
-        if((YAHOO.util.Dom.getStyle(this._oContainer._oContent,"overflow") == "auto") &&\r\r
-        (nNewItemIndex > -1) && (nNewItemIndex < this._nDisplayedItems)) {\r\r
-            // User is keying down\r\r
-            if(nKeyCode == 40) {\r\r
-                // Bottom of selected item is below scroll area...\r\r
-                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (this._oContainer._oContent.scrollTop + this._oContainer._oContent.offsetHeight)) {\r\r
-                    // Set bottom of scroll area to bottom of selected item\r\r
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - this._oContainer._oContent.offsetHeight;\r\r
-                }\r\r
-                // Bottom of selected item is above scroll area...\r\r
-                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < this._oContainer._oContent.scrollTop) {\r\r
-                    // Set top of selected item to top of scroll area\r\r
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r\r
-\r\r
-                }\r\r
-            }\r\r
-            // User is keying up\r\r
-            else {\r\r
-                // Top of selected item is above scroll area\r\r
-                if(oNewItem.offsetTop < this._oContainer._oContent.scrollTop) {\r\r
-                    // Set top of scroll area to top of selected item\r\r
-                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;\r\r
-                }\r\r
-                // Top of selected item is below scroll area\r\r
-                else if(oNewItem.offsetTop > (this._oContainer._oContent.scrollTop + this._oContainer._oContent.offsetHeight)) {\r\r
-                    // Set bottom of selected item to bottom of scroll area\r\r
-                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - this._oContainer._oContent.offsetHeight;\r\r
-                }\r\r
-            }\r\r
-        }\r\r
-\r\r
-        this._toggleHighlight(oNewItem, "to");\r\r
-        this.itemArrowToEvent.fire(this, oNewItem);\r\r
-        if(this.typeAhead) {\r\r
-            this._updateValue(oNewItem);\r\r
-        }\r\r
-    }\r\r
-};\r\r
-\r\r
-/****************************************************************************/\r\r
-/****************************************************************************/\r\r
-/****************************************************************************/\r\r
-\r\r
-/**\r\r
- * Class providing encapsulation of a data source. \r\r
+ * The DataSource classes manages sending a request and returning response from a live\r\r
+ * database. Supported data include local JavaScript arrays and objects and databases\r\r
+ * accessible via XHR connections. Supported response formats include JavaScript arrays,\r\r
+ * JSON, XML, and flat-file textual data.\r\r
  *  \r\r
+ * @class DataSource\r\r
  * @constructor\r\r
- *\r\r
  */\r\r
 YAHOO.widget.DataSource = function() { \r\r
     /* abstract class */\r\r
 };\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public constants\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public constants\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Error message for null data responses.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATANULL\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype.ERROR_DATANULL = "Response data was null";\r\r
+YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";\r\r
 \r\r
 /**\r\r
  * Error message for data responses with parsing errors.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATAPARSE\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype.ERROR_DATAPARSE = "Response data could not be parsed";\r\r
+YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Max size of the local cache.  Set to 0 to turn off caching.  Caching is\r\r
  * useful to reduce the number of server connections.  Recommended only for data\r\r
  * sources that return comprehensive results for queries or when stale data is\r\r
- * not an issue. Default: 15.\r\r
+ * not an issue.\r\r
  *\r\r
- * @type number\r\r
+ * @property maxCacheEntries\r\r
+ * @type Number\r\r
+ * @default 15\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;\r\r
 \r\r
@@ -1850,50 +2070,52 @@ YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;
  * data source. If caching is on and queryMatchContains is true, the cache\r\r
  * returns results that "contain" the query string. By default,\r\r
  * queryMatchContains is set to false, meaning the cache only returns results\r\r
- * that "start with" the query string. Default: false.\r\r
+ * that "start with" the query string.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property queryMatchContains\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchContains = false;\r\r
 \r\r
 /**\r\r
- * Data source query subset matching. If caching is on and queryMatchSubset is\r\r
+ * Enables query subset matching. If caching is on and queryMatchSubset is\r\r
  * true, substrings of queries will return matching cached results. For\r\r
  * instance, if the first query is for "abc" susequent queries that start with\r\r
  * "abc", like "abcd", will be queried against the cache, and not the live data\r\r
- * source. Recommended only for data sources that return comprehensive results\r\r
- * for queries with very few characters. Default: false.\r\r
+ * source. Recommended only for DataSources that return comprehensive results\r\r
+ * for queries with very few characters.\r\r
+ *\r\r
+ * @property queryMatchSubset\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  *\r\r
- * @type boolean\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchSubset = false;\r\r
 \r\r
 /**\r\r
- * Data source query case-sensitivity matching. If caching is on and\r\r
+ * Enables query case-sensitivity matching. If caching is on and\r\r
  * queryMatchCase is true, queries will only return results for case-sensitive\r\r
- * matches. Default: false.\r\r
+ * matches.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property queryMatchCase\r\r
+ * @type Boolean\r\r
+ * @default false\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryMatchCase = false;\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
- /**\r\r
- * Public accessor to the unique name of the data source instance.\r\r
- *\r\r
- * @return {string} Unique name of the data source instance\r\r
- */\r\r
-YAHOO.widget.DataSource.prototype.getName = function() {\r\r
-    return this._sName;\r\r
-};\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
  /**\r\r
- * Public accessor to the unique name of the data source instance.\r\r
+ * Public accessor to the unique name of the DataSource instance.\r\r
  *\r\r
- * @return {string} Unique name of the data source instance\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the DataSource instance\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.toString = function() {\r\r
     return "DataSource " + this._sName;\r\r
@@ -1903,10 +2125,10 @@ YAHOO.widget.DataSource.prototype.toString = function() {
  * Retrieves query results, first checking the local cache, then making the\r\r
  * query request to the live data source as defined by the function doQuery.\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to\r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method getResults\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r\r
     \r\r
@@ -1925,10 +2147,10 @@ YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oPa
  * source. Must call the callback function with the response returned from the\r\r
  * query. Populates cache (if enabled).\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function implemented by oParent to\r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
     /* override this */ \r\r
@@ -1936,6 +2158,8 @@ YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParen
 \r\r
 /**\r\r
  * Flushes cache.\r\r
+ *\r\r
+ * @method flushCache\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.flushCache = function() {\r\r
     if(this._aCache) {\r\r
@@ -1947,79 +2171,94 @@ YAHOO.widget.DataSource.prototype.flushCache = function() {
     this.cacheFlushEvent.fire(this);\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public events\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Fired when a query is made to the live data source. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
+ * Fired when a query is made to the live data source.\r\r
+ *\r\r
+ * @event queryEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.queryEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when a query is made to the local cache. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
+ * Fired when a query is made to the local cache.\r\r
+ *\r\r
+ * @event cacheQueryEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when data is retrieved from the live data source. Subscribers receive\r\r
- * the following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Array of result objects\r\r
+ * Fired when data is retrieved from the live data source.\r\r
+ *\r\r
+ * @event getResultsEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param aResults {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r\r
     \r\r
 /**\r\r
- * Fired when data is retrieved from the local cache. Subscribers receive the\r\r
- * following array :<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Array of result objects\r\r
+ * Fired when data is retrieved from the local cache.\r\r
+ *\r\r
+ * @event getCachedResultsEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param aResults {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when an error is encountered with the live data source. Subscribers\r\r
- * receive the following array:<br>\r\r
- *     - args[0] The data source instance\r\r
- *     - args[1] The requesting object\r\r
- *     - args[2] The query string\r\r
- *     - args[3] Error message string\r\r
+ * Fired when an error is encountered with the live data source.\r\r
+ *\r\r
+ * @event dataErrorEvent\r\r
+ * @param oSelf {Object} The DataSource instance.\r\r
+ * @param oParent {Object} The requesting object.\r\r
+ * @param sQuery {String} The query string.\r\r
+ * @param sMsg {String} Error message string\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.dataErrorEvent = null;\r\r
 \r\r
 /**\r\r
- * Fired when the local cache is flushed. Subscribers receive the following\r\r
- * array :<br>\r\r
- *     - args[0] The data source instance\r\r
+ * Fired when the local cache is flushed.\r\r
+ *\r\r
+ * @event cacheFlushEvent\r\r
+ * @param oSelf {Object} The DataSource instance\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;\r\r
 \r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Internal class variable to index multiple data source instances.\r\r
+ * Internal class variable to index multiple DataSource instances.\r\r
  *\r\r
- * @type number\r\r
+ * @property _nIndex\r\r
+ * @type Number\r\r
  * @private\r\r
+ * @static\r\r
  */\r\r
 YAHOO.widget.DataSource._nIndex = 0;\r\r
 \r\r
 /**\r\r
- * Name of data source instance.\r\r
+ * Name of DataSource instance.\r\r
  *\r\r
- * @type string\r\r
+ * @property _sName\r\r
+ * @type String\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._sName = null;\r\r
@@ -2027,18 +2266,23 @@ YAHOO.widget.DataSource.prototype._sName = null;
 /**\r\r
  * Local cache of data result objects indexed chronologically.\r\r
  *\r\r
- * @type array\r\r
+ * @property _aCache\r\r
+ * @type Object[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._aCache = null;\r\r
 \r\r
 \r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Initializes data source instance.\r\r
+ * Initializes DataSource instance.\r\r
  *  \r\r
+ * @method _init\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._init = function() {\r\r
@@ -2068,14 +2312,14 @@ YAHOO.widget.DataSource.prototype._init = function() {
  * cache is full. Newer items will have higher indexes, the oldest item will have\r\r
  * index of 0. \r\r
  *\r\r
- * @param {object} resultObj  Object literal of data results, including internal\r\r
- *                            properties and an array of result objects\r\r
+ * @method _addCacheElem\r\r
+ * @param oResult {Object} Data result object, including array of results.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {\r\r
+YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {\r\r
     var aCache = this._aCache;\r\r
     // Don't add if anything important is missing.\r\r
-    if(!aCache || !resultObj || !resultObj.query || !resultObj.results) {\r\r
+    if(!aCache || !oResult || !oResult.query || !oResult.results) {\r\r
         return;\r\r
     }\r\r
     \r\r
@@ -2085,7 +2329,7 @@ YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {
     }\r\r
         \r\r
     // Add to cache, at the end of the array\r\r
-    aCache.push(resultObj);\r\r
+    aCache.push(oResult);\r\r
 };\r\r
 \r\r
 /**\r\r
@@ -2093,12 +2337,11 @@ YAHOO.widget.DataSource.prototype._addCacheElem = function(resultObj) {
  * function is called with the results, and the cached is refreshed so that it\r\r
  * is now the newest element.  \r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
- * @return {array} aResults Result object from local cache if found, otherwise \r\r
- *                          null\r\r
+ * @method _doQueryCache\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
+ * @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r\r
  * @private \r\r
  */\r\r
 YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r\r
@@ -2123,7 +2366,7 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
             var aAllResultItems = resultObj.results;\r\r
             // If case is unimportant, normalize match key for comparison\r\r
             var matchKey = (!this.queryMatchCase) ?\r\r
-                encodeURIComponent(resultObj.query.toLowerCase()):\r\r
+                encodeURIComponent(resultObj.query).toLowerCase():\r\r
                 encodeURIComponent(resultObj.query);\r\r
             \r\r
             // If a cached match key exactly matches the query...\r\r
@@ -2200,14 +2443,15 @@ YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery,
 /**\r\r
  * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r\r
  * query results.\r\r
- * requires YAHOO.util.Connect XMLHTTPRequest library\r\r
- * extends YAHOO.widget.DataSource\r\r
  *  \r\r
+ * @class DS_XHR\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @requires connection\r\r
  * @constructor\r\r
- * @param {string} sScriptURI Absolute or relative URI to script that returns \r\r
- *                            query results as JSON, XML, or delimited flat data\r\r
- * @param {array} aSchema Data schema definition of results\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @param sScriptURI {String} Absolute or relative URI to script that returns query\r\r
+ * results as JSON, XML, or delimited flat-file data.\r\r
+ * @param aSchema {String[]} Data schema definition of results.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2230,71 +2474,95 @@ YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {
 \r\r
 YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public constants\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public constants\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * JSON data type\r\r
+ * JSON data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_JSON\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_JSON = 0;\r\r
+YAHOO.widget.DS_XHR.TYPE_JSON = 0;\r\r
 \r\r
 /**\r\r
- * XML data type\r\r
+ * XML data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_XML\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_XML = 1;\r\r
+YAHOO.widget.DS_XHR.TYPE_XML = 1;\r\r
 \r\r
 /**\r\r
- * Flat file data type\r\r
+ * Flat-file data type.\r\r
  *\r\r
- * @type constant\r\r
+ * @property TYPE_FLAT\r\r
+ * @type Number\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.TYPE_FLAT = 2;\r\r
+YAHOO.widget.DS_XHR.TYPE_FLAT = 2;\r\r
 \r\r
 /**\r\r
  * Error message for XHR failure.\r\r
  *\r\r
- * @type constant\r\r
+ * @property ERROR_DATAXHR\r\r
+ * @type String\r\r
+ * @static\r\r
  * @final\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR = "XHR response failed";\r\r
+YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Alias to YUI Connection Manager. Allows implementers to specify their own\r\r
+ * subclasses of the YUI Connection Manager utility.\r\r
+ *\r\r
+ * @property connMgr\r\r
+ * @type Object\r\r
+ * @default YAHOO.util.Connect\r\r
+ */\r\r
+YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Number of milliseconds the XHR connection will wait for a server response. A\r\r
  * a value of zero indicates the XHR connection will wait forever. Any value\r\r
  * greater than zero will use the Connection utility's Auto-Abort feature.\r\r
- * Default: 0.\r\r
  *\r\r
- * @type number\r\r
+ * @property connTimeout\r\r
+ * @type Number\r\r
+ * @default 0\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.connTimeout = 0;\r\r
 \r\r
-\r\r
 /**\r\r
  * Absolute or relative URI to script that returns query results. For instance,\r\r
- * queries will be sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput\r\r
+ * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptURI\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptURI = null;\r\r
 \r\r
 /**\r\r
  * Query string parameter name sent to scriptURI. For instance, queries will be\r\r
- * sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput\r\r
- * Default: "query".\r\r
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptQueryParam\r\r
+ * @type String\r\r
+ * @default "query"\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";\r\r
 \r\r
@@ -2302,44 +2570,52 @@ YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";
  * String of key/value pairs to append to requests made to scriptURI. Define\r\r
  * this string when you want to send additional query parameters to your script.\r\r
  * When defined, queries will be sent to\r\r
- *   <scriptURI>?<scriptQueryParam>=userinput&<scriptQueryAppend>\r\r
- * Default: "".\r\r
+ * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;\r\r
  *\r\r
- * @type string\r\r
+ * @property scriptQueryAppend\r\r
+ * @type String\r\r
+ * @default ""\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";\r\r
 \r\r
 /**\r\r
- * XHR response data type. Other types that may be defined are TYPE_XML and\r\r
- * TYPE_FLAT. Default: TYPE_JSON.\r\r
+ * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML\r\r
+ * and YAHOO.widget.DS_XHR.TYPE_FLAT.\r\r
  *\r\r
- * @type type\r\r
+ * @property responseType\r\r
+ * @type String\r\r
+ * @default YAHOO.widget.DS_XHR.TYPE_JSON\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.prototype.TYPE_JSON;\r\r
+YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;\r\r
 \r\r
 /**\r\r
  * String after which to strip results. If the results from the XHR are sent\r\r
  * back as HTML, the gzip HTML comment appears at the end of the data and should\r\r
- * be ignored.  Default: "\n&lt;!--"\r\r
+ * be ignored.\r\r
  *\r\r
- * @type string\r\r
+ * @property responseStripAfter\r\r
+ * @type String\r\r
+ * @default "\n&#60;!-"\r\r
  */\r\r
-YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!--";\r\r
+YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Queries the live data source defined by scriptURI for results. Results are\r\r
  * passed back to a callback function.\r\r
  *  \r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
-    var isXML = (this.responseType == this.TYPE_XML);\r\r
+    var isXML = (this.responseType == YAHOO.widget.DS_XHR.TYPE_XML);\r\r
     var sUri = this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;\r\r
     if(this.scriptQueryAppend.length > 0) {\r\r
         sUri += "&" + this.scriptQueryAppend;\r\r
@@ -2347,7 +2623,7 @@ YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
     var oResponse = null;\r\r
     \r\r
     var oSelf = this;\r\r
-    /**\r\r
+    /*\r\r
      * Sets up ajax request callback\r\r
      *\r\r
      * @param {object} oReq          HTTPXMLRequest object\r\r
@@ -2356,7 +2632,7 @@ YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
     var responseSuccess = function(oResp) {\r\r
         // Response ID does not match last made request ID.\r\r
         if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATANULL);\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
             return;\r\r
         }\r\r
 //DEBUG\r\r
@@ -2369,7 +2645,7 @@ for(var foo in oResp) {
             oResp = oResp.responseXML;\r\r
         }\r\r
         if(oResp === null) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATANULL);\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
             return;\r\r
         }\r\r
 \r\r
@@ -2378,18 +2654,18 @@ for(var foo in oResp) {
         resultObj.query = decodeURIComponent(sQuery);\r\r
         resultObj.results = aResults;\r\r
         if(aResults === null) {\r\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATAPARSE);\r\r
-            return;\r\r
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);\r\r
+            aResults = [];\r\r
         }\r\r
         else {\r\r
             oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);\r\r
             oSelf._addCacheElem(resultObj);\r\r
-            oCallbackFn(sQuery, aResults, oParent);\r\r
         }\r\r
+        oCallbackFn(sQuery, aResults, oParent);\r\r
     };\r\r
 \r\r
     var responseFailure = function(oResp) {\r\r
-        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, oSelf.ERROR_DATAXHR);\r\r
+        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);\r\r
         return;\r\r
     };\r\r
     \r\r
@@ -2403,20 +2679,21 @@ for(var foo in oResp) {
     }\r\r
     \r\r
     if(this._oConn) {\r\r
-        YAHOO.util.Connect.abort(this._oConn);\r\r
+        this.connMgr.abort(this._oConn);\r\r
     }\r\r
     \r\r
-    oSelf._oConn = YAHOO.util.Connect.asyncRequest("GET", sUri, oCallback, null);\r\r
+    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r\r
 };\r\r
 \r\r
 /**\r\r
  * Parses raw response data into an array of result objects. The result data key\r\r
  * is always stashed in the [0] element of each result object. \r\r
  *\r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oResponse The raw response data to parse\r\r
- * @param {object} oParent The object instance that has requested data\r\r
- * @returns {array} Array of result objects\r\r
+ * @method parseResponse\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oResponse {Object} The raw response data to parse.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
+ * @returns {Object[]} Array of result objects.\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {\r\r
     var aSchema = this.schema;\r\r
@@ -2431,7 +2708,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     }\r\r
 \r\r
     switch (this.responseType) {\r\r
-        case this.TYPE_JSON:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_JSON:\r\r
             var jsonList;\r\r
             // Divert KHTML clients from JSON lib\r\r
             if(window.JSON && (navigator.userAgent.toLowerCase().indexOf('khtml')== -1)) {\r\r
@@ -2442,8 +2719,14 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                     break;\r\r
                 }\r\r
                 else {\r\r
-                    // eval is necessary here since aSchema[0] is of unknown depth\r\r
-                    jsonList = eval("jsonObjParsed." + aSchema[0]);\r\r
+                    try {\r\r
+                        // eval is necessary here since aSchema[0] is of unknown depth\r\r
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);\r\r
+                    }\r\r
+                    catch(e) {\r\r
+                        bError = true;\r\r
+                        break;\r\r
+                   }\r\r
                 }\r\r
             }\r\r
             else {\r\r
@@ -2488,6 +2771,10 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                 break;\r\r
             }\r\r
 \r\r
+            if(jsonList.constructor != Array) {\r\r
+                jsonList = [jsonList];\r\r
+            }\r\r
+            \r\r
             // Loop through the array of all responses...\r\r
             for(var i = jsonList.length-1; i >= 0 ; i--) {\r\r
                 var aResultItem = [];\r\r
@@ -2501,11 +2788,15 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                     }\r\r
                     aResultItem.unshift(dataFieldValue);\r\r
                 }\r\r
+                // If schema isn't well defined, pass along the entire result object\r\r
+                if(aResultItem.length == 1) {\r\r
+                    aResultItem.push(jsonResult);\r\r
+                }\r\r
                 // Capture the array of data field values in an array of results\r\r
                 aResults.unshift(aResultItem);\r\r
             }\r\r
             break;\r\r
-        case this.TYPE_XML:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_XML:\r\r
             // Get the collection of results\r\r
             var xmlList = oResponse.getElementsByTagName(aSchema[0]);\r\r
             if(!xmlList) {\r\r
@@ -2541,7 +2832,7 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
                 aResults.unshift(aFieldSet);\r\r
             }\r\r
             break;\r\r
-        case this.TYPE_FLAT:\r\r
+        case YAHOO.widget.DS_XHR.TYPE_FLAT:\r\r
             if(oResponse.length > 0) {\r\r
                 // Delete the last line delimiter at the end of the data if it exists\r\r
                 var newLength = oResponse.length-aSchema[0].length;\r\r
@@ -2568,14 +2859,17 @@ YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParen
     }\r\r
 };            \r\r
 \r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Private member variables\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * XHR connection object.\r\r
  *\r\r
- * @type object\r\r
+ * @property _oConn\r\r
+ * @type Object\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.DS_XHR.prototype._oConn = null;\r\r
@@ -2586,15 +2880,14 @@ YAHOO.widget.DS_XHR.prototype._oConn = null;
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript struct as\r\r
+ * Implementation of YAHOO.widget.DataSource using a native Javascript function as\r\r
  * its live data source.\r\r
  *  \r\r
+ * @class DS_JSFunction\r\r
  * @constructor\r\r
- * extends YAHOO.widget.DataSource \r\r
- *  \r\r
- * @param {string} oFunction In-memory Javascript function that returns query\r\r
- *                           results as an array of objects\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @param oFunction {String} In-memory Javascript function that returns query results as an array of objects.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2616,28 +2909,34 @@ YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {
 \r\r
 YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * In-memory Javascript function that returns query results.\r\r
  *\r\r
- * @type function\r\r
+ * @property dataFunction\r\r
+ * @type HTMLFunction\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;\r\r
 \r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
 /**\r\r
  * Queries the live data source defined by function for results. Results are\r\r
  * passed back to a callback function.\r\r
  *  \r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to \r\r
- *                             which to return results \r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
     var oFunction = this.dataFunction;\r\r
@@ -2645,7 +2944,7 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
     \r\r
     aResults = oFunction(sQuery);\r\r
     if(aResults === null) {\r\r
-        this.dataErrorEvent.fire(this, oParent, sQuery, this.ERROR_DATANULL);\r\r
+        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
         return;\r\r
     }\r\r
     \r\r
@@ -2667,11 +2966,11 @@ YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oPa
  * Implementation of YAHOO.widget.DataSource using a native Javascript array as\r\r
  * its live data source.\r\r
  *\r\r
+ * @class DS_JSArray\r\r
  * @constructor\r\r
- * extends YAHOO.widget.DataSource\r\r
- *\r\r
- * @param {string} aData In-memory Javascript array of simple string data\r\r
- * @param {object} oConfigs Optional object literal of config params\r\r
+ * @extends YAHOO.widget.DataSource\r\r
+ * @param aData {String[]} In-memory Javascript array of simple string data.\r\r
+ * @param oConfigs {Object} (optional) Object literal of config params.\r\r
  */\r\r
 YAHOO.widget.DS_JSArray = function(aData, oConfigs) {\r\r
     // Set any config params passed in to override defaults\r\r
@@ -2693,57 +2992,72 @@ YAHOO.widget.DS_JSArray = function(aData, oConfigs) {
 \r\r
 YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();\r\r
 \r\r
-/***************************************************************************\r\r
- * Public member variables\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * In-memory Javascript array of strings.\r\r
  *\r\r
- * @type array\r\r
+ * @property data\r\r
+ * @type Array\r\r
  */\r\r
 YAHOO.widget.DS_JSArray.prototype.data = null;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Queries the live data source defined by data for results. Results are passed\r\r
  * back to a callback function.\r\r
  *\r\r
- * @param {object} oCallbackFn Callback function defined by oParent object to\r\r
- *                             which to return results\r\r
- * @param {string} sQuery Query string\r\r
- * @param {object} oParent The object instance that has requested data\r\r
+ * @method doQuery\r\r
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
+ * @param sQuery {String} Query string.\r\r
+ * @param oParent {Object} The object instance that has requested data.\r\r
  */\r\r
 YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
-    var aData = this.data;\r\r
-    var aResults = [];\r\r
+    var aData = this.data; // the array\r\r
+    var aResults = []; // container for results\r\r
     var bMatchFound = false;\r\r
     var bMatchContains = this.queryMatchContains;\r\r
-    if(!this.queryMatchCase) {\r\r
-        sQuery = sQuery.toLowerCase();\r\r
-    }\r\r
-\r\r
-    // Loop through each element of the array...\r\r
-    for(var i = aData.length-1; i >= 0; i--) {\r\r
-        var aDataset = [];\r\r
-        if(typeof aData[i] == "string") {\r\r
-            aDataset[0] = aData[i];\r\r
-        }\r\r
-        else {\r\r
-            aDataset = aData[i];\r\r
+    if(sQuery) {\r\r
+        if(!this.queryMatchCase) {\r\r
+            sQuery = sQuery.toLowerCase();\r\r
         }\r\r
 \r\r
-        var sKeyIndex = (this.queryMatchCase) ?\r\r
-            encodeURIComponent(aDataset[0]).indexOf(sQuery):\r\r
-            encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r\r
+        // Loop through each element of the array...\r\r
+        // which can be a string or an array of strings\r\r
+        for(var i = aData.length-1; i >= 0; i--) {\r\r
+            var aDataset = [];\r\r
+\r\r
+            if(aData[i]) {\r\r
+                if(aData[i].constructor == String) {\r\r
+                    aDataset[0] = aData[i];\r\r
+                }\r\r
+                else if(aData[i].constructor == Array) {\r\r
+                    aDataset = aData[i];\r\r
+                }\r\r
+            }\r\r
 \r\r
-        // A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
-        if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
-        // A CONTAINS match is when the query is found anywhere within the key string...\r\r
-        (bMatchContains && (sKeyIndex > -1))) {\r\r
-            // Stash a match into aResults[].\r\r
-            aResults.unshift(aDataset);\r\r
+            if(aDataset[0] && (aDataset[0].constructor == String)) {\r\r
+                var sKeyIndex = (this.queryMatchCase) ?\r\r
+                encodeURIComponent(aDataset[0]).indexOf(sQuery):\r\r
+                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r\r
+\r\r
+                // A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
+                if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
+                // A CONTAINS match is when the query is found anywhere within the key string...\r\r
+                (bMatchContains && (sKeyIndex > -1))) {\r\r
+                    // Stash a match into aResults[].\r\r
+                    aResults.unshift(aDataset);\r\r
+                }\r\r
+            }\r\r
         }\r\r
     }\r\r
 \r\r
index 73d1c53f07298eefdc3e50a15ad4c1c80d75220f..de02c14a02299906356d7361afd2e4aa383411c5 100755 (executable)
 Calendar Release Notes\r
 \r
+*** version 0.12 ***\r
+\r
+       - New documentation format implemented\r
+       - Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone\r
+       represents the single Calendar instance, and CalendarGroup represents an\r
+       n-up instance, defaulting to 2up\r
+       - Added semantic style classes to Calendar elements to allow for custom\r
+       styling solely using CSS.\r
+       - Remapped all configuration properties to use the Config object\r
+       (familiar to those who use the Container collection of controls).\r
+       Property names are the same as their previous counterparts, but wrapped\r
+       into Calendar.cfg, allowing for runtime reconfiguration of most\r
+       properties.\r
+       - Added "title" property for setting the Calendar title\r
+       - Added "close" property for enabling and disabling the close icon\r
+       - Added "iframe" property for enabling an iframe shim in Internet\r
+       Explorer 6 and below to fix the select bleed-through bug\r
+       - pageDate moved to property:  "pagedate"\r
+       - selectedDates moved to property:  "selected"\r
+       - minDate moved to property : "mindate", which accepts a JavaScript Date\r
+       object like its predecessor, but also supports string dates\r
+       - maxDate moved to property : "maxdate", which accepts a JavaScript Date\r
+       object like its predecessor, but also supports string dates\r
+       - Moved style declarations to initStyles function\r
+       - Optimized event handling in\r
+       doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the\r
+       listener to the outer Calendar container, and only reacting to events on\r
+       cells with the "selectable" CSS class.\r
+       - Added domEventMap field for applying DOM event listeners to cells\r
+       containing specific class and tag combinations.\r
+       - Moved all cell DOM event attachment to applyListeners function\r
+       - Added getDateByCellId / getDateFieldsByCellId helper functions\r
+       - Corrected DateMath.getWeekNumber to comply with ISO week number\r
+       handling\r
+       - Separated renderCellDefault style portions into styleCellDefault\r
+       function for easy extension\r
+       - Deprecated onBeforeSelect. Created beforeSelectEvent which\r
+       automatically subscribes to its deprecated predecessor.\r
+       - Deprecated onSelect. Created selectEvent, which automatically\r
+       subscribes to its deprecated predecessor.\r
+       - Deprecated onBeforeDeselect. Created beforeSelectEvent which\r
+       automatically subscribes to its deprecated predecessor.\r
+       - Deprecated onDeselect. Created beforeDeselectEvent, which\r
+       automatically subscribes to its deprecated predecessor.\r
+       - Deprecated onChangePage. Created changePageEvent, which automatically\r
+       subscribes to its deprecated predecessor.\r
+       - Deprecated onRender. Created renderEvent, which automatically\r
+       subscribes to its deprecated predecessor.\r
+       - Deprecated onReset. Created resetEvent, which automatically subscribes\r
+       to its deprecated predecessor.\r
+       - Deprecated onClear. Created clearEvent, which automatically subscribes\r
+       to its deprecated predecessor.\r
+       - Corrected setMonth documentation to refer to 0-11 indexed months.\r
+       - Added show and hide methods to Calendar for setting the Calendar's\r
+       display property.\r
+       - Optimized internal render classes to use innerHTML and string buffers\r
+       - Removed wireCustomEvents function\r
+       - Removed wireDefaultEvents function\r
+       - Removed doNextMonth / doPreviousMonth\r
+       - Removed all buildShell (header, body, footer) functions, since the\r
+       Calendar shell is now built dynamically on each render\r
+       - Wired all CalendarGroup events and configuration properties to be\r
+       properly delegated to Calendar\r
+       - Augmented CalendarGroup with all built-in renderers, label functions,\r
+       hide, show, and initStyles, creating API transparency between Calendar\r
+       and CalendarGroup.\r
+       - Made all tagName, createElement, and entity references XHTML compliant\r
+       - Fixed Daylight Saving Time bug for Brazilian time zone\r
+\r
+*** version 0.11.3 ***\r
+\r
+       - Calendar_Core: Added arguments for selected/deselected dates to\r
+       onSelect/onDeselect\r
+       - CalendarGroup: Fixed bug where selected dates passed to constructor\r
+       were not represented in selectedDates\r
+       - Calendar2up: Now displays correctly in Opera 9\r
+\r
 *** version 0.11.0 ***\r
 \r
        - DateMath: DateMath.add now properly adds weeks\r
        - DateMath: between() function added\r
-       - DateMath: getWeekNumber() fixed to take starting day of week into account\r
-       - All references to Calendar's built in CSS class handlers are removed, replaced with calls to Dom utility (addClass, removeClass)\r
+       - DateMath: getWeekNumber() fixed to take starting day of week into\r
+       account\r
+       - All references to Calendar's built in CSS class handlers are removed,\r
+       replaced with calls to Dom utility (addClass, removeClass)\r
        - Several CSS class constants now have clearer names\r
        - All CSS classes are now properly namespaced to avoid CSS conflicts\r
        - Fixed table:hover bug in CSS\r
-       - Calendar no longer requires the container ID and variable name to match in order for month navigation to function properly\r
-       - Calendar month navigation arrows are now represented as background images\r
+       - Calendar no longer requires the container ID and variable name to\r
+       match in order for month navigation to function properly\r
+       - Calendar month navigation arrows are now represented as background\r
+       images\r
 \r
 *** version 0.10.0 ***\r
 \r
-       - Major performance improvements from attaching DOM events to associated table cells only once, when the Calendar shell is built\r
-       - DOM events for mouseover/mouseout are now fired for all browsers (not just Internet Explorer)\r
+       - Major performance improvements from attaching DOM events to associated\r
+       table cells only once, when the Calendar shell is built\r
+       - DOM events for mouseover/mouseout are now fired for all browsers (not\r
+       just Internet Explorer)\r
        - Reset functionality bug fixed for 2-up Calendar view\r
 \r
 *** version 0.9.0 ***\r
index 59e89092445df6aa2f1adca025ed90319a869a7d..0723f9430f44fd93cea873d3bfa0e37e23f4e477 100755 (executable)
@@ -2,17 +2,40 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+Version 0.12\r
 */\r
 \r
-.yui-cal2upwrapper {*height:1%;} /* IE */\r
-.yui-cal2upwrapper:after {content:'.';clear:both;display:block;visibility:hidden;height:0;} /* others */\r
-\r
 .yui-calcontainer {\r
-       float:left;\r
+       position:relative;\r
        padding:5px;\r
        background-color:#F7F9FB;\r
        border:1px solid #7B9EBD;\r
+       float:left;\r
+       overflow:hidden;\r
+}\r
+\r
+.yui-calcontainer iframe {\r
+       position:absolute;\r
+       border:none;\r
+       margin:0;padding:0;\r
+       left:-1px;\r
+       top:-1px;\r
+       z-index:0;\r
+       width:50em;\r
+       height:50em;\r
+}\r
+\r
+.yui-calcontainer.multi {\r
+       padding:0;\r
+}\r
+\r
+.yui-calcontainer.multi .groupcal {\r
+       padding:5px;\r
+       background-color:transparent;\r
+       z-index:1;\r
+       float:left;\r
+       position:relative;\r
+       border:none;\r
 }\r
 \r
 .yui-calcontainer .title {\r
@@ -20,20 +43,32 @@ Version 0.11.0
        color:#000;\r
        font-weight:bold;\r
        margin-bottom:5px;\r
-       height:auto;\r
-       width:304px;\r
-       position:relative;\r
+       height:25px;\r
+       position:absolute;\r
+       top:3px;left:5px;\r
+       z-index:1;\r
 }\r
 \r
-.yui-calcontainer .title .close-icon {\r
+.yui-calcontainer .close-icon {\r
        position:absolute;\r
-       right:0;\r
-       top:0;\r
+       right:3px;\r
+       top:3px;\r
        border:none;\r
+       z-index:1;\r
 }\r
 \r
-.yui-calcontainer .cal2up {\r
-       float:left;\r
+/* Calendar element styles */\r
+\r
+.yui-calendar {\r
+       font:100% sans-serif;\r
+       text-align:center;\r
+       border-spacing:0;\r
+       border-collapse:separate;\r
+       position:relative;\r
+}\r
+\r
+.yui-calcontainer.withtitle {\r
+       padding-top:1.5em;\r
 }\r
 \r
 .yui-calendar .calnavleft {\r
@@ -45,6 +80,7 @@ Version 0.11.0
        width:9px;\r
        height:12px;   \r
        left:2px;\r
+       z-index:1;\r
 }\r
 \r
 .yui-calendar .calnavright {\r
@@ -56,22 +92,13 @@ Version 0.11.0
        width:9px;\r
        height:12px;  \r
        right:2px;\r
-}\r
-\r
-/* Calendar element styles */\r
-\r
-.yui-calendar {\r
-       font:100% sans-serif;\r
-       text-align:center;\r
-       border-spacing:0;\r
-       border-collapse:separate;\r
+       z-index:1;\r
 }\r
 \r
 .yui-calendar td.calcell {\r
-       width:1.5em;\r
-       height:1em;\r
+       padding:.1em .2em;\r
        border:1px solid #E0E0E0;\r
-       background-color:#FFF;\r
+       text-align:center;\r
 }\r
 \r
 .yui-calendar td.calcell a {\r
@@ -103,12 +130,6 @@ Version 0.11.0
        border:1px solid #FF9900;\r
 }\r
 \r
-/* Added to perform some correction for Opera 8.5\r
-   hover redraw bug */\r
-table.yui-calendar:hover {\r
-       background-color:#FFF;\r
-}\r
-\r
 .yui-calendar td.calcell.calcellhover a {\r
        color:#FFF;\r
 }\r
@@ -126,7 +147,6 @@ table.yui-calendar:hover {
 .yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; }\r
 .yui-calendar td.calcell.highlight4 { background-color:#CCFF99; }\r
 \r
-\r
 .yui-calendar .calhead {\r
        border:1px solid #E0E0E0;\r
        vertical-align:middle;\r
@@ -146,6 +166,8 @@ table.yui-calendar:hover {
 .yui-calendar .calweekdaycell {\r
        color:#666;\r
        font-weight:normal;\r
+       text-align:center;\r
+       width:1.5em;\r
 }\r
 \r
 .yui-calendar .calfoot {\r
index 12f81215fc431053a7cb3b0bf4e6c661522fcf4f..33969800558ab64a77b5a26af9368a8292c56b05 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version 0.12.0\r
 */\r
 \r
 /**\r
-* @class\r
-* <p>YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
-* used for adding, subtracting, and comparing dates.</p>\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
+* @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
+*/\r
+YAHOO.util.Config = function(owner) {\r
+       if (owner) {\r
+               this.init(owner);\r
+       } else {\r
+               YAHOO.log("No owner specified for Config object", "error");\r
+       }\r
+};\r
+\r
+YAHOO.util.Config.prototype = {\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
+       */\r
+       owner : null,\r
+\r
+       /**\r
+       * Boolean flag that specifies whether a queue is currently being executed\r
+       * @property queueInProgress\r
+       * @type Boolean\r
+       */\r
+       queueInProgress : false,\r
+\r
+\r
+       /**\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
+       */\r
+       checkBoolean: function(val) {\r
+               if (typeof val == 'boolean') {\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       },\r
+\r
+       /**\r
+       * Validates that the value passed in is a number.\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
+       */\r
+       checkNumber: function(val) {\r
+               if (isNaN(val)) {\r
+                       return false;\r
+               } else {\r
+                       return true;\r
+               }\r
+       }\r
+};\r
+\r
+\r
+/**\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
+*/\r
+YAHOO.util.Config.prototype.init = function(owner) {\r
+\r
+       this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
+       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
+       this.queueInProgress = false;\r
+\r
+       /* Private Members */\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var eventQueue = [];\r
+\r
+       /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
+       * @private\r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
+       var fireEvent = function( key, value ) {\r
+               YAHOO.log("Firing Config event: " + key + "=" + value, "info");\r
+\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       property.event.fire(value);\r
+               }\r
+       };\r
+       /* End Private Members */\r
+\r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
+       this.addProperty = function( key, propertyObject ) {\r
+               key = key.toLowerCase();\r
+\r
+               YAHOO.log("Added property: " + key, "info");\r
+\r
+               config[key] = propertyObject;\r
+\r
+               propertyObject.event = new YAHOO.util.CustomEvent(key);\r
+               propertyObject.key = key;\r
+\r
+               if (propertyObject.handler) {\r
+                       propertyObject.event.subscribe(propertyObject.handler, this.owner, true);\r
+               }\r
+\r
+               this.setProperty(key, propertyObject.value, true);\r
+\r
+               if (! propertyObject.suppressEvent) {\r
+                       this.queueProperty(key, propertyObject.value);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
+       this.getConfig = function() {\r
+               var cfg = {};\r
+\r
+               for (var prop in config) {\r
+                       var property = config[prop];\r
+                       if (typeof property != 'undefined' && property.event) {\r
+                               cfg[prop] = property.value;\r
+                       }\r
+               }\r
+\r
+               return cfg;\r
+       };\r
+\r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
+       this.getProperty = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       return property.value;\r
+               } else {\r
+                       return undefined;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
+       this.resetProperty = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
+       this.setProperty = function(key, value, silent) {\r
+               key = key.toLowerCase();\r
+\r
+               YAHOO.log("setProperty: " + key + "=" + value, "info");\r
+\r
+               if (this.queueInProgress && ! silent) {\r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
+                       return true;\r
+               } else {\r
+                       var property = config[key];\r
+                       if (typeof property != 'undefined' && property.event) {\r
+                               if (property.validator && ! property.validator(value)) { // validator\r
+                                       return false;\r
+                               } else {\r
+                                       property.value = value;\r
+                                       if (! silent) {\r
+                                               fireEvent(key, value);\r
+                                               this.configChangedEvent.fire([key, value]);\r
+                                       }\r
+                                       return true;\r
+                               }\r
+                       } else {\r
+                               return false;\r
+                       }\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
+       this.queueProperty = function(key, value) {\r
+               key = key.toLowerCase();\r
+\r
+               YAHOO.log("queueProperty: " + key + "=" + value, "info");\r
+\r
+               var property = config[key];\r
+\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
+                               return false;\r
+                       } else {\r
+\r
+                               if (typeof value != 'undefined') {\r
+                                       property.value = value;\r
+                               } else {\r
+                                       value = property.value;\r
+                               }\r
+\r
+                               var foundDuplicate = false;\r
+\r
+                               for (var i=0;i<eventQueue.length;i++) {\r
+                                       var queueItem = eventQueue[i];\r
+\r
+                                       if (queueItem) {\r
+                                               var queueItemKey = queueItem[0];\r
+                                               var queueItemValue = queueItem[1];\r
+\r
+                                               if (queueItemKey.toLowerCase() == key) {\r
+                                                       // found a dupe... push to end of queue, null current item, and break\r
+                                                       eventQueue[i] = null;\r
+                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);\r
+                                                       foundDuplicate = true;\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
+                                       eventQueue.push([key, value]);\r
+                               }\r
+                       }\r
+\r
+                       if (property.supercedes) {\r
+                               for (var s=0;s<property.supercedes.length;s++) {\r
+                                       var supercedesCheck = property.supercedes[s];\r
+\r
+                                       for (var q=0;q<eventQueue.length;q++) {\r
+                                               var queueItemCheck = eventQueue[q];\r
+\r
+                                               if (queueItemCheck) {\r
+                                                       var queueItemCheckKey = queueItemCheck[0];\r
+                                                       var queueItemCheckValue = queueItemCheck[1];\r
+\r
+                                                       if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
+                                                               eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
+                                                               eventQueue[q] = null;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");\r
+\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
+       this.refireEvent = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event && typeof property.value != 'undefined') {\r
+                       if (this.queueInProgress) {\r
+                               this.queueProperty(key);\r
+                       } else {\r
+                               fireEvent(key, property.value);\r
+                       }\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
+       this.applyConfig = function(userConfig, init) {\r
+               if (init) {\r
+                       initialConfig = userConfig;\r
+               }\r
+               for (var prop in userConfig) {\r
+                       this.queueProperty(prop, userConfig[prop]);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
+       this.refresh = function() {\r
+               for (var prop in config) {\r
+                       this.refireEvent(prop);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
+       this.fireQueue = function() {\r
+               this.queueInProgress = true;\r
+               for (var i=0;i<eventQueue.length;i++) {\r
+                       var queueItem = eventQueue[i];\r
+                       if (queueItem) {\r
+                               var key = queueItem[0];\r
+                               var value = queueItem[1];\r
+\r
+                               var property = config[key];\r
+                               property.value = value;\r
+\r
+                               fireEvent(key,value);\r
+                       }\r
+               }\r
+\r
+               this.queueInProgress = false;\r
+               eventQueue = [];\r
+       };\r
+\r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
+       this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (! YAHOO.util.Config.alreadySubscribed(property.event, handler, obj)) {\r
+                               property.event.subscribe(handler, obj, override);\r
+                       }\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
+       this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       return property.event.unsubscribe(handler, obj);\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
+       this.toString = function() {\r
+               var output = "Config";\r
+               if (this.owner) {\r
+                       output += " [" + this.owner.toString() + "]";\r
+               }\r
+               return output;\r
+       };\r
+\r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
+       this.outputEventQueue = function() {\r
+               var output = "";\r
+               for (var q=0;q<eventQueue.length;q++) {\r
+                       var queueItem = eventQueue[q];\r
+                       if (queueItem) {\r
+                               output += queueItem[0] + "=" + queueItem[1] + ", ";\r
+                       }\r
+               }\r
+               return output;\r
+       };\r
+};\r
+\r
+/**\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
+* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
+* @param {Function}    fn      The function to look for in the subscribers list\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
-YAHOO.widget.DateMath = new function() {\r
+YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
+       for (var e=0;e<evt.subscribers.length;e++) {\r
+               var subsc = evt.subscribers[e];\r
+               if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
+                       return true;\r
+               }\r
+       }\r
+       return false;\r
+};\r
 \r
+/**\r
+* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
+* used for adding, subtracting, and comparing dates.\r
+* @class YAHOO.widget.DateMath\r
+*/\r
+YAHOO.widget.DateMath = {\r
        /**\r
        * Constant field representing Day\r
+       * @property DAY\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.DAY = "D";\r
+       DAY : "D",\r
 \r
        /**\r
        * Constant field representing Week\r
+       * @property WEEK\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.WEEK = "W";\r
+       WEEK : "W",\r
 \r
        /**\r
        * Constant field representing Year\r
+       * @property YEAR\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.YEAR = "Y";\r
+       YEAR : "Y",\r
 \r
        /**\r
        * Constant field representing Month\r
+       * @property MONTH\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.MONTH = "M";\r
+       MONTH : "M",\r
 \r
        /**\r
        * Constant field representing one day, in milliseconds\r
-       * @type Integer\r
+       * @property ONE_DAY_MS\r
+       * @static\r
+       * @final\r
+       * @type Number\r
        */\r
-       this.ONE_DAY_MS = 1000*60*60*24;\r
+       ONE_DAY_MS : 1000*60*60*24,\r
 \r
        /**\r
        * Adds the specified amount of time to the this instance.\r
+       * @method add\r
        * @param {Date} date    The JavaScript Date object to perform addition on\r
-       * @param {string} field The this field constant to be used for performing addition.\r
-       * @param {Integer} amount       The number of units (measured in the field constant) to add to the date.\r
+       * @param {String} field The field constant to be used for performing addition.\r
+       * @param {Number} amount        The number of units (measured in the field constant) to add to the date.\r
+       * @return {Date} The resulting Date object\r
        */\r
-       this.add = function(date, field, amount) {\r
+       add : function(date, field, amount) {\r
                var d = new Date(date.getTime());\r
                switch (field) {\r
                        case this.MONTH:\r
@@ -67,7 +561,7 @@ YAHOO.widget.DateMath = new function() {
                                                years += 1;\r
                                        }\r
                                }\r
-                               \r
+\r
                                d.setMonth(newMonth);\r
                                d.setFullYear(date.getFullYear() + years);\r
                                break;\r
@@ -82,86 +576,93 @@ YAHOO.widget.DateMath = new function() {
                                break;\r
                }\r
                return d;\r
-       };\r
+       },\r
 \r
        /**\r
        * Subtracts the specified amount of time from the this instance.\r
+       * @method subtract\r
        * @param {Date} date    The JavaScript Date object to perform subtraction on\r
-       * @param {Integer} field        The this field constant to be used for performing subtraction.\r
-       * @param {Integer} amount       The number of units (measured in the field constant) to subtract from the date.\r
+       * @param {Number} field The this field constant to be used for performing subtraction.\r
+       * @param {Number} amount        The number of units (measured in the field constant) to subtract from the date.\r
+       * @return {Date} The resulting Date object\r
        */\r
-       this.subtract = function(date, field, amount) {\r
+       subtract : function(date, field, amount) {\r
                return this.add(date, field, (amount*-1));\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is before another date on the calendar.\r
+       * @method before\r
        * @param {Date} date            The Date object to compare with the compare argument\r
        * @param {Date} compareTo       The Date object to use for the comparison\r
        * @return {Boolean} true if the date occurs before the compared date; false if not.\r
        */\r
-       this.before = function(date, compareTo) {\r
+       before : function(date, compareTo) {\r
                var ms = compareTo.getTime();\r
                if (date.getTime() < ms) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is after another date on the calendar.\r
+       * @method after\r
        * @param {Date} date            The Date object to compare with the compare argument\r
        * @param {Date} compareTo       The Date object to use for the comparison\r
        * @return {Boolean} true if the date occurs after the compared date; false if not.\r
        */\r
-       this.after = function(date, compareTo) {\r
+       after : function(date, compareTo) {\r
                var ms = compareTo.getTime();\r
                if (date.getTime() > ms) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is between two other dates on the calendar.\r
+       * @method between\r
        * @param {Date} date            The date to check for\r
        * @param {Date} dateBegin       The start of the range\r
        * @param {Date} dateEnd         The end of the range\r
        * @return {Boolean} true if the date occurs between the compared dates; false if not.\r
        */\r
-       this.between = function(date, dateBegin, dateEnd) {\r
+       between : function(date, dateBegin, dateEnd) {\r
                if (this.after(date, dateBegin) && this.before(date, dateEnd)) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
-       \r
+       },\r
+\r
        /**\r
        * Retrieves a JavaScript Date object representing January 1 of any given year.\r
-       * @param {Integer} calendarYear         The calendar year for which to retrieve January 1\r
+       * @method getJan1\r
+       * @param {Number} calendarYear          The calendar year for which to retrieve January 1\r
        * @return {Date}        January 1 of the calendar year specified.\r
        */\r
-       this.getJan1 = function(calendarYear) {\r
-               return new Date(calendarYear,0,1); \r
-       };\r
+       getJan1 : function(calendarYear) {\r
+               return new Date(calendarYear,0,1);\r
+       },\r
 \r
        /**\r
        * Calculates the number of days the specified date is from January 1 of the specified calendar year.\r
        * Passing January 1 to this function would return an offset value of zero.\r
+       * @method getDayOffset\r
        * @param {Date} date    The JavaScript date for which to find the offset\r
-       * @param {Integer} calendarYear The calendar year to use for determining the offset\r
-       * @return {Integer}     The number of days since January 1 of the given year\r
+       * @param {Number} calendarYear  The calendar year to use for determining the offset\r
+       * @return {Number}      The number of days since January 1 of the given year\r
        */\r
-       this.getDayOffset = function(date, calendarYear) {\r
+       getDayOffset : function(date, calendarYear) {\r
                var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.\r
-               \r
+\r
                // Find the number of days the passed in date is away from the calendar year start\r
                var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);\r
                return dayOffset;\r
-       };\r
+       },\r
 \r
        /**\r
        * Calculates the week number for the given date. This function assumes that week 1 is the\r
@@ -170,126 +671,103 @@ YAHOO.widget.DateMath = new function() {
        * date if the date overlaps years. For instance, a week may be considered week 1 of 2005, or\r
        * week 53 of 2004. Specifying the optional calendarYear allows one to make this distinction\r
        * easily.\r
+       * @method getWeekNumber\r
        * @param {Date} date    The JavaScript date for which to find the week number\r
-       * @param {Integer} calendarYear OPTIONAL - The calendar year to use for determining the week number. Default is\r
+       * @param {Number} calendarYear  OPTIONAL - The calendar year to use for determining the week number. Default is\r
        *                                                                                       the calendar year of parameter "date".\r
-       * @param {Integer} weekStartsOn OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).\r
-       * @return {Integer}     The week number of the given date.\r
+       * @param {Number} weekStartsOn  OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).\r
+       * @return {Number}      The week number of the given date.\r
        */\r
-       this.getWeekNumber = function(date, calendarYear, weekStartsOn) {\r
-               date.setHours(12,0,0,0);\r
+       getWeekNumber : function(date, calendarYear) {\r
+               date = this.clearTime(date);\r
+               var nearestThurs = new Date(date.getTime() + (4 * this.ONE_DAY_MS) - ((date.getDay()) * this.ONE_DAY_MS));\r
 \r
-               if (! weekStartsOn) {\r
-                       weekStartsOn = 0;\r
-               }\r
-               if (! calendarYear) {\r
-                       calendarYear = date.getFullYear();\r
-               }\r
-               \r
-               var weekNum = -1;\r
-               \r
-               var jan1 = this.getJan1(calendarYear);\r
-\r
-               var jan1Offset = jan1.getDay() - weekStartsOn;\r
-               var jan1DayOfWeek = (jan1Offset >= 0 ? jan1Offset : (7 + jan1Offset));\r
-\r
-               var endOfWeek1 = this.add(jan1, this.DAY, (6 - jan1DayOfWeek));\r
-               endOfWeek1.setHours(23,59,59,999);\r
-\r
-               var month = date.getMonth();\r
-               var day = date.getDate();\r
-               var year = date.getFullYear();\r
-               \r
-               var dayOffset = this.getDayOffset(date, calendarYear); // Days since Jan 1, Calendar Year\r
-                       \r
-               if (dayOffset < 0 || this.before(date, endOfWeek1)) {\r
-                       weekNum = 1;\r
-               } else {\r
-                       weekNum = 2;\r
-                       var weekBegin = new Date(endOfWeek1.getTime() + 1);\r
-                       var weekEnd = this.add(weekBegin, this.WEEK, 1);\r
-\r
-                       while (! this.between(date, weekBegin, weekEnd)) {\r
-                               weekBegin = this.add(weekBegin, this.WEEK, 1);\r
-                               weekEnd = this.add(weekEnd, this.WEEK, 1);\r
-                               weekNum += 1;\r
-                       }\r
-               }\r
-               \r
+               var jan1 = new Date(nearestThurs.getFullYear(),0,1);\r
+               var dayOfYear = ((nearestThurs.getTime() - jan1.getTime()) / this.ONE_DAY_MS) - 1;\r
+\r
+               var weekNum = Math.ceil((dayOfYear)/ 7);\r
                return weekNum;\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines if a given week overlaps two different years.\r
+       * @method isYearOverlapWeek\r
        * @param {Date} weekBeginDate   The JavaScript Date representing the first day of the week.\r
        * @return {Boolean}     true if the date overlaps two different years.\r
        */\r
-       this.isYearOverlapWeek = function(weekBeginDate) {\r
+       isYearOverlapWeek : function(weekBeginDate) {\r
                var overlaps = false;\r
                var nextWeek = this.add(weekBeginDate, this.DAY, 6);\r
                if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {\r
                        overlaps = true;\r
                }\r
                return overlaps;\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines if a given week overlaps two different months.\r
+       * @method isMonthOverlapWeek\r
        * @param {Date} weekBeginDate   The JavaScript Date representing the first day of the week.\r
        * @return {Boolean}     true if the date overlaps two different months.\r
        */\r
-       this.isMonthOverlapWeek = function(weekBeginDate) {\r
+       isMonthOverlapWeek : function(weekBeginDate) {\r
                var overlaps = false;\r
                var nextWeek = this.add(weekBeginDate, this.DAY, 6);\r
                if (nextWeek.getMonth() != weekBeginDate.getMonth()) {\r
                        overlaps = true;\r
                }\r
                return overlaps;\r
-       };\r
+       },\r
 \r
        /**\r
        * Gets the first day of a month containing a given date.\r
+       * @method findMonthStart\r
        * @param {Date} date    The JavaScript Date used to calculate the month start\r
        * @return {Date}                The JavaScript Date representing the first day of the month\r
        */\r
-       this.findMonthStart = function(date) {\r
+       findMonthStart : function(date) {\r
                var start = new Date(date.getFullYear(), date.getMonth(), 1);\r
                return start;\r
-       };\r
+       },\r
 \r
        /**\r
        * Gets the last day of a month containing a given date.\r
+       * @method findMonthEnd\r
        * @param {Date} date    The JavaScript Date used to calculate the month end\r
        * @return {Date}                The JavaScript Date representing the last day of the month\r
        */\r
-       this.findMonthEnd = function(date) {\r
+       findMonthEnd : function(date) {\r
                var start = this.findMonthStart(date);\r
                var nextMonth = this.add(start, this.MONTH, 1);\r
                var end = this.subtract(nextMonth, this.DAY, 1);\r
                return end;\r
-       };\r
+       },\r
 \r
        /**\r
        * Clears the time fields from a given date, effectively setting the time to midnight.\r
+       * @method clearTime\r
        * @param {Date} date    The JavaScript Date for which the time fields will be cleared\r
        * @return {Date}                The JavaScript Date cleared of all time fields\r
        */\r
-       this.clearTime = function(date) {\r
-               date.setHours(0,0,0,0);\r
+       clearTime : function(date) {\r
+               date.setHours(12,0,0,0);\r
                return date;\r
-       };\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+       }\r
+};\r
+\r
+/**\r
+* 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 ("one-up") or two-month ("two-up") interface. Calendars are generated entirely via script and can be navigated without any page refreshes.\r
+* @module    Calendar\r
+* @title     Calendar Widget\r
+* @namespace YAHOO.widget\r
+* @requires  yahoo,dom,event\r
+*/\r
 \r
 /**\r
-* @class\r
-* <p>Calendar_Core is the base class for the Calendar widget. In its most basic\r
+* Calendar is the base class for the Calendar widget. In its most basic\r
 * implementation, it has the ability to render a calendar widget on the page\r
 * that can be manipulated to select a single date, move back and forth between\r
-* months and years.</p>\r
+* months and years.\r
 * <p>To construct the placeholder for the calendar widget, the code is as\r
 * follows:\r
 *      <xmp>\r
@@ -297,2091 +775,3115 @@ http://developer.yahoo.net/yui/license.txt
 *      </xmp>\r
 * Note that the table can be replaced with any kind of element.\r
 * </p>\r
+* @namespace YAHOO.widget\r
+* @class Calendar\r
 * @constructor\r
 * @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar_Core = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {     \r
-               if (! id) {\r
-                       YAHOO.log("No ID specified", "error");\r
-               }\r
-               if (! containerId) {\r
-                       YAHOO.log("No container ID specified", "error");\r
-               }\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.Calendar = function(id, containerId, config) {\r
+       this.init(id, containerId, config);\r
+};\r
 \r
 /**\r
 * The path to be used for images loaded for the Calendar\r
+* @property YAHOO.widget.Calendar.IMG_ROOT\r
+* @static\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.IMG_ROOT = (window.location.href.toLowerCase().indexOf("https") == 0 ? "https://a248.e.akamai.net/sec.yimg.com/i/" : "http://us.i1.yimg.com/us.yimg.com/i/");\r
+YAHOO.widget.Calendar.IMG_ROOT = (window.location.href.toLowerCase().indexOf("https") === 0 ? "https://a248.e.akamai.net/sec.yimg.com/i/" : "http://us.i1.yimg.com/us.yimg.com/i/");\r
 \r
 /**\r
 * Type constant used for renderers to represent an individual date (M/D/Y)\r
+* @property YAHOO.widget.Calendar.DATE\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.DATE = "D";\r
+YAHOO.widget.Calendar.DATE = "D";\r
 \r
 /**\r
 * Type constant used for renderers to represent an individual date across any year (M/D)\r
+* @property YAHOO.widget.Calendar.MONTH_DAY\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.MONTH_DAY = "MD";\r
+YAHOO.widget.Calendar.MONTH_DAY = "MD";\r
 \r
 /**\r
 * Type constant used for renderers to represent a weekday\r
+* @property YAHOO.widget.Calendar.WEEKDAY\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.WEEKDAY = "WD";\r
+YAHOO.widget.Calendar.WEEKDAY = "WD";\r
 \r
 /**\r
 * Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y)\r
+* @property YAHOO.widget.Calendar.RANGE\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.RANGE = "R";\r
+YAHOO.widget.Calendar.RANGE = "R";\r
 \r
 /**\r
 * Type constant used for renderers to represent a month across any year\r
+* @property YAHOO.widget.Calendar.MONTH\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.MONTH = "M";\r
+YAHOO.widget.Calendar.MONTH = "M";\r
 \r
 /**\r
 * Constant that represents the total number of date cells that are displayed in a given month\r
-* including \r
+* @property YAHOO.widget.Calendar.DISPLAY_DAYS\r
+* @static\r
 * @final\r
-* @type Integer\r
+* @type Number\r
 */\r
-YAHOO.widget.Calendar_Core.DISPLAY_DAYS = 42;\r
+YAHOO.widget.Calendar.DISPLAY_DAYS = 42;\r
 \r
 /**\r
 * Constant used for halting the execution of the remainder of the render stack\r
+* @property YAHOO.widget.Calendar.STOP_RENDER\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.STOP_RENDER = "S";\r
+YAHOO.widget.Calendar.STOP_RENDER = "S";\r
 \r
-YAHOO.widget.Calendar_Core.prototype = {\r
+YAHOO.widget.Calendar.prototype = {\r
 \r
        /**\r
        * The configuration object used to set up the calendars various locale and style options.\r
+       * @property Config\r
+       * @private\r
+       * @deprecated Configuration properties should be set by calling Calendar.cfg.setProperty.\r
        * @type Object\r
        */\r
        Config : null,\r
 \r
        /**\r
        * The parent CalendarGroup, only to be set explicitly by the parent group\r
+       * @property parent\r
        * @type CalendarGroup\r
-       */      \r
+       */\r
        parent : null,\r
 \r
        /**\r
        * The index of this item in the parent group\r
-       * @type Integer\r
+       * @property index\r
+       * @type Number\r
        */\r
        index : -1,\r
 \r
        /**\r
        * The collection of calendar table cells\r
+       * @property cells\r
        * @type HTMLTableCellElement[]\r
        */\r
        cells : null,\r
 \r
        /**\r
-       * The collection of calendar week header cells\r
-       * @type HTMLTableCellElement[]\r
+       * 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].\r
+       * @property cellDates\r
+       * @type Array[](Number[])\r
        */\r
-       weekHeaderCells : null,\r
-\r
-       /**\r
-       * The collection of calendar week footer cells\r
-       * @type HTMLTableCellElement[]\r
-       */\r
-       weekFooterCells : null,\r
-       \r
-       /**\r
-       * 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].\r
-       * @type Array[](Integer[])\r
-       */\r
-       cellDates : null,\r
+       cellDates : null,\r
 \r
        /**\r
        * The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.\r
+       * @property id\r
        * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
        * 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.\r
+       * @property oDomContainer\r
        * @type HTMLElement\r
        */\r
        oDomContainer : null,\r
 \r
        /**\r
        * A Date object representing today's date.\r
+       * @property today\r
        * @type Date\r
        */\r
        today : null,\r
 \r
        /**\r
-       * The list of render functions, along with required parameters, used to render cells. \r
+       * The list of render functions, along with required parameters, used to render cells.\r
+       * @property renderStack\r
        * @type Array[]\r
        */\r
        renderStack : null,\r
 \r
        /**\r
        * A copy of the initial render functions created before rendering.\r
-       * @type Array\r
+       * @property _renderStack\r
        * @private\r
+       * @type Array\r
        */\r
        _renderStack : null,\r
 \r
-       /**\r
-       * A Date object representing the month/year that the calendar is currently set to\r
-       * @type Date\r
-       */\r
-       pageDate : null,\r
-\r
        /**\r
        * A Date object representing the month/year that the calendar is initially set to\r
-       * @type Date\r
+       * @property _pageDate\r
        * @private\r
-       */\r
-       _pageDate : null,\r
-       \r
-       /**\r
-       * A Date object representing the minimum selectable date\r
-       * @type Date\r
-       */\r
-       minDate : null,\r
-       \r
-       /**\r
-       * A Date object representing the maximum selectable date\r
        * @type Date\r
        */\r
-       maxDate : null,\r
-       \r
-       /**\r
-       * The list of currently selected dates. The data format for this local collection is \r
-       * an array of date field arrays, e.g:\r
-       * [\r
-       *       [2004,5,25],\r
-       *       [2004,5,26]\r
-       * ]\r
-       * @type Array[](Integer[])\r
-       */\r
-       selectedDates : null,\r
+       _pageDate : null,\r
 \r
        /**\r
        * The private list of initially selected dates.\r
-       * @type Array\r
+       * @property _selectedDates\r
        * @private\r
+       * @type Array\r
        */\r
        _selectedDates : null,\r
 \r
        /**\r
-       * A boolean indicating whether the shell of the calendar has already been rendered to the page\r
-       * @type Boolean\r
-       */      \r
-       shellRendered : false,\r
-\r
-       /**\r
-       * The HTML table element that represents this calendar\r
-       * @type HTMLTableElement\r
-       */      \r
-       table : null,\r
-\r
-       /**\r
-       * The HTML cell element that represents the main header cell TH used in the calendar table\r
-       * @type HTMLTableCellElement\r
-       */      \r
-       headerCell : null\r
+       * A map of DOM event handlers to attach to cells associated with specific CSS class names\r
+       * @property domEventMap\r
+       * @type Object\r
+       */\r
+       domEventMap : null\r
 };\r
 \r
 \r
 \r
 /**\r
-* Initializes the calendar widget. This method must be called by all subclass constructors.\r
+* Initializes the Calendar widget.\r
+* @method init\r
 * @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.init = function(id, containerId, monthyear, selected) {\r
-\r
-       this.logger = new YAHOO.widget.LogWriter("Calendar_Core " + id);        \r
+YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {\r
+       this.logger = new YAHOO.widget.LogWriter("Calendar_Core " + id);\r
 \r
-       this.setupConfig();\r
+       this.initEvents();\r
+       this.today = new Date();\r
+       YAHOO.widget.DateMath.clearTime(this.today);\r
 \r
        this.id = id;\r
-\r
-       this.cellDates = new Array();\r
-       \r
-       this.cells = new Array();\r
-       \r
-       this.renderStack = new Array();\r
-       this._renderStack = new Array();\r
-\r
        this.oDomContainer = document.getElementById(containerId);\r
-       \r
        if (! this.oDomContainer) {\r
                this.logger.log("No valid container present.", "error");\r
        }\r
 \r
-       this.today = new Date();\r
-       YAHOO.widget.DateMath.clearTime(this.today);\r
+       /**\r
+       * The Config object used to hold the configuration variables for the Calendar\r
+       * @property cfg\r
+       * @type YAHOO.util.Config\r
+       */\r
+       this.cfg = new YAHOO.util.Config(this);\r
 \r
-       var month;\r
-       var year;\r
+       /**\r
+       * The local object which contains the Calendar's options\r
+       * @property Options\r
+       * @type Object\r
+       */\r
+       this.Options = {};\r
 \r
-       if (monthyear) {\r
-               var aMonthYear = monthyear.split(this.Locale.DATE_FIELD_DELIMITER);\r
-               month = parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);\r
-               year = parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);\r
-       } else {\r
-               month = this.today.getMonth()+1;\r
-               year = this.today.getFullYear();\r
-       }\r
+       /**\r
+       * The local object which contains the Calendar's locale settings\r
+       * @property Locale\r
+       * @type Object\r
+       */\r
+       this.Locale = {};\r
 \r
-       this.logger.log("Initialized with month/year of " + month + "/" + year, "info");\r
+       this.initStyles();\r
 \r
-       this.pageDate = new Date(year, month-1, 1);\r
-       this._pageDate = new Date(this.pageDate.getTime());\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);\r
 \r
-       if (selected) {\r
-               this.selectedDates = this._parseDates(selected);\r
-               this._selectedDates = this.selectedDates.concat();\r
-       } else {\r
-               this.selectedDates = new Array();\r
-               this._selectedDates = new Array();\r
+       this.cellDates = [];\r
+       this.cells = [];\r
+       this.renderStack = [];\r
+       this._renderStack = [];\r
+\r
+       this.setupConfig();\r
+\r
+       if (config) {\r
+               this.cfg.applyConfig(config, true);\r
        }\r
 \r
-       this.wireDefaultEvents();\r
-       this.wireCustomEvents();\r
+       this.cfg.fireQueue();\r
 };\r
 \r
-\r
 /**\r
-* Wires the local DOM events for the Calendar, including cell selection, hover, and\r
-* default navigation that is used for moving back and forth between calendar pages.\r
+* Renders the built-in IFRAME shim for the IE6 and below\r
+* @method configIframe\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents = function() {\r
-       \r
-       /**\r
-       * The default event function that is attached to a date link within a calendar cell\r
-       * when the calendar is rendered. \r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       */\r
-       this.doSelectCell = function(e, cal) {          \r
-               var cell = this;\r
-               var index = cell.index;\r
+YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {\r
+       var useIframe = args[0];\r
+\r
+       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {\r
+               if (useIframe) {\r
+                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");\r
+\r
+                       if (this.browser == "ie" && (pos == "absolute" || pos == "relative")) {\r
+                               if (! YAHOO.util.Dom.inDocument(this.iframe)) {\r
+                                       this.iframe = document.createElement("iframe");\r
+                                       this.iframe.src = "javascript:false;";\r
+                                       YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
+                                       this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);\r
+                               }\r
+                       }\r
+               } else {\r
+                       if (this.iframe) {\r
+                               if (this.iframe.parentNode) {\r
+                                       this.iframe.parentNode.removeChild(this.iframe);\r
+                               }\r
+                               this.iframe = null;\r
+                       }\r
+               }\r
+       }\r
+};\r
 \r
-               cal.logger.log("Selecting cell " + index + " via click", "info");\r
+/**\r
+* Default handler for the "title" property\r
+* @method configTitle\r
+*/\r
+YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {\r
+       var title = args[0];\r
+       var close = this.cfg.getProperty("close");\r
+\r
+       var titleDiv;\r
+\r
+       if (title && title !== "") {\r
+               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");\r
+               titleDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;\r
+               titleDiv.innerHTML = title;\r
+               this.oDomContainer.insertBefore(titleDiv, this.oDomContainer.firstChild);\r
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");\r
+       } else {\r
+               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;\r
 \r
-               var d = cal.cellDates[index];\r
-               var date = new Date(d[0],d[1]-1,d[2]);\r
-               \r
-               if (! cal.isDateOOM(date) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_RESTRICTED) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_OOB)) {\r
-                       if (cal.Options.MULTI_SELECT) {\r
-                               var link = cell.getElementsByTagName("A")[0];\r
-                               link.blur();\r
-                               \r
-                               var cellDate = cal.cellDates[index];\r
-                               var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);\r
-                               \r
-                               if (cellDateIndex > -1) {       \r
-                                       cal.deselectCell(index);\r
-                               } else {\r
-                                       cal.selectCell(index);\r
-                               }       \r
-                               \r
-                       } else {\r
-                               var link = cell.getElementsByTagName("A")[0];\r
-                               link.blur()\r
-                               cal.selectCell(index);\r
-                       }\r
+               if (titleDiv) {\r
+                       YAHOO.util.Event.purgeElement(titleDiv);\r
+                       this.oDomContainer.removeChild(titleDiv);\r
+               }\r
+               if (! close) {\r
+                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");\r
                }\r
        }\r
+};\r
 \r
-       /**\r
-       * The event that is executed when the user hovers over a cell\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
-       */\r
-       this.doCellMouseOver = function(e, cal) {\r
-               var cell = this;\r
-               var index = cell.index;\r
-               var d = cal.cellDates[index];\r
-               var date = new Date(d[0],d[1]-1,d[2]);\r
+/**\r
+* Default handler for the "close" property\r
+* @method configClose\r
+*/\r
+YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {\r
+       var close = args[0];\r
+       var title = this.cfg.getProperty("title");\r
+\r
+       var linkClose;\r
+\r
+       if (close === true) {\r
+               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");\r
+               linkClose.href = "javascript:void(null);";\r
+               linkClose.className = "link-close";\r
+               YAHOO.util.Event.addListener(linkClose, "click", this.hide, this, true);\r
+               var imgClose = document.createElement("img");\r
+               imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + "us/my/bn/x_d.gif";\r
+               imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;\r
+               linkClose.appendChild(imgClose);\r
+               this.oDomContainer.appendChild(linkClose);\r
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");\r
+       } else {\r
+               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;\r
 \r
-               if (! cal.isDateOOM(date) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_RESTRICTED) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_OOB)) {\r
-                       YAHOO.util.Dom.addClass(cell, cal.Style.CSS_CELL_HOVER);\r
+               if (linkClose) {\r
+                       YAHOO.util.Event.purgeElement(linkClose);\r
+                       this.oDomContainer.removeChild(linkClose);\r
+               }\r
+               if (! title || title === "") {\r
+                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");\r
                }\r
        }\r
+};\r
+\r
+/**\r
+* Initializes Calendar's built-in CustomEvents\r
+* @method initEvents\r
+*/\r
+YAHOO.widget.Calendar.prototype.initEvents = function() {\r
 \r
        /**\r
-       * The event that is executed when the user moves the mouse out of a cell\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
+       * Fired before a selection is made\r
+       * @event beforeSelectEvent\r
        */\r
-       this.doCellMouseOut = function(e, cal) {\r
-               YAHOO.util.Dom.removeClass(this, cal.Style.CSS_CELL_HOVER);\r
-       }\r
-       \r
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");\r
+\r
        /**\r
-       * A wrapper event that executes the nextMonth method through a DOM event\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
-       */      \r
-       this.doNextMonth = function(e, cal) {\r
-               cal.nextMonth();\r
-       }\r
+       * Fired when a selection is made\r
+       * @event selectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.selectEvent = new YAHOO.util.CustomEvent("select");\r
 \r
        /**\r
-       * A wrapper event that executes the previousMonth method through a DOM event\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
-       */              \r
-       this.doPreviousMonth = function(e, cal) {\r
-               cal.previousMonth();\r
-       }\r
-}\r
-\r
-/**\r
-* This function can be extended by subclasses to attach additional DOM events to\r
-* the calendar. By default, this method is unimplemented.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.wireCustomEvents = function() { }\r
-\r
-/**\r
-This method is called to initialize the widget configuration variables, including\r
-style, localization, and other display and behavioral options.\r
-<p>Config: Container for the CSS style configuration variables.</p>\r
-<p><strong>Config.Style</strong> - Defines the CSS classes used for different calendar elements</p>\r
-<blockquote>\r
-       <div><em>CSS_CALENDAR</em> : Container table</div>\r
-       <div><em>CSS_HEADER</em> : </div>\r
-       <div><em>CSS_HEADER_TEXT</em> : Calendar header</div>\r
-       <div><em>CSS_FOOTER</em> : Calendar footer</div>\r
-       <div><em>CSS_CELL</em> : Calendar day cell</div>\r
-       <div><em>CSS_CELL_OOM</em> : Calendar OOM (out of month) cell</div>\r
-       <div><em>CSS_CELL_SELECTED</em> : Calendar selected cell</div>\r
-       <div><em>CSS_CELL_RESTRICTED</em> : Calendar restricted cell</div>\r
-       <div><em>CSS_CELL_TODAY</em> : Calendar cell for today's date</div>\r
-       <div><em>CSS_ROW_HEADER</em> : The cell preceding a row (used for week number by default)</div>\r
-       <div><em>CSS_ROW_FOOTER</em> : The cell following a row (not implemented by default)</div>\r
-       <div><em>CSS_WEEKDAY_CELL</em> : The cells used for labeling weekdays</div>\r
-       <div><em>CSS_WEEKDAY_ROW</em> : The row containing the weekday label cells</div>\r
-       <div><em>CSS_CONTAINER</em> : The border style used for the default UED rendering</div>\r
-       <div><em>CSS_2UPWRAPPER</em> : Special container class used to properly adjust the sizing and float</div>\r
-       <div><em>CSS_NAV_LEFT</em> : Left navigation arrow</div>\r
-       <div><em>CSS_NAV_RIGHT</em> : Right navigation arrow</div>\r
-       <div><em>CSS_CELL_TOP</em> : Outlying cell along the top row</div>\r
-       <div><em>CSS_CELL_LEFT</em> : Outlying cell along the left row</div>\r
-       <div><em>CSS_CELL_RIGHT</em> : Outlying cell along the right row</div>\r
-       <div><em>CSS_CELL_BOTTOM</em> : Outlying cell along the bottom row</div>\r
-       <div><em>CSS_CELL_HOVER</em> : Cell hover style</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT1</em> : Highlight color 1 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT2</em> : Highlight color 2 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT3</em> : Highlight color 3 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT4</em> : Highlight color 4 for styling cells</div>\r
-\r
-</blockquote>\r
-<p><strong>Config.Locale</strong> - Defines the locale string arrays used for localization</p>\r
-<blockquote>\r
-       <div><em>MONTHS_SHORT</em> : Array of 12 months in short format ("Jan", "Feb", etc.)</div>\r
-       <div><em>MONTHS_LONG</em> : Array of 12 months in short format ("Jan", "Feb", etc.)</div>\r
-       <div><em>WEEKDAYS_1CHAR</em> : Array of 7 days in 1-character format ("S", "M", etc.)</div>\r
-       <div><em>WEEKDAYS_SHORT</em> : Array of 7 days in short format ("Su", "Mo", etc.)</div>\r
-       <div><em>WEEKDAYS_MEDIUM</em> : Array of 7 days in medium format ("Sun", "Mon", etc.)</div>\r
-       <div><em>WEEKDAYS_LONG</em> : Array of 7 days in long format ("Sunday", "Monday", etc.)</div>\r
-       <div><em>DATE_DELIMITER</em> : The value used to delimit series of multiple dates (Default: ",")</div>\r
-       <div><em>DATE_FIELD_DELIMITER</em> : The value used to delimit date fields (Default: "/")</div>\r
-       <div><em>DATE_RANGE_DELIMITER</em> : The value used to delimit date fields (Default: "-")</div>\r
-       <div><em>MY_MONTH_POSITION</em> : The value used to determine the position of the month in a month/year combo (e.g. 12/2005) (Default: 1)</div>\r
-       <div><em>MY_YEAR_POSITION</em> : The value used to determine the position of the year in a month/year combo (e.g. 12/2005) (Default: 2)</div>   \r
-       <div><em>MD_MONTH_POSITION</em> : The value used to determine the position of the month in a month/day combo (e.g. 12/25) (Default: 1)</div>\r
-       <div><em>MD_DAY_POSITION</em> : The value used to determine the position of the day in a month/day combo (e.g. 12/25) (Default: 2)</div>\r
-       <div><em>MDY_MONTH_POSITION</em> : The value used to determine the position of the month in a month/day/year combo (e.g. 12/25/2005) (Default: 1)</div>\r
-       <div><em>MDY_DAY_POSITION</em> : The value used to determine the position of the day in a month/day/year combo (e.g. 12/25/2005) (Default: 2)</div>\r
-       <div><em>MDY_YEAR_POSITION</em> : The value used to determine the position of the year in a month/day/year combo (e.g. 12/25/2005) (Default: 3)</div>\r
-</blockquote>\r
-<p><strong>Config.Options</strong> - Defines other configurable calendar widget options</p>\r
-<blockquote>\r
-       <div><em>SHOW_WEEKDAYS</em> : Boolean, determines whether to display the weekday headers (defaults to true)</div>\r
-       <div><em>LOCALE_MONTHS</em> : Array, points to the desired Config.Locale array (defaults to Config.Locale.MONTHS_LONG)</div>\r
-       <div><em>LOCALE_WEEKDAYS</em> : Array, points to the desired Config.Locale array (defaults to Config.Locale.WEEKDAYS_SHORT)</div>\r
-       <div><em>START_WEEKDAY</em> : Integer, 0-6, representing the day that a week begins on</div>\r
-       <div><em>SHOW_WEEK_HEADER</em> : Boolean, determines whether to display row headers</div>\r
-       <div><em>SHOW_WEEK_FOOTER</em> : Boolean, determines whether to display row footers</div>\r
-       <div><em>HIDE_BLANK_WEEKS</em> : Boolean, determines whether to hide extra weeks that are completely OOM</div>\r
-       <div><em>NAV_ARROW_LEFT</em> : String, the image path used for the left navigation arrow</div>\r
-       <div><em>NAV_ARROW_RIGHT</em> : String, the image path used for the right navigation arrow</div>\r
-</blockquote>\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setupConfig = function() {\r
-       /**\r
-       * Container for the CSS style configuration variables.\r
-       */\r
-       this.Config = new Object();\r
-       \r
-       this.Config.Style = {\r
-               // Style variables\r
-               CSS_ROW_HEADER: "calrowhead",\r
-               CSS_ROW_FOOTER: "calrowfoot",\r
-               CSS_CELL : "calcell",\r
-               CSS_CELL_SELECTED : "selected",\r
-               CSS_CELL_RESTRICTED : "restricted",\r
-               CSS_CELL_TODAY : "today",\r
-               CSS_CELL_OOM : "oom",\r
-               CSS_CELL_OOB : "previous",\r
-               CSS_HEADER : "calheader",\r
-               CSS_HEADER_TEXT : "calhead",\r
-               CSS_WEEKDAY_CELL : "calweekdaycell",\r
-               CSS_WEEKDAY_ROW : "calweekdayrow",\r
-               CSS_FOOTER : "calfoot",\r
-               CSS_CALENDAR : "yui-calendar",\r
-               CSS_CONTAINER : "yui-calcontainer",\r
-               CSS_2UPWRAPPER : "yui-cal2upwrapper", \r
-               CSS_NAV_LEFT : "calnavleft",\r
-               CSS_NAV_RIGHT : "calnavright",\r
-               CSS_CELL_TOP : "calcelltop",\r
-               CSS_CELL_LEFT : "calcellleft",\r
-               CSS_CELL_RIGHT : "calcellright",\r
-               CSS_CELL_BOTTOM : "calcellbottom",\r
-               CSS_CELL_HOVER : "calcellhover",\r
-               CSS_CELL_HIGHLIGHT1 : "highlight1",\r
-               CSS_CELL_HIGHLIGHT2 : "highlight2",\r
-               CSS_CELL_HIGHLIGHT3 : "highlight3",\r
-               CSS_CELL_HIGHLIGHT4 : "highlight4"\r
-       };\r
+       * Fired before a selection is made\r
+       * @event beforeDeselectEvent\r
+       */\r
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");\r
 \r
-       this.Style = this.Config.Style;\r
-\r
-       this.Config.Locale = {\r
-               // Locale definition\r
-               MONTHS_SHORT : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],\r
-               MONTHS_LONG : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],\r
-               WEEKDAYS_1CHAR : ["S", "M", "T", "W", "T", "F", "S"],\r
-               WEEKDAYS_SHORT : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],\r
-               WEEKDAYS_MEDIUM : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],\r
-               WEEKDAYS_LONG : ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],\r
-               DATE_DELIMITER : ",",\r
-               DATE_FIELD_DELIMITER : "/",\r
-               DATE_RANGE_DELIMITER : "-",\r
-               MY_MONTH_POSITION : 1,\r
-               MY_YEAR_POSITION : 2,\r
-               MD_MONTH_POSITION : 1,\r
-               MD_DAY_POSITION : 2,\r
-               MDY_MONTH_POSITION : 1,\r
-               MDY_DAY_POSITION : 2,\r
-               MDY_YEAR_POSITION : 3\r
-       };\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event deselectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");\r
 \r
-       this.Locale = this.Config.Locale;\r
-\r
-       this.Config.Options = {\r
-               // Configuration variables\r
-               MULTI_SELECT : false,\r
-               SHOW_WEEKDAYS : true,\r
-               START_WEEKDAY : 0,\r
-               SHOW_WEEK_HEADER : false,\r
-               SHOW_WEEK_FOOTER : false,\r
-               HIDE_BLANK_WEEKS : false,\r
-               NAV_ARROW_LEFT : YAHOO.widget.Calendar_Core.IMG_ROOT + "us/tr/callt.gif",\r
-               NAV_ARROW_RIGHT : YAHOO.widget.Calendar_Core.IMG_ROOT + "us/tr/calrt.gif"\r
-       };\r
+       /**\r
+       * Fired when the Calendar page is changed\r
+       * @event changePageEvent\r
+       */\r
+       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");\r
 \r
-       this.Options = this.Config.Options;\r
+       /**\r
+       * Fired before the Calendar is rendered\r
+       * @event beforeRenderEvent\r
+       */\r
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
 \r
-       this.customConfig();\r
+       /**\r
+       * Fired when the Calendar is rendered\r
+       * @event renderEvent\r
+       */\r
+       this.renderEvent = new YAHOO.util.CustomEvent("render");\r
 \r
-       if (! this.Options.LOCALE_MONTHS) {\r
-               this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;\r
-       }\r
-       if (! this.Options.LOCALE_WEEKDAYS) {\r
-               this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;\r
-       }\r
+       /**\r
+       * Fired when the Calendar is reset\r
+       * @event resetEvent\r
+       */\r
+       this.resetEvent = new YAHOO.util.CustomEvent("reset");\r
 \r
-       // If true, reconfigure weekday arrays to place Mondays first\r
-       if (this.Options.START_WEEKDAY > 0) {\r
-               for (var w=0;w<this.Options.START_WEEKDAY;++w) {\r
-                       this.Locale.WEEKDAYS_SHORT.push(this.Locale.WEEKDAYS_SHORT.shift());\r
-                       this.Locale.WEEKDAYS_MEDIUM.push(this.Locale.WEEKDAYS_MEDIUM.shift());\r
-                       this.Locale.WEEKDAYS_LONG.push(this.Locale.WEEKDAYS_LONG.shift());              \r
-               }\r
-       }\r
+       /**\r
+       * Fired when the Calendar is cleared\r
+       * @event clearEvent\r
+       */\r
+       this.clearEvent = new YAHOO.util.CustomEvent("clear");\r
+\r
+       this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);\r
+       this.selectEvent.subscribe(this.onSelect, this, true);\r
+       this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);\r
+       this.deselectEvent.subscribe(this.onDeselect, this, true);\r
+       this.changePageEvent.subscribe(this.onChangePage, this, true);\r
+       this.renderEvent.subscribe(this.onRender, this, true);\r
+       this.resetEvent.subscribe(this.onReset, this, true);\r
+       this.clearEvent.subscribe(this.onClear, this, true);\r
 };\r
 \r
-/**\r
-* This method is called when subclasses need to override configuration variables\r
-* or create new ones. Values can be explicitly set as follows:\r
-* <blockquote><code>\r
-*      this.Config.Style.CSS_CELL = "newcalcell";\r
-*      this.Config.Locale.MONTHS_SHORT = ["Jan", "Fv", "Mars", "Avr", "Mai", "Juin", "Juil", "Aot", "Sept", "Oct", "Nov", "Dc"];\r
-* </code></blockquote>\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.customConfig = function() { };\r
 \r
 /**\r
-* Builds the date label that will be displayed in the calendar header or\r
-* footer, depending on configuration.\r
-* @return      The formatted calendar month label\r
-* @type String\r
+* The default event function that is attached to a date link within a calendar cell\r
+* when the calendar is rendered.\r
+* @method doSelectCell\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildMonthLabel = function() {\r
-       var text = this.Options.LOCALE_MONTHS[this.pageDate.getMonth()] + " " + this.pageDate.getFullYear();\r
-       return text;\r
-};\r
+YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {\r
+       var target = YAHOO.util.Event.getTarget(e);\r
 \r
-/**\r
-* Builds the date digit that will be displayed in calendar cells\r
-* @return      The formatted day label\r
-* @type        String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildDayLabel = function(workingDate) {\r
-       var day = workingDate.getDate();\r
-       return day;\r
-};\r
+       var cell,index,d,date;\r
 \r
+       while (target.tagName.toLowerCase() != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
+               }\r
+       }\r
 \r
+       cell = target;\r
 \r
-/**\r
-* Builds the calendar table shell that will be filled in with dates and formatting.\r
-* This method calls buildShellHeader, buildShellBody, and buildShellFooter (in that order) \r
-* to construct the pieces of the calendar table. The construction of the shell should\r
-* only happen one time when the calendar is initialized.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildShell = function() {\r
-       \r
-       this.table = document.createElement("TABLE");\r
-       this.table.cellSpacing = 0;     \r
-       YAHOO.widget.Calendar_Core.setCssClasses(this.table, [this.Style.CSS_CALENDAR]);\r
+       if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               index = cell.id.split("cell")[1];\r
+               d = cal.cellDates[index];\r
+               date = new Date(d[0],d[1]-1,d[2]);\r
 \r
-       this.table.id = this.id;\r
-       \r
-       this.buildShellHeader();\r
-       this.buildShellBody();\r
-       this.buildShellFooter();\r
-       \r
-       YAHOO.util.Event.addListener(window, "unload", this._unload, this);\r
-};\r
+               cal.logger.log("Selecting cell " + index + " via click", "info");\r
 \r
-/**\r
-* Builds the calendar shell header by inserting a THEAD into the local calendar table.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildShellHeader = function() {\r
-       var head = document.createElement("THEAD");\r
-       var headRow = document.createElement("TR");\r
+               if (cal.Options.MULTI_SELECT) {\r
+                       link = cell.getElementsByTagName("a")[0];\r
+                       if (link) {\r
+                               link.blur();\r
+                       }\r
 \r
-       var headerCell = document.createElement("TH");\r
-       \r
-       var colSpan = 7;\r
-       if (this.Config.Options.SHOW_WEEK_HEADER) {\r
-               this.weekHeaderCells = new Array();\r
-               colSpan += 1;\r
-       }\r
-       if (this.Config.Options.SHOW_WEEK_FOOTER) {\r
-               this.weekFooterCells = new Array();\r
-               colSpan += 1;\r
-       }       \r
-       \r
-       headerCell.colSpan = colSpan;\r
-       \r
-       YAHOO.widget.Calendar_Core.setCssClasses(headerCell,[this.Style.CSS_HEADER_TEXT]);\r
-\r
-       this.headerCell = headerCell;\r
-\r
-       headRow.appendChild(headerCell);\r
-       head.appendChild(headRow);\r
-\r
-       // Append day labels, if needed\r
-       if (this.Options.SHOW_WEEKDAYS) {\r
-               var row = document.createElement("TR");\r
-               var fillerCell;\r
-\r
-               YAHOO.widget.Calendar_Core.setCssClasses(row,[this.Style.CSS_WEEKDAY_ROW]);\r
-               \r
-               if (this.Config.Options.SHOW_WEEK_HEADER) {\r
-                       fillerCell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       row.appendChild(fillerCell);\r
-               }\r
-               \r
-               for(var i=0;i<this.Options.LOCALE_WEEKDAYS.length;++i) {\r
-                       var cell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       cell.innerHTML=this.Options.LOCALE_WEEKDAYS[i];\r
-                       row.appendChild(cell);\r
-               }\r
+                       var cellDate = cal.cellDates[index];\r
+                       var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);\r
 \r
-               if (this.Config.Options.SHOW_WEEK_FOOTER) {\r
-                       fillerCell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       row.appendChild(fillerCell);\r
+                       if (cellDateIndex > -1) {\r
+                               cal.deselectCell(index);\r
+                       } else {\r
+                               cal.selectCell(index);\r
+                       }\r
+\r
+               } else {\r
+                       link = cell.getElementsByTagName("a")[0];\r
+                       if (link) {\r
+                               link.blur();\r
+                       }\r
+                       cal.selectCell(index);\r
                }\r
-                               \r
-               head.appendChild(row);\r
        }\r
-\r
-       this.table.appendChild(head);\r
 };\r
 \r
 /**\r
-* Builds the calendar shell body (6 weeks by 7 days)\r
+* The event that is executed when the user hovers over a cell\r
+* @method doCellMouseOver\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildShellBody = function() {\r
-       // This should only get executed once\r
-       this.tbody = document.createElement("TBODY");\r
-\r
-       for (var r=0;r<6;++r) {\r
-               var row = document.createElement("TR");\r
-               \r
-               for (var c=0;c<this.headerCell.colSpan;++c) {\r
-                       var cell;\r
-                       if (this.Config.Options.SHOW_WEEK_HEADER && c===0) { // Row header\r
-                               cell = document.createElement("TH");\r
-                               this.weekHeaderCells[this.weekHeaderCells.length] = cell;\r
-                       } else if (this.Config.Options.SHOW_WEEK_FOOTER && c==(this.headerCell.colSpan-1)){ // Row footer\r
-                               cell = document.createElement("TH");\r
-                               this.weekFooterCells[this.weekFooterCells.length] = cell;\r
-                       } else {\r
-                               cell = document.createElement("TD");\r
-                               this.cells[this.cells.length] = cell;\r
-                               YAHOO.widget.Calendar_Core.setCssClasses(cell, [this.Style.CSS_CELL]);\r
-                               YAHOO.util.Event.addListener(cell, "click", this.doSelectCell, this);\r
+YAHOO.widget.Calendar.prototype.doCellMouseOver = function(e, cal) {\r
+       var target;\r
+       if (e) {\r
+               target = YAHOO.util.Event.getTarget(e);\r
+       } else {\r
+               target = this;\r
+       }\r
 \r
-                               YAHOO.util.Event.addListener(cell, "mouseover", this.doCellMouseOver, this);\r
-                               YAHOO.util.Event.addListener(cell, "mouseout", this.doCellMouseOut, this);\r
-                       }\r
-                       row.appendChild(cell);\r
+       while (target.tagName.toLowerCase() != "td") {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
                }\r
-               this.tbody.appendChild(row);\r
        }\r
-       \r
-       this.table.appendChild(this.tbody);\r
+\r
+       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);\r
+       }\r
 };\r
 \r
 /**\r
-* Builds the calendar shell footer. In the default implementation, there is\r
-* no footer.\r
+* The event that is executed when the user moves the mouse out of a cell\r
+* @method doCellMouseOut\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildShellFooter = function() { };\r
+YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {\r
+       var target;\r
+       if (e) {\r
+               target = YAHOO.util.Event.getTarget(e);\r
+       } else {\r
+               target = this;\r
+       }\r
 \r
-/**\r
-* Outputs the calendar shell to the DOM, inserting it into the placeholder element.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderShell = function() {\r
-       this.oDomContainer.appendChild(this.table);\r
-       this.shellRendered = true;\r
-};\r
+       while (target.tagName.toLowerCase() != "td") {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
+               }\r
+       }\r
 \r
-/**\r
-* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute\r
-* when the method is called: renderHeader, renderBody, renderFooter.\r
-* Refer to the documentation for those methods for information on \r
-* individual render tasks.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.render = function() {\r
-       if (! this.shellRendered) {\r
-               this.buildShell();\r
-               this.renderShell();\r
+       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);\r
        }\r
+};\r
 \r
-       this.resetRenderers();\r
+YAHOO.widget.Calendar.prototype.setupConfig = function() {\r
 \r
-       this.cellDates.length = 0;\r
+       /**\r
+       * The month/year representing the current visible Calendar date (mm/yyyy)\r
+       * @config pagedate\r
+       * @type String\r
+       * @default today's date\r
+       */\r
+       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );\r
 \r
-       // Find starting day of the current month\r
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.pageDate);\r
+       /**\r
+       * The date or range of dates representing the current Calendar selection\r
+       * @config selected\r
+       * @type String\r
+       * @default []\r
+       */\r
+       this.cfg.addProperty("selected", { value:[], handler:this.configSelected } );\r
 \r
-       this.renderHeader();\r
-       this.renderBody(workingDate);\r
-       this.renderFooter();\r
+       /**\r
+       * The title to display above the Calendar's month header\r
+       * @config title\r
+       * @type String\r
+       * @default ""\r
+       */\r
+       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );\r
 \r
-       this.onRender();\r
-};\r
+       /**\r
+       * Whether or not a close button should be displayed for this Calendar\r
+       * @config close\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("close", { value:false, handler:this.configClose } );\r
 \r
+       /**\r
+       * 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.\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("iframe", { value:true, handler:this.configIframe, validator:this.cfg.checkBoolean } );\r
 \r
+       /**\r
+       * The minimum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config mindate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("mindate", { value:null, handler:this.configMinDate } );\r
 \r
-/**\r
-* Appends the header contents into the widget header.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderHeader = function() {\r
-       this.logger.log("Rendering header", "info");\r
+       /**\r
+       * The maximum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config maxdate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("maxdate", { value:null, handler:this.configMaxDate } );\r
 \r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
-};\r
 \r
-/**\r
-* Appends the calendar body. The default implementation calculates the number of\r
-* OOM (out of month) cells that need to be rendered at the start of the month, renders those, \r
-* and renders all the day cells using the built-in cell rendering methods.\r
-*\r
-* While iterating through all of the cells, the calendar checks for renderers in the\r
-* local render stack that match the date of the current cell, and then applies styles\r
-* as necessary.\r
-* \r
-* @param {Date}        workingDate     The current working Date object being used to generate the calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderBody = function(workingDate) {\r
-       this.logger.log("Rendering body", "info");\r
+       // Options properties\r
 \r
-       this.preMonthDays = workingDate.getDay();\r
-       if (this.Options.START_WEEKDAY > 0) {\r
-               this.preMonthDays -= this.Options.START_WEEKDAY;\r
-       }\r
-       if (this.preMonthDays < 0) {\r
-               this.preMonthDays += 7;\r
-       }\r
-       \r
-       this.logger.log(this.preMonthDays + " preciding out-of-month days", "info");\r
+       /**\r
+       * True if the Calendar should allow multiple selections. False by default.\r
+       * @config MULTI_SELECT\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
 \r
-       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();\r
-       this.logger.log(this.monthDays + " month days", "info");\r
+       /**\r
+       * The weekday the week begins on. Default is 0 (Sunday).\r
+       * @config START_WEEKDAY\r
+       * @type number\r
+       * @default 0\r
+       */\r
+       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.configOptions, validator:this.cfg.checkNumber  } );\r
 \r
-       this.postMonthDays = YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;\r
-       this.logger.log(this.postMonthDays + " post-month days", "info");\r
-       \r
-       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);\r
-       this.logger.log("Calendar page starts on " + workingDate, "info");\r
-       \r
-       var weekRowIndex = 0;\r
-       \r
-       for (var c=0;c<this.cells.length;++c) {\r
-               var cellRenderers = new Array();\r
-               \r
-               var cell = this.cells[c];\r
-               this.clearElement(cell);\r
-\r
-               cell.index = c;\r
-               cell.id = this.id + "_cell" + c;\r
-               \r
-               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates\r
-\r
-               if (workingDate.getDay() == this.Options.START_WEEKDAY) {\r
-                       var rowHeaderCell = null;\r
-                       var rowFooterCell = null;\r
-                       \r
-                       if (this.Options.SHOW_WEEK_HEADER) {\r
-                               rowHeaderCell = this.weekHeaderCells[weekRowIndex];\r
-                               this.clearElement(rowHeaderCell);\r
-                       }\r
-                       \r
-                       if (this.Options.SHOW_WEEK_FOOTER) {\r
-                               rowFooterCell = this.weekFooterCells[weekRowIndex];\r
-                               this.clearElement(rowFooterCell);\r
-                       }                       \r
-                       \r
-                       if (this.Options.HIDE_BLANK_WEEKS && this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-                               // The first day of the week is not in this month, and it's not an overlap week\r
-                               continue;\r
-                       } else {\r
-                               if (rowHeaderCell) {\r
-                                       this.renderRowHeader(workingDate, rowHeaderCell);\r
-                               }\r
-                               if (rowFooterCell) {\r
-                                       this.renderRowFooter(workingDate, rowFooterCell);\r
-                               }       \r
-                       }\r
-               }\r
+       /**\r
+       * True if the Calendar should show weekday labels. True by default.\r
+       * @config SHOW_WEEKDAYS\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.configOptions, validator:this.cfg.checkBoolean  } );\r
 \r
-               this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");\r
+       /**\r
+       * True if the Calendar should show week row headers. False by default.\r
+       * @config SHOW_WEEK_HEADER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
 \r
-               var renderer = null;\r
-               \r
-               if (workingDate.getFullYear()   == this.today.getFullYear() &&\r
-                       workingDate.getMonth()          == this.today.getMonth() &&\r
-                       workingDate.getDate()           == this.today.getDate()) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellStyleToday;\r
-               }\r
-               \r
-               if (this.isDateOOM(workingDate)) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellNotThisMonth;\r
-               } else {\r
-                       for (var r=0;r<this.renderStack.length;++r) {\r
-                               var rArray = this.renderStack[r];\r
-                               var type = rArray[0];\r
-                               \r
-                               var month;\r
-                               var day;\r
-                               var year;\r
-\r
-                               switch (type) {\r
-                                       case YAHOO.widget.Calendar_Core.DATE:\r
-                                               month = rArray[1][1];\r
-                                               day = rArray[1][2];\r
-                                               year = rArray[1][0];\r
-\r
-                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {\r
-                                                       renderer = rArray[2];\r
-                                                       this.renderStack.splice(r,1);\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.MONTH_DAY:\r
-                                               month = rArray[1][0];\r
-                                               day = rArray[1][1];\r
-                                               \r
-                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {\r
-                                                       renderer = rArray[2];\r
-                                                       this.renderStack.splice(r,1);\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.RANGE:\r
-                                               var date1 = rArray[1][0];\r
-                                               var date2 = rArray[1][1];\r
+       /**\r
+       * True if the Calendar should show week row footers. False by default.\r
+       * @config SHOW_WEEK_FOOTER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
 \r
-                                               var d1month = date1[1];\r
-                                               var d1day = date1[2];\r
-                                               var d1year = date1[0];\r
-                                               \r
-                                               var d1 = new Date(d1year, d1month-1, d1day);\r
+       /**\r
+       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.\r
+       * @config HIDE_BLANK_WEEKS\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
 \r
-                                               var d2month = date2[1];\r
-                                               var d2day = date2[2];\r
-                                               var d2year = date2[0];\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_LEFT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.configOptions } );\r
 \r
-                                               var d2 = new Date(d2year, d2month-1, d2day);\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_RIGHT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.configOptions } );\r
 \r
-                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {\r
-                                                       renderer = rArray[2];\r
+       // Locale properties\r
 \r
-                                                       if (workingDate.getTime()==d2.getTime()) { \r
-                                                               this.renderStack.splice(r,1);\r
-                                                       }\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.WEEKDAY:\r
-                                               \r
-                                               var weekday = rArray[1][0];\r
-                                               if (workingDate.getDay()+1 == weekday) {\r
-                                                       renderer = rArray[2];\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.MONTH:\r
-                                               \r
-                                               month = rArray[1][0];\r
-                                               if (workingDate.getMonth()+1 == month) {\r
-                                                       renderer = rArray[2];\r
-                                               }\r
-                                               break;\r
-                               }\r
-                               \r
-                               if (renderer) {\r
-                                       cellRenderers[cellRenderers.length]=renderer;\r
-                               }\r
-                       }\r
+       /**\r
+       * The short month labels for the current locale.\r
+       * @config MONTHS_SHORT\r
+       * @type String[]\r
+       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]\r
+       */\r
+       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.configLocale } );\r
 \r
-               }\r
+       /**\r
+       * The long month labels for the current locale.\r
+       * @config MONTHS_LONG\r
+       * @type String[]\r
+       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"\r
+       */\r
+       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.configLocale } );\r
 \r
-               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellStyleSelected; \r
-               }\r
+       /**\r
+       * The 1-character weekday labels for the current locale.\r
+       * @config WEEKDAYS_1CHAR\r
+       * @type String[]\r
+       * @default ["S", "M", "T", "W", "T", "F", "S"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.configLocale } );\r
 \r
-               if (this.minDate) {\r
-                       this.minDate = YAHOO.widget.DateMath.clearTime(this.minDate);\r
-               }\r
-               if (this.maxDate) {\r
-                       this.maxDate = YAHOO.widget.DateMath.clearTime(this.maxDate);\r
-               }\r
+       /**\r
+       * The short weekday labels for the current locale.\r
+       * @config WEEKDAYS_SHORT\r
+       * @type String[]\r
+       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.configLocale } );\r
 \r
-               if (\r
-                       (this.minDate && (workingDate.getTime() < this.minDate.getTime())) ||\r
-                       (this.maxDate && (workingDate.getTime() > this.maxDate.getTime()))\r
-               ) {\r
-                       cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;\r
-               } else {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellDefault;     \r
-               }\r
-               \r
-               for (var x=0;x<cellRenderers.length;++x) {\r
-                       var ren = cellRenderers[x];\r
-                       this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");\r
+       /**\r
+       * The medium weekday labels for the current locale.\r
+       * @config WEEKDAYS_MEDIUM\r
+       * @type String[]\r
+       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.configLocale } );\r
 \r
-                       if (ren.call(this,workingDate,cell) == YAHOO.widget.Calendar_Core.STOP_RENDER) {\r
-                               break;\r
-                       }\r
-               }\r
-               \r
-               workingDate = YAHOO.widget.DateMath.add(workingDate, YAHOO.widget.DateMath.DAY, 1); // Go to the next day\r
-               if (workingDate.getDay() == this.Options.START_WEEKDAY) {\r
-                       weekRowIndex += 1;\r
-               }\r
+       /**\r
+       * The long weekday labels for the current locale.\r
+       * @config WEEKDAYS_LONG\r
+       * @type String[]\r
+       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * Refreshes the locale values used to build the Calendar.\r
+       * @method refreshLocale\r
+       * @private\r
+       */\r
+       var refreshLocale = function() {\r
+               this.cfg.refireEvent("LOCALE_MONTHS");\r
+               this.cfg.refireEvent("LOCALE_WEEKDAYS");\r
+       };\r
 \r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);\r
+       this.cfg.subscribeToConfigEvent("START_WEEKDAY", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("MONTHS_SHORT", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("MONTHS_LONG", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_1CHAR", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_SHORT", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_MEDIUM", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_LONG", refreshLocale, this, true);\r
 \r
-               if (c >= 0 && c <= 6) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);\r
-               }\r
-               if ((c % 7) == 0) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);\r
-               }\r
-               if (((c+1) % 7) == 0) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);\r
-               }\r
-               \r
-               var postDays = this.postMonthDays; \r
-               if (postDays >= 7 && this.Options.HIDE_BLANK_WEEKS) {\r
-                       var blankWeeks = Math.floor(postDays/7);\r
-                       for (var p=0;p<blankWeeks;++p) {\r
-                               postDays -= 7;\r
-                       }\r
-               }\r
-               \r
-               if (c >= ((this.preMonthDays+postDays+this.monthDays)-7)) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);\r
-               }\r
-       \r
-               this.logger.log("Final styles for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + "): " + cell.className, "cellrender");\r
+       /**\r
+       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".\r
+       * @config LOCALE_MONTHS\r
+       * @type String\r
+       * @default "long"\r
+       */\r
+       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.configLocaleValues } );\r
 \r
-       }\r
-               \r
-};\r
+       /**\r
+       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".\r
+       * @config LOCALE_WEEKDAYS\r
+       * @type String\r
+       * @default "short"\r
+       */\r
+       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.configLocaleValues } );\r
 \r
-/**\r
-* Appends the contents of the calendar widget footer into the shell. By default, \r
-* the calendar does not contain a footer, and this method must be implemented by \r
-* subclassing the widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderFooter = function() { };\r
+       /**\r
+       * The value used to delimit individual dates in a date string passed to various Calendar functions.\r
+       * @config DATE_DELIMITER\r
+       * @type String\r
+       * @default ","\r
+       */\r
+       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.configLocale } );\r
 \r
-/**\r
-* @private\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._unload = function(e, cal) {\r
-       for (var c in cal.cells) {\r
-               c = null;\r
-       }\r
-       \r
-       cal.cells = null;\r
-       \r
-       cal.tbody = null;\r
-       cal.oDomContainer = null;\r
-       cal.table = null;\r
-       cal.headerCell = null;\r
-       \r
-       cal = null;\r
-};\r
-                                                                                                 \r
-                                                                                                 \r
-/****************** BEGIN BUILT-IN TABLE CELL RENDERERS ************************************/\r
-\r
-YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);\r
-       cell.innerHTML = workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
-}\r
+       /**\r
+       * The value used to delimit date fields in a date string passed to various Calendar functions.\r
+       * @config DATE_FIELD_DELIMITER\r
+       * @type String\r
+       * @default "/"\r
+       */\r
+       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.configLocale } );\r
 \r
-/**\r
-* Renders the row header for a week. The date passed in should be\r
-* the first date of the given week.\r
-* @param {Date}                                        workingDate             The current working Date object (beginning of the week) being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderRowHeader = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_ROW_HEADER);\r
-       \r
-       var useYear = this.pageDate.getFullYear();\r
-       \r
-       if (! YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)) {\r
-               useYear = workingDate.getFullYear();\r
-       }\r
-       \r
-       var weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useYear, this.Options.START_WEEKDAY);\r
-       cell.innerHTML = weekNum;\r
-       \r
-       if (this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM); \r
-       }\r
+       /**\r
+       * The value used to delimit date ranges in a date string passed to various Calendar functions.\r
+       * @config DATE_RANGE_DELIMITER\r
+       * @type String\r
+       * @default "-"\r
+       */\r
+       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.configLocale } );\r
+\r
+       /**\r
+       * The position of the month in a month/year date string\r
+       * @config MY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/year date string\r
+       * @config MY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day date string\r
+       * @config MD_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/year date string\r
+       * @config MD_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day/year date string\r
+       * @config MDY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/day/year date string\r
+       * @config MDY_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/day/year date string\r
+       * @config MDY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 3\r
+       */\r
+       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
 };\r
 \r
 /**\r
-* Renders the row footer for a week. The date passed in should be\r
-* the first date of the given week.\r
-* @param {Date}                                        workingDate             The current working Date object (beginning of the week) being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* The default handler for the "pagedate" property\r
+* @method configPageDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderRowFooter = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_ROW_FOOTER);\r
-       \r
-       if (this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM); \r
+YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       var month, year, aMonthYear;\r
+\r
+       if (val) {\r
+               if (val instanceof Date) {\r
+                       val = YAHOO.widget.DateMath.findMonthStart(val);\r
+                       this.cfg.setProperty("pagedate", val, true);\r
+                       if (! this._pageDate) {\r
+                               this._pageDate = this.cfg.getProperty("pagedate");\r
+                       }\r
+                       return;\r
+               } else {\r
+                       aMonthYear = val.split(this.cfg.getProperty("DATE_FIELD_DELIMITER"));\r
+                       month = parseInt(aMonthYear[this.cfg.getProperty("MY_MONTH_POSITION")-1], 10)-1;\r
+                       year = parseInt(aMonthYear[this.cfg.getProperty("MY_YEAR_POSITION")-1], 10);\r
+               }\r
+       } else {\r
+               month = this.today.getMonth();\r
+               year = this.today.getFullYear();\r
        }\r
-};\r
 \r
-/**\r
-* Renders a single standard calendar cell in the calendar widget table.\r
-* All logic for determining how a standard default cell will be rendered is \r
-* encapsulated in this method, and must be accounted for when extending the\r
-* widget class.\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellDefault = function(workingDate, cell) {\r
-       cell.innerHTML = "";\r
-       var link = document.createElement("a");\r
+       this.cfg.setProperty("pagedate", new Date(year, month, 1), true);\r
 \r
-       link.href="javascript:void(null);";\r
-       link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();\r
+       this.logger.log("Set month/year to " + month + "/" + year, "info");\r
 \r
-       link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));\r
-       cell.appendChild(link);\r
+       if (! this._pageDate) {\r
+               this._pageDate = this.cfg.getProperty("pagedate");\r
+       }\r
 };\r
 \r
 /**\r
-* Renders a single standard calendar cell using the CSS hightlight1 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for the "mindate" property\r
+* @method configMinDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);\r
+YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       if (typeof val == 'string') {\r
+               val = this._parseDate(val);\r
+               this.cfg.setProperty("mindate", new Date(val[0],(val[1]-1),val[2]));\r
+       }\r
 };\r
 \r
 /**\r
-* Renders a single standard calendar cell using the CSS hightlight2 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for the "maxdate" property\r
+* @method configMaxDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);\r
+YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       if (typeof val == 'string') {\r
+               val = this._parseDate(val);\r
+               this.cfg.setProperty("maxdate", new Date(val[0],(val[1]-1),val[2]));\r
+       }\r
 };\r
 \r
 /**\r
-* Renders a single standard calendar cell using the CSS hightlight3 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for the "selected" property\r
+* @method configSelected\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);\r
-};\r
+YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {\r
+       var selected = args[0];\r
 \r
-/**\r
-* Renders a single standard calendar cell using the CSS hightlight4 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);\r
+       if (selected) {\r
+               if (typeof selected == 'string') {\r
+                       this.cfg.setProperty("selected", this._parseDates(selected), true);\r
+               }\r
+       }\r
+       if (! this._selectedDates) {\r
+               this._selectedDates = this.cfg.getProperty("selected");\r
+       }\r
 };\r
 \r
 /**\r
-* Applies the default style used for rendering today's date to the current calendar cell\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for all configuration options properties\r
+* @method configOptions\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);\r
+YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+       this.Options[type] = val;\r
 };\r
 \r
 /**\r
-* Applies the default style used for rendering selected dates to the current calendar cell\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for all configuration locale properties\r
+* @method configLocale\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);\r
+YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+       this.Locale[type] = val;\r
+\r
+       this.cfg.refireEvent("LOCALE_MONTHS");\r
+       this.cfg.refireEvent("LOCALE_WEEKDAYS");\r
+\r
 };\r
 \r
 /**\r
-* Applies the default style used for rendering dates that are not a part of the current\r
-* month (preceding or trailing the cells for the current month)\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* The default handler for all configuration locale field length properties\r
+* @method configLocaleValues\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);\r
-       cell.innerHTML=workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
+YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+\r
+       switch (type) {\r
+               case "LOCALE_MONTHS":\r
+                       switch (val) {\r
+                               case "short":\r
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_SHORT").concat();\r
+                                       break;\r
+                               case "long":\r
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_LONG").concat();\r
+                                       break;\r
+                       }\r
+                       break;\r
+               case "LOCALE_WEEKDAYS":\r
+                       switch (val) {\r
+                               case "1char":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_1CHAR").concat();\r
+                                       break;\r
+                               case "short":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_SHORT").concat();\r
+                                       break;\r
+                               case "medium":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();\r
+                                       break;\r
+                               case "long":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_LONG").concat();\r
+                                       break;\r
+                       }\r
+\r
+                       var START_WEEKDAY = this.cfg.getProperty("START_WEEKDAY");\r
+\r
+                       if (START_WEEKDAY > 0) {\r
+                               for (var w=0;w<START_WEEKDAY;++w) {\r
+                                       this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());\r
+                               }\r
+                       }\r
+                       break;\r
+       }\r
 };\r
 \r
 /**\r
-* Renders the current calendar cell as a non-selectable "black-out" date using the default\r
-* restricted style.\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
+* Defines the style constants for the Calendar\r
+* @method initStyles\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted = function(workingDate, cell) {\r
-       YAHOO.widget.Calendar_Core.setCssClasses(cell, [this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);\r
-       cell.innerHTML=workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
+YAHOO.widget.Calendar.prototype.initStyles = function() {\r
+\r
+       /**\r
+       * Collection of Style constants for the Calendar\r
+       * @property Style\r
+       */\r
+       this.Style = {\r
+               /**\r
+               * @property Style.CSS_ROW_HEADER\r
+               */\r
+               CSS_ROW_HEADER: "calrowhead",\r
+               /**\r
+               * @property Style.CSS_ROW_FOOTER\r
+               */\r
+               CSS_ROW_FOOTER: "calrowfoot",\r
+               /**\r
+               * @property Style.CSS_CELL\r
+               */\r
+               CSS_CELL : "calcell",\r
+               /**\r
+               * @property Style.CSS_CELL_SELECTED\r
+               */\r
+               CSS_CELL_SELECTED : "selected",\r
+               /**\r
+               * @property Style.CSS_CELL_SELECTABLE\r
+               */\r
+               CSS_CELL_SELECTABLE : "selectable",\r
+               /**\r
+               * @property Style.CSS_CELL_RESTRICTED\r
+               */\r
+               CSS_CELL_RESTRICTED : "restricted",\r
+               /**\r
+               * @property Style.CSS_CELL_TODAY\r
+               */\r
+               CSS_CELL_TODAY : "today",\r
+               /**\r
+               * @property Style.CSS_CELL_OOM\r
+               */\r
+               CSS_CELL_OOM : "oom",\r
+               /**\r
+               * @property Style.CSS_CELL_OOB\r
+               */\r
+               CSS_CELL_OOB : "previous",\r
+               /**\r
+               * @property Style.CSS_HEADER\r
+               */\r
+               CSS_HEADER : "calheader",\r
+               /**\r
+               * @property Style.CSS_HEADER_TEXT\r
+               */\r
+               CSS_HEADER_TEXT : "calhead",\r
+               /**\r
+               * @property Style.CSS_WEEKDAY_CELL\r
+               */\r
+               CSS_WEEKDAY_CELL : "calweekdaycell",\r
+               /**\r
+               * @property Style.CSS_WEEKDAY_ROW\r
+               */\r
+               CSS_WEEKDAY_ROW : "calweekdayrow",\r
+               /**\r
+               * @property Style.CSS_FOOTER\r
+               */\r
+               CSS_FOOTER : "calfoot",\r
+               /**\r
+               * @property Style.CSS_CALENDAR\r
+               */\r
+               CSS_CALENDAR : "yui-calendar",\r
+               /**\r
+               * @property Style.CSS_SINGLE\r
+               */\r
+               CSS_SINGLE : "single",\r
+               /**\r
+               * @property Style.CSS_CONTAINER\r
+               */\r
+               CSS_CONTAINER : "yui-calcontainer",\r
+               /**\r
+               * @property Style.CSS_NAV_LEFT\r
+               */\r
+               CSS_NAV_LEFT : "calnavleft",\r
+               /**\r
+               * @property Style.CSS_NAV_RIGHT\r
+               */\r
+               CSS_NAV_RIGHT : "calnavright",\r
+               /**\r
+               * @property Style.CSS_CELL_TOP\r
+               */\r
+               CSS_CELL_TOP : "calcelltop",\r
+               /**\r
+               * @property Style.CSS_CELL_LEFT\r
+               */\r
+               CSS_CELL_LEFT : "calcellleft",\r
+               /**\r
+               * @property Style.CSS_CELL_RIGHT\r
+               */\r
+               CSS_CELL_RIGHT : "calcellright",\r
+               /**\r
+               * @property Style.CSS_CELL_BOTTOM\r
+               */\r
+               CSS_CELL_BOTTOM : "calcellbottom",\r
+               /**\r
+               * @property Style.CSS_CELL_HOVER\r
+               */\r
+               CSS_CELL_HOVER : "calcellhover",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT1\r
+               */\r
+               CSS_CELL_HIGHLIGHT1 : "highlight1",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT2\r
+               */\r
+               CSS_CELL_HIGHLIGHT2 : "highlight2",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT3\r
+               */\r
+               CSS_CELL_HIGHLIGHT3 : "highlight3",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT4\r
+               */\r
+               CSS_CELL_HIGHLIGHT4 : "highlight4"\r
+       };\r
 };\r
-/******************** END BUILT-IN TABLE CELL RENDERERS ************************************/\r
 \r
-/******************** BEGIN MONTH NAVIGATION METHODS ************************************/\r
 /**\r
-* Adds the designated number of months to the current calendar month, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of months to add to the current calendar\r
+* Builds the date label that will be displayed in the calendar header or\r
+* footer, depending on configuration.\r
+* @method buildMonthLabel\r
+* @return      {String}        The formatted calendar month label\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.addMonths = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.add(this.pageDate, YAHOO.widget.DateMath.MONTH, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
+YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {\r
+       var text = this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()] + " " + this.cfg.getProperty("pagedate").getFullYear();\r
+       return text;\r
 };\r
 \r
 /**\r
-* Subtracts the designated number of months from the current calendar month, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of months to subtract from the current calendar\r
+* Builds the date digit that will be displayed in calendar cells\r
+* @method buildDayLabel\r
+* @param {Date}        workingDate     The current working date\r
+* @return      {String}        The formatted day label\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.subtractMonths = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.subtract(this.pageDate, YAHOO.widget.DateMath.MONTH, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
+YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {\r
+       var day = workingDate.getDate();\r
+       return day;\r
 };\r
 \r
 /**\r
-* Adds the designated number of years to the current calendar, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of years to add to the current calendar\r
+* Renders the calendar header.\r
+* @method renderHeader\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.addYears = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.add(this.pageDate, YAHOO.widget.DateMath.YEAR, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
-};\r
+YAHOO.widget.Calendar.prototype.renderHeader = function(html) {\r
+       this.logger.log("Rendering header", "info");\r
 \r
-/**\r
-* Subtcats the designated number of years from the current calendar, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of years to subtract from the current calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.subtractYears = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.subtract(this.pageDate, YAHOO.widget.DateMath.YEAR, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
-};\r
+       var colSpan = 7;\r
 \r
-/**\r
-* Navigates to the next month page in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.nextMonth = function() {\r
-       this.addMonths(1);\r
-};\r
+       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {\r
+               colSpan += 1;\r
+       }\r
 \r
-/**\r
-* Navigates to the previous month page in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.previousMonth = function() {\r
-       this.subtractMonths(1);\r
-};\r
+       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {\r
+               colSpan += 1;\r
+       }\r
 \r
-/**\r
-* Navigates to the next year in the currently selected month in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.nextYear = function() {\r
-       this.addYears(1);\r
-};\r
+       html[html.length] = "<thead>";\r
+       html[html.length] =             "<tr>";\r
+       html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';\r
+       html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';\r
 \r
-/**\r
-* Navigates to the previous year in the currently selected month in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.previousYear = function() {\r
-       this.subtractYears(1);\r
-};\r
+               var renderLeft, renderRight = false;\r
 \r
-/****************** END MONTH NAVIGATION METHODS ************************************/\r
+               if (this.parent) {\r
+                       if (this.index === 0) {\r
+                               renderLeft = true;\r
+                       }\r
+                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {\r
+                               renderRight = true;\r
+                       }\r
+               } else {\r
+                       renderLeft = true;\r
+                       renderRight = true;\r
+               }\r
 \r
-/************* BEGIN SELECTION METHODS *************************************************************/\r
+               var cal = this.parent || this;\r
 \r
-/**\r
-* Resets the calendar widget to the originally selected month and year, and \r
-* sets the calendar to the initial selection(s).\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.reset = function() {\r
-       this.selectedDates.length = 0;\r
-       this.selectedDates = this._selectedDates.concat();\r
+               if (renderLeft) {\r
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_LEFT") + ')">&#160;</a>';\r
+               }\r
 \r
-       this.pageDate = new Date(this._pageDate.getTime());\r
-       this.onReset();\r
-};\r
+               html[html.length] = this.buildMonthLabel();\r
 \r
-/**\r
-* Clears the selected dates in the current calendar widget and sets the calendar\r
-* to the current month and year.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.clear = function() {\r
-       this.selectedDates.length = 0;\r
-       this.pageDate = new Date(this.today.getTime());\r
-       this.onClear();\r
+               if (renderRight) {\r
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_RIGHT") + ')">&#160;</a>';\r
+               }\r
+\r
+\r
+       html[html.length] =                             '</div>';\r
+       html[html.length] =                     '</th>';\r
+       html[html.length] =             '</tr>';\r
+\r
+       if (this.cfg.getProperty("SHOW_WEEKDAYS")) {\r
+               html = this.buildWeekdays(html);\r
+       }\r
+\r
+       html[html.length] = '</thead>';\r
+\r
+       return html;\r
 };\r
 \r
 /**\r
-* Selects a date or a collection of dates on the current calendar. This method, by default,\r
-* does not call the render method explicitly. Once selection has completed, render must be \r
-* called for the changes to be reflected visually.\r
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
-* @return                                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
+* Renders the Calendar's weekday headers.\r
+* @method buildWeekdays\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.select = function(date) {\r
-       this.onBeforeSelect();\r
-       this.logger.log("Select: " + date, "info");\r
+YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {\r
 \r
-       var aToBeSelected = this._toFieldArray(date);\r
-       this.logger.log("Selection field array: " + aToBeSelected, "info");\r
+       html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';\r
 \r
-       for (var a=0;a<aToBeSelected.length;++a) {\r
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
-               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?\r
-                       this.selectedDates[this.selectedDates.length]=toSelect;\r
-               }\r
+       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {\r
+               html[html.length] = '<th>&#160;</th>';\r
        }\r
-       \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
+\r
+       for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {\r
+               html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';\r
+       }\r
+\r
+       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {\r
+               html[html.length] = '<th>&#160;</th>';\r
        }\r
 \r
-       this.onSelect();\r
+       html[html.length] = '</tr>';\r
 \r
-       return this.getSelectedDates();\r
+       return html;\r
 };\r
 \r
 /**\r
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
-* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
-* a full render. The selected style is applied to the cell directly.\r
-* @param       {Integer}       cellIndex       The index of the cell to select in the current calendar. \r
-* @return                                                      Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
+* Renders the calendar body.\r
+* @method renderBody\r
+* @param {Date}        workingDate     The current working Date being used for the render process\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.selectCell = function(cellIndex) {\r
-       this.onBeforeSelect();\r
+YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {\r
+       this.logger.log("Rendering body", "info");\r
 \r
-       this.cells = this.tbody.getElementsByTagName("TD");\r
+       var startDay = this.cfg.getProperty("START_WEEKDAY");\r
 \r
-       var cell = this.cells[cellIndex];\r
-       var cellDate = this.cellDates[cellIndex];\r
+       this.preMonthDays = workingDate.getDay();\r
+       if (startDay > 0) {\r
+               this.preMonthDays -= startDay;\r
+       }\r
+       if (this.preMonthDays < 0) {\r
+               this.preMonthDays += 7;\r
+       }\r
 \r
-       var dCellDate = this._toDate(cellDate);\r
-       this.logger.log("Select: " + dCellDate, "info");\r
+       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();\r
+       this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;\r
 \r
-       var selectDate = cellDate.concat();\r
+       this.logger.log(this.preMonthDays + " preciding out-of-month days", "info");\r
+       this.logger.log(this.monthDays + " month days", "info");\r
+       this.logger.log(this.postMonthDays + " post-month days", "info");\r
 \r
-       this.selectedDates.push(selectDate);\r
-       \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       }\r
+       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);\r
+       this.logger.log("Calendar page starts on " + workingDate, "info");\r
 \r
-       this.renderCellStyleSelected(dCellDate,cell);\r
+       var useDate,weekNum,weekClass;\r
+       useDate = this.cfg.getProperty("pagedate");\r
 \r
-       this.onSelect();\r
-       this.doCellMouseOut.call(cell, null, this);\r
+       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + '">';\r
 \r
-       return this.getSelectedDates();\r
-};\r
+       var i = 0;\r
 \r
-/**\r
-* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
-* does not call the render method explicitly. Once deselection has completed, render must be \r
-* called for the changes to be reflected visually.\r
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. \r
-* @return                                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.deselect = function(date) {\r
-       this.onBeforeDeselect();\r
+       var tempDiv = document.createElement("div");\r
+       var cell = document.createElement("td");\r
+       tempDiv.appendChild(cell);\r
 \r
-       var aToBeSelected = this._toFieldArray(date);\r
+       var jan1 = new Date(useDate.getFullYear(),0,1);\r
 \r
-       this.logger.log("Select: " + aToBeSelected, "info");\r
+       var cal = this.parent || this;\r
 \r
-       for (var a=0;a<aToBeSelected.length;++a) {\r
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
-               var index = this._indexOfSelectedFieldArray(toSelect);\r
-       \r
-               if (index != -1) {      \r
-                       this.selectedDates.splice(index,1);\r
-               }\r
-       }\r
+       for (var r=0;r<6;r++) {\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       } \r
+               weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);\r
 \r
-       this.onDeselect();\r
-       return this.getSelectedDates();\r
-};\r
+               weekClass = "w" + weekNum;\r
 \r
-/**\r
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
-* a full render. The selected style is removed from the cell directly.\r
-* @param       {Integer}       cellIndex       The index of the cell to deselect in the current calendar. \r
-* @return                                                      Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.deselectCell = function(i) {\r
-       this.onBeforeDeselect();\r
-       this.cells = this.tbody.getElementsByTagName("TD");\r
+               if (r !== 0 && this.isDateOOM(workingDate) && this.cfg.getProperty("HIDE_BLANK_WEEKS") === true) {\r
+                       break;\r
+               } else {\r
 \r
-       var cell = this.cells[i];\r
-       var cellDate = this.cellDates[i];\r
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);\r
+                       html[html.length] = '<tr class="' + weekClass + '">';\r
 \r
-       var dCellDate = this._toDate(cellDate);\r
-       this.logger.log("Deselect: " + dCellDate, "info");\r
+                       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) { html = this.renderRowHeader(weekNum, html); }\r
 \r
-       var selectDate = cellDate.concat();\r
+                       for (var d=0;d<7;d++){ // Render actual days\r
 \r
-       if (cellDateIndex > -1) {\r
-               if (this.pageDate.getMonth() == dCellDate.getMonth() &&\r
-                       this.pageDate.getFullYear() == dCellDate.getFullYear()) {\r
-                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);\r
-               }\r
+                               var cellRenderers = [];\r
 \r
-               this.selectedDates.splice(cellDateIndex, 1);\r
-       }\r
+                               this.clearElement(cell);\r
 \r
+                               YAHOO.util.Dom.addClass(cell, "calcell");\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       }\r
+                               cell.id = this.id + "_cell" + i;\r
+                               this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");\r
 \r
-       this.onDeselect();\r
-       return this.getSelectedDates();\r
-};\r
+                               cell.innerHTML = i;\r
 \r
-/**\r
-* Deselects all dates on the current calendar.\r
-* @return                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-*                                              Assuming that this function executes properly, the return value should be an empty array.\r
-*                                              However, the empty array is returned for the sake of being able to check the selection status\r
-*                                              of the calendar.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.deselectAll = function() {\r
-       this.onBeforeDeselect();\r
-       var count = this.selectedDates.length;\r
-       this.selectedDates.length = 0;\r
+                               var renderer = null;\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       }\r
-       \r
-       if (count > 0) {\r
-               this.onDeselect();\r
-       }\r
+                               if (workingDate.getFullYear()   == this.today.getFullYear() &&\r
+                                       workingDate.getMonth()          == this.today.getMonth() &&\r
+                                       workingDate.getDate()           == this.today.getDate()) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;\r
+                               }\r
 \r
-       return this.getSelectedDates();\r
-};\r
-/************* END SELECTION METHODS *************************************************************/\r
+                               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates\r
 \r
+                               if (this.isDateOOM(workingDate)) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;\r
+                               } else {\r
 \r
-/************* BEGIN TYPE CONVERSION METHODS ****************************************************/\r
+                                       YAHOO.util.Dom.addClass(cell, "wd" + workingDate.getDay());\r
+                                       YAHOO.util.Dom.addClass(cell, "d" + workingDate.getDate());\r
+\r
+                                       for (var s=0;s<this.renderStack.length;++s) {\r
+\r
+                                               var rArray = this.renderStack[s];\r
+                                               var type = rArray[0];\r
+\r
+                                               var month;\r
+                                               var day;\r
+                                               var year;\r
+\r
+                                               switch (type) {\r
+                                                       case YAHOO.widget.Calendar.DATE:\r
+                                                               month = rArray[1][1];\r
+                                                               day = rArray[1][2];\r
+                                                               year = rArray[1][0];\r
+\r
+                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {\r
+                                                                       renderer = rArray[2];\r
+                                                                       this.renderStack.splice(s,1);\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.MONTH_DAY:\r
+                                                               month = rArray[1][0];\r
+                                                               day = rArray[1][1];\r
+\r
+                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {\r
+                                                                       renderer = rArray[2];\r
+                                                                       this.renderStack.splice(s,1);\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.RANGE:\r
+                                                               var date1 = rArray[1][0];\r
+                                                               var date2 = rArray[1][1];\r
+\r
+                                                               var d1month = date1[1];\r
+                                                               var d1day = date1[2];\r
+                                                               var d1year = date1[0];\r
+\r
+                                                               var d1 = new Date(d1year, d1month-1, d1day);\r
+\r
+                                                               var d2month = date2[1];\r
+                                                               var d2day = date2[2];\r
+                                                               var d2year = date2[0];\r
+\r
+                                                               var d2 = new Date(d2year, d2month-1, d2day);\r
+\r
+                                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {\r
+                                                                       renderer = rArray[2];\r
+\r
+                                                                       if (workingDate.getTime()==d2.getTime()) {\r
+                                                                               this.renderStack.splice(s,1);\r
+                                                                       }\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.WEEKDAY:\r
+\r
+                                                               var weekday = rArray[1][0];\r
+                                                               if (workingDate.getDay()+1 == weekday) {\r
+                                                                       renderer = rArray[2];\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.MONTH:\r
+\r
+                                                               month = rArray[1][0];\r
+                                                               if (workingDate.getMonth()+1 == month) {\r
+                                                                       renderer = rArray[2];\r
+                                                               }\r
+                                                               break;\r
+                                               }\r
 \r
-/**\r
-* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure\r
-* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].\r
-* @private\r
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. \r
-* @return                                              Array of date field arrays\r
-* @type Array[](Integer[])\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._toFieldArray = function(date) {\r
-       var returnDate = new Array();\r
+                                               if (renderer) {\r
+                                                       cellRenderers[cellRenderers.length]=renderer;\r
+                                               }\r
+                                       }\r
 \r
-       if (date instanceof Date) {\r
-               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];\r
-       } else if (typeof date == 'string') {\r
-               returnDate = this._parseDates(date);\r
-       } else if (date instanceof Array) {\r
-               for (var i=0;i<date.length;++i) {\r
-                       var d = date[i];\r
-                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];\r
-               }\r
-       }\r
-       \r
-       return returnDate;\r
-};\r
+                               }\r
 \r
-/**\r
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
-* @private\r
-* @param       {Integer[]}             dateFieldArray  The date field array to convert to a JavaScript Date.\r
-* @return                                      JavaScript Date object representing the date field array\r
-* @type Date\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._toDate = function(dateFieldArray) {\r
-       if (dateFieldArray instanceof Date) {\r
-               return dateFieldArray;\r
-       } else {\r
-               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);\r
-       }\r
-};\r
-/************* END TYPE CONVERSION METHODS ******************************************************/\r
+                               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;\r
+                               }\r
 \r
+                               var mindate = this.cfg.getProperty("mindate");\r
+                               var maxdate = this.cfg.getProperty("maxdate");\r
 \r
-/************* BEGIN UTILITY METHODS ****************************************************/\r
-/**\r
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
-* @private\r
-* @param       {Integer[]}     array1  The first date field array to compare\r
-* @param       {Integer[]}     array2  The first date field array to compare\r
-* @return                                              The boolean that represents the equality of the two arrays\r
-* @type Boolean\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual = function(array1, array2) {\r
-       var match = false;\r
+                               if (mindate) {\r
+                                       mindate = YAHOO.widget.DateMath.clearTime(mindate);\r
+                               }\r
+                               if (maxdate) {\r
+                                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);\r
+                               }\r
 \r
-       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {\r
-               match=true;     \r
-       }\r
+                               if (\r
+                                       (mindate && (workingDate.getTime() < mindate.getTime())) ||\r
+                                       (maxdate && (workingDate.getTime() > maxdate.getTime()))\r
+                               ) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;\r
+                               } else {\r
+                                       cellRenderers[cellRenderers.length]=cal.styleCellDefault;\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellDefault;\r
+                               }\r
 \r
-       return match;\r
-};\r
 \r
-/**\r
-* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.\r
-* @private\r
-* @param       {Integer[]}             find    The date field array to search for\r
-* @return                                      The index of the date field array within the collection of selected dates.\r
-*                                                              -1 will be returned if the date is not found.\r
-* @type Integer\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray = function(find) {\r
-       var selected = -1;\r
 \r
-       for (var s=0;s<this.selectedDates.length;++s) {\r
-               var sArray = this.selectedDates[s];\r
-               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {\r
-                       selected = s;\r
-                       break;\r
-               }\r
-       }\r
+                               for (var x=0;x<cellRenderers.length;++x) {\r
+                                       var ren = cellRenderers[x];\r
+                                       this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");\r
 \r
-       return selected;\r
-};\r
+                                       if (ren.call((this.parent || this),workingDate,cell) == YAHOO.widget.Calendar.STOP_RENDER) {\r
+                                               break;\r
+                                       }\r
+                               }\r
 \r
-/**\r
-* Determines whether a given date is OOM (out of month).\r
-* @param       {Date}  date    The JavaScript Date object for which to check the OOM status\r
-* @return      {Boolean}       true if the date is OOM\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.isDateOOM = function(date) {\r
-       var isOOM = false;\r
-       if (date.getMonth() != this.pageDate.getMonth()) {\r
-               isOOM = true;\r
-       }\r
-       return isOOM;\r
-};\r
+                               workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);\r
+\r
+                               if (i >= 0 && i <= 6) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);\r
+                               }\r
+                               if ((i % 7) === 0) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);\r
+                               }\r
+                               if (((i+1) % 7) === 0) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);\r
+                               }\r
+\r
+                               var postDays = this.postMonthDays;\r
+                               if (postDays >= 7 && this.cfg.getProperty("HIDE_BLANK_WEEKS")) {\r
+                                       var blankWeeks = Math.floor(postDays/7);\r
+                                       for (var p=0;p<blankWeeks;++p) {\r
+                                               postDays -= 7;\r
+                                       }\r
+                               }\r
 \r
-/************* END UTILITY METHODS *******************************************************/\r
+                               if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);\r
+                               }\r
 \r
-/************* BEGIN EVENT HANDLERS ******************************************************/\r
+                               html[html.length] = tempDiv.innerHTML;\r
 \r
-/**\r
-* Event executed before a date is selected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onBeforeSelect = function() {\r
-       if (! this.Options.MULTI_SELECT) {\r
-               this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);\r
-               this.deselectAll();\r
+                               i++;\r
+                       }\r
+\r
+                       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) { html = this.renderRowFooter(weekNum, html); }\r
+\r
+                       html[html.length] = '</tr>';\r
+               }\r
        }\r
-};\r
 \r
-/**\r
-* Event executed when a date is selected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onSelect = function() { };\r
+       html[html.length] = '</tbody>';\r
 \r
-/**\r
-* Event executed before a date is deselected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onBeforeDeselect = function() { };\r
+       return html;\r
+};\r
 \r
 /**\r
-* Event executed when a date is deselected in the calendar widget.\r
+* Renders the calendar footer. In the default implementation, there is\r
+* no footer.\r
+* @method renderFooter\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.onDeselect = function() { };\r
+YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };\r
 \r
 /**\r
-* Event executed when the user navigates to a different calendar page.\r
+* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute\r
+* when the method is called: renderHeader, renderBody, renderFooter.\r
+* Refer to the documentation for those methods for information on\r
+* individual render tasks.\r
+* @method render\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.onChangePage = function() {\r
-               var me = this;\r
+YAHOO.widget.Calendar.prototype.render = function() {\r
+       this.beforeRenderEvent.fire();\r
 \r
-               this.renderHeader();\r
-               if (this.renderProcId) {\r
-                       clearTimeout(this.renderProcId);\r
+       // Find starting day of the current month\r
+       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));\r
+\r
+       this.resetRenderers();\r
+       this.cellDates.length = 0;\r
+\r
+       YAHOO.util.Event.purgeElement(this.oDomContainer, true);\r
+\r
+       var html = [];\r
+\r
+       html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';\r
+       html = this.renderHeader(html);\r
+       html = this.renderBody(workingDate, html);\r
+       html = this.renderFooter(html);\r
+       html[html.length] = '</table>';\r
+\r
+       this.oDomContainer.innerHTML = html.join("\n");\r
+\r
+       this.applyListeners();\r
+       this.cells = this.oDomContainer.getElementsByTagName("td");\r
+\r
+       this.cfg.refireEvent("title");\r
+       this.cfg.refireEvent("close");\r
+       this.cfg.refireEvent("iframe");\r
+\r
+       this.renderEvent.fire();\r
+};\r
+\r
+/**\r
+* Applies the Calendar's DOM listeners to applicable elements.\r
+* @method applyListeners\r
+*/\r
+YAHOO.widget.Calendar.prototype.applyListeners = function() {\r
+\r
+       var root = this.oDomContainer;\r
+       var cal = this.parent || this;\r
+\r
+       var linkLeft, linkRight;\r
+\r
+       linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, "a", root);\r
+       linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, "a", root);\r
+\r
+       if (linkLeft) {\r
+               this.linkLeft = linkLeft[0];\r
+               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", cal.previousMonth, cal, true);\r
+       }\r
+\r
+       if (linkRight) {\r
+               this.linkRight = linkRight[0];\r
+               YAHOO.util.Event.addListener(this.linkRight, "mousedown", cal.nextMonth, cal, true);\r
+       }\r
+\r
+       if (this.domEventMap) {\r
+               var el,elements;\r
+               for (var cls in this.domEventMap) {\r
+                       if (this.domEventMap.hasOwnProperty(cls)) {\r
+                               var items = this.domEventMap[cls];\r
+\r
+                               if (! (items instanceof Array)) {\r
+                                       items = [items];\r
+                               }\r
+\r
+                               for (var i=0;i<items.length;i++)        {\r
+                                       var item = items[i];\r
+                                       elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);\r
+\r
+                                       for (var c=0;c<elements.length;c++) {\r
+                                               el = elements[c];\r
+                                                YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );\r
+                                       }\r
+                               }\r
+                       }\r
                }\r
-               this.renderProcId = setTimeout(function() {\r
-                                                                                       me.render();\r
-                                                                                       me.renderProcId = null;\r
-                                                                               }, 1);\r
+       }\r
+\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);\r
 };\r
 \r
 /**\r
-* Event executed when the calendar widget is rendered.\r
+* Retrieves the Date object for the specified Calendar cell\r
+* @method getDateByCellId\r
+* @param {String}      id      The id of the cell\r
+* @return {Date} The Date object for the specified Calendar cell\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.onRender = function() { };\r
+YAHOO.widget.Calendar.prototype.getDateByCellId = function(id) {\r
+       var date = this.getDateFieldsByCellId(id);\r
+       return new Date(date[0],date[1]-1,date[2]);\r
+};\r
 \r
 /**\r
-* Event executed when the calendar widget is reset to its original state.\r
+* Retrieves the Date object for the specified Calendar cell\r
+* @method getDateFieldsByCellId\r
+* @param {String}      id      The id of the cell\r
+* @return {Array}      The array of Date fields for the specified Calendar cell\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.onReset = function() { this.render(); };\r
+YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {\r
+       id = id.toLowerCase().split("_cell")[1];\r
+       id = parseInt(id, 10);\r
+       return this.cellDates[id];\r
+};\r
+\r
+// BEGIN BUILT-IN TABLE CELL RENDERERS\r
 \r
 /**\r
-* Event executed when the calendar widget is completely cleared to the current month with no selections.\r
+* Renders a cell that falls before the minimum date or after the maximum date.\r
+* widget class.\r
+* @method renderOutOfBoundsDate\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.onClear = function() { this.render(); };\r
+YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);\r
+       cell.innerHTML = workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
+};\r
 \r
 /**\r
-* Validates the calendar widget. This method has no default implementation\r
-* and must be extended by subclassing the widget.\r
-* @return      Should return true if the widget validates, and false if\r
-* it doesn't.\r
-* @type Boolean\r
+* Renders the row header for a week.\r
+* @method renderRowHeader\r
+* @param {Number}      weekNum The week number of the current row\r
+* @param {Array}       cell    The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.validate = function() { return true; };\r
+YAHOO.widget.Calendar.prototype.renderRowHeader = function(weekNum, html) {\r
+       html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';\r
+       return html;\r
+};\r
 \r
-/************* END EVENT HANDLERS *********************************************************/\r
+/**\r
+* Renders the row footer for a week.\r
+* @method renderRowFooter\r
+* @param {Number}      weekNum The week number of the current row\r
+* @param {Array}       cell    The current working HTML array\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {\r
+       html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';\r
+       return html;\r
+};\r
 \r
+/**\r
+* Renders a single standard calendar cell in the calendar widget table.\r
+* All logic for determining how a standard default cell will be rendered is\r
+* encapsulated in this method, and must be accounted for when extending the\r
+* widget class.\r
+* @method renderCellDefault\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {\r
+       cell.innerHTML = '<a href="javascript:void(null);" >' + this.buildDayLabel(workingDate) + "</a>";\r
+};\r
 \r
-/************* BEGIN DATE PARSE METHODS ***************************************************/\r
+/**\r
+* Styles a selectable cell.\r
+* @method styleCellDefault\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.styleCellDefault = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);\r
+};\r
 \r
 \r
 /**\r
-* Converts a date string to a date field array\r
-* @private\r
-* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.\r
-* @return                              A date field array representing the string passed to the method\r
-* @type Array[](Integer[])\r
+* Renders a single standard calendar cell using the CSS hightlight1 style\r
+* @method renderCellStyleHighlight1\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._parseDate = function(sDate) {\r
-       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);\r
-       var rArray;\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);\r
+};\r
 \r
-       if (aDate.length == 2) {\r
-               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];\r
-               rArray.type = YAHOO.widget.Calendar_Core.MONTH_DAY;\r
-       } else {\r
-               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];\r
-               rArray.type = YAHOO.widget.Calendar_Core.DATE;\r
-       }\r
-       return rArray;\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight2 style\r
+* @method renderCellStyleHighlight2\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);\r
 };\r
 \r
 /**\r
-* Converts a multi or single-date string to an array of date field arrays\r
-* @private\r
-* @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\r
-* @return                                                      An array of date field arrays\r
-* @type Array[](Integer[])\r
+* Renders a single standard calendar cell using the CSS hightlight3 style\r
+* @method renderCellStyleHighlight3\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._parseDates = function(sDates) {\r
-       var aReturn = new Array();\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);\r
+};\r
 \r
-       var aDates = sDates.split(this.Locale.DATE_DELIMITER);\r
-       \r
-       for (var d=0;d<aDates.length;++d) {\r
-               var sDate = aDates[d];\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight4 style\r
+* @method renderCellStyleHighlight4\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);\r
+};\r
 \r
-               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {\r
-                       // This is a range\r
-                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);\r
+/**\r
+* Applies the default style used for rendering today's date to the current calendar cell\r
+* @method renderCellStyleToday\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleToday = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);\r
+};\r
 \r
-                       var dateStart = this._parseDate(aRange[0]);\r
-                       var dateEnd = this._parseDate(aRange[1]);\r
+/**\r
+* Applies the default style used for rendering selected dates to the current calendar cell\r
+* @method renderCellStyleSelected\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleSelected = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);\r
+};\r
 \r
-                       var fullRange = this._parseRange(dateStart, dateEnd);\r
-                       aReturn = aReturn.concat(fullRange);\r
-               } else {\r
-                       // This is not a range\r
-                       var aDate = this._parseDate(sDate);\r
-                       aReturn.push(aDate);\r
-               }\r
-       }\r
-       return aReturn;\r
+/**\r
+* Applies the default style used for rendering dates that are not a part of the current\r
+* month (preceding or trailing the cells for the current month)\r
+* @method renderCellNotThisMonth\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellNotThisMonth = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);\r
+       cell.innerHTML=workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
 };\r
 \r
 /**\r
-* Converts a date range to the full list of included dates\r
-* @private\r
-* @param       {Integer[]}     startDate       Date field array representing the first date in the range\r
-* @param       {Integer[]}     endDate         Date field array representing the last date in the range\r
-* @return                                                      An array of date field arrays\r
-* @type Array[](Integer[])\r
+* Renders the current calendar cell as a non-selectable "black-out" date using the default\r
+* restricted style.\r
+* @method renderBodyCellRestricted\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._parseRange = function(startDate, endDate) {\r
-       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);\r
-       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);\r
-       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);\r
+YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);\r
+       cell.innerHTML=workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
+};\r
 \r
-       var results = new Array();\r
-       results.push(startDate);\r
-       while (dCurrent.getTime() <= dEnd.getTime()) {\r
-               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);\r
-               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);\r
-       }\r
-       return results;\r
+// END BUILT-IN TABLE CELL RENDERERS\r
+\r
+// BEGIN MONTH NAVIGATION METHODS\r
+\r
+/**\r
+* Adds the designated number of months to the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method addMonths\r
+* @param {Number}      count   The number of months to add to the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.addMonths = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
 };\r
 \r
-/************* END DATE PARSE METHODS *****************************************************/\r
+/**\r
+* Subtracts the designated number of months from the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractMonths\r
+* @param {Number}      count   The number of months to subtract from the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
+};\r
 \r
-/************* BEGIN RENDERER METHODS *****************************************************/\r
+/**\r
+* Adds the designated number of years to the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method addYears\r
+* @param {Number}      count   The number of years to add to the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.addYears = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
+};\r
 \r
 /**\r
-* Resets the render stack of the current calendar to its original pre-render value.\r
+* Subtcats the designated number of years from the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractYears\r
+* @param {Number}      count   The number of years to subtract from the current calendar\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.resetRenderers = function() {\r
-       this.renderStack = this._renderStack.concat();\r
+YAHOO.widget.Calendar.prototype.subtractYears = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
 };\r
 \r
 /**\r
-* Clears the inner HTML, CSS class and style information from the specified cell.\r
-* @param       {HTMLTableCellElement}  The cell to clear\r
-*/ \r
-YAHOO.widget.Calendar_Core.prototype.clearElement = function(cell) {\r
-       cell.innerHTML = "&nbsp;";\r
-       cell.className="";\r
+* Navigates to the next month page in the calendar widget.\r
+* @method nextMonth\r
+*/\r
+YAHOO.widget.Calendar.prototype.nextMonth = function() {\r
+       this.addMonths(1);\r
 };\r
 \r
 /**\r
-* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the conditions specified in the date string for this renderer.\r
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+* Navigates to the previous month page in the calendar widget.\r
+* @method previousMonth\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.addRenderer = function(sDates, fnRender) {\r
-       var aDates = this._parseDates(sDates);\r
-       for (var i=0;i<aDates.length;++i) {\r
-               var aDate = aDates[i];\r
-       \r
-               if (aDate.length == 2) { // this is either a range or a month/day combo\r
-                       if (aDate[0] instanceof Array) { // this is a range\r
-                               this._addRenderer(YAHOO.widget.Calendar_Core.RANGE,aDate,fnRender);\r
-                       } else { // this is a month/day combo\r
-                               this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,aDate,fnRender);\r
-                       }\r
-               } else if (aDate.length == 3) {\r
-                       this._addRenderer(YAHOO.widget.Calendar_Core.DATE,aDate,fnRender);\r
-               }\r
-       }\r
+YAHOO.widget.Calendar.prototype.previousMonth = function() {\r
+       this.subtractMonths(1);\r
 };\r
 \r
 /**\r
-* The private method used for adding cell renderers to the local render stack.\r
-* This method is called by other methods that set the renderer type prior to the method call.\r
-* @private\r
-* @param       {String}        type            The type string that indicates the type of date renderer being added.\r
-*                                                                      Values are YAHOO.widget.Calendar_Core.DATE, YAHOO.widget.Calendar_Core.MONTH_DAY, YAHOO.widget.Calendar_Core.WEEKDAY,\r
-*                                                                      YAHOO.widget.Calendar_Core.RANGE, YAHOO.widget.Calendar_Core.MONTH\r
-* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based\r
-*                                                                      on the renderer type\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+* Navigates to the next year in the currently selected month in the calendar widget.\r
+* @method nextYear\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._addRenderer = function(type, aDates, fnRender) {\r
-       var add = [type,aDates,fnRender];\r
-       this.renderStack.unshift(add);  \r
-       \r
-       this._renderStack = this.renderStack.concat();\r
+YAHOO.widget.Calendar.prototype.nextYear = function() {\r
+       this.addYears(1);\r
 };\r
 \r
-/**\r
-* Adds a month to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the month passed to this method.\r
-* @param       {Integer}       month           The month (1-12) to associate with this renderer\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.addMonthRenderer = function(month, fnRender) {\r
-       this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[month],fnRender);\r
-};\r
+/**\r
+* Navigates to the previous year in the currently selected month in the calendar widget.\r
+* @method previousYear\r
+*/\r
+YAHOO.widget.Calendar.prototype.previousYear = function() {\r
+       this.subtractYears(1);\r
+};\r
+\r
+// END MONTH NAVIGATION METHODS\r
+\r
+// BEGIN SELECTION METHODS\r
+\r
+/**\r
+* Resets the calendar widget to the originally selected month and year, and\r
+* sets the calendar to the initial selection(s).\r
+* @method reset\r
+*/\r
+YAHOO.widget.Calendar.prototype.reset = function() {\r
+       this.cfg.resetProperty("selected");\r
+       this.cfg.resetProperty("pagedate");\r
+       this.resetEvent.fire();\r
+};\r
+\r
+/**\r
+* Clears the selected dates in the current calendar widget and sets the calendar\r
+* to the current month and year.\r
+* @method clear\r
+*/\r
+YAHOO.widget.Calendar.prototype.clear = function() {\r
+       this.cfg.setProperty("selected", []);\r
+       this.cfg.setProperty("pagedate", new Date(this.today.getTime()));\r
+       this.clearEvent.fire();\r
+};\r
+\r
+/**\r
+* Selects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once selection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method select\r
+* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.select = function(date) {\r
+       this.logger.log("Select: " + date, "info");\r
+\r
+       this.beforeSelectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+       var aToBeSelected = this._toFieldArray(date);\r
+       this.logger.log("Selection field array: " + aToBeSelected, "info");\r
+\r
+       for (var a=0;a<aToBeSelected.length;++a) {\r
+               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
+               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?\r
+                       selected[selected.length]=toSelect;\r
+               }\r
+       }\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.selectEvent.fire(aToBeSelected);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
+* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is applied to the cell directly.\r
+* @method selectCell\r
+* @param       {Number}        cellIndex       The index of the cell to select in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {\r
+       this.beforeSelectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var cell = this.cells[cellIndex];\r
+       var cellDate = this.cellDates[cellIndex];\r
+\r
+       var dCellDate = this._toDate(cellDate);\r
+       this.logger.log("Select: " + dCellDate, "info");\r
+\r
+       var selectDate = cellDate.concat();\r
+\r
+       selected[selected.length] = selectDate;\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.renderCellStyleSelected(dCellDate,cell);\r
+\r
+       this.selectEvent.fire([selectDate]);\r
+\r
+       this.doCellMouseOut.call(cell, null, this);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once deselection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method deselect\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselect = function(date) {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var aToBeSelected = this._toFieldArray(date);\r
+\r
+       for (var a=0;a<aToBeSelected.length;++a) {\r
+               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
+               var index = this._indexOfSelectedFieldArray(toSelect);\r
+\r
+               if (index != -1) {\r
+                       selected.splice(index,1);\r
+               }\r
+       }\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.deselectEvent.fire(aToBeSelected);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
+* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is removed from the cell directly.\r
+* @method deselectCell\r
+* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselectCell = function(i) {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var cell = this.cells[i];\r
+       var cellDate = this.cellDates[i];\r
+       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);\r
+\r
+       var dCellDate = this._toDate(cellDate);\r
+\r
+       var selectDate = cellDate.concat();\r
+\r
+       if (cellDateIndex > -1) {\r
+               if (this.cfg.getProperty("pagedate").getMonth() == dCellDate.getMonth() &&\r
+                       this.cfg.getProperty("pagedate").getFullYear() == dCellDate.getFullYear()) {\r
+                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);\r
+               }\r
+\r
+               selected.splice(cellDateIndex, 1);\r
+       }\r
+\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.deselectEvent.fire(selectDate);\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects all dates on the current calendar.\r
+* @method deselectAll\r
+* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*                                              Assuming that this function executes properly, the return value should be an empty array.\r
+*                                              However, the empty array is returned for the sake of being able to check the selection status\r
+*                                              of the calendar.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselectAll = function() {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+       var count = selected.length;\r
+       var sel = selected.concat();\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", []);\r
+       } else {\r
+               this.cfg.setProperty("selected", []);\r
+       }\r
+\r
+       if (count > 0) {\r
+               this.deselectEvent.fire(sel);\r
+       }\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+// END SELECTION METHODS\r
+\r
+// BEGIN TYPE CONVERSION METHODS\r
+\r
+/**\r
+* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure\r
+* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].\r
+* @method _toFieldArray\r
+* @private\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return {Array[](Number[])}  Array of date field arrays\r
+*/\r
+YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {\r
+       var returnDate = [];\r
+\r
+       if (date instanceof Date) {\r
+               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];\r
+       } else if (typeof date == 'string') {\r
+               returnDate = this._parseDates(date);\r
+       } else if (date instanceof Array) {\r
+               for (var i=0;i<date.length;++i) {\r
+                       var d = date[i];\r
+                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];\r
+               }\r
+       }\r
+\r
+       return returnDate;\r
+};\r
+\r
+/**\r
+* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
+* @method _toDate\r
+* @private\r
+* @param       {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.\r
+* @return      {Date}  JavaScript Date object representing the date field array\r
+*/\r
+YAHOO.widget.Calendar.prototype._toDate = function(dateFieldArray) {\r
+       if (dateFieldArray instanceof Date) {\r
+               return dateFieldArray;\r
+       } else {\r
+               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);\r
+       }\r
+};\r
+\r
+// END TYPE CONVERSION METHODS\r
+\r
+// BEGIN UTILITY METHODS\r
+\r
+/**\r
+* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
+* @method _fieldArraysAreEqual\r
+* @private\r
+* @param       {Number[]}      array1  The first date field array to compare\r
+* @param       {Number[]}      array2  The first date field array to compare\r
+* @return      {Boolean}       The boolean that represents the equality of the two arrays\r
+*/\r
+YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2) {\r
+       var match = false;\r
+\r
+       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {\r
+               match=true;\r
+       }\r
+\r
+       return match;\r
+};\r
+\r
+/**\r
+* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.\r
+* @method      _indexOfSelectedFieldArray\r
+* @private\r
+* @param       {Number[]}              find    The date field array to search for\r
+* @return      {Number}                        The index of the date field array within the collection of selected dates.\r
+*                                                              -1 will be returned if the date is not found.\r
+*/\r
+YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {\r
+       var selected = -1;\r
+       var seldates = this.cfg.getProperty("selected");\r
+\r
+       for (var s=0;s<seldates.length;++s) {\r
+               var sArray = seldates[s];\r
+               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {\r
+                       selected = s;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return selected;\r
+};\r
+\r
+/**\r
+* Determines whether a given date is OOM (out of month).\r
+* @method      isDateOOM\r
+* @param       {Date}  date    The JavaScript Date object for which to check the OOM status\r
+* @return      {Boolean}       true if the date is OOM\r
+*/\r
+YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {\r
+       var isOOM = false;\r
+       if (date.getMonth() != this.cfg.getProperty("pagedate").getMonth()) {\r
+               isOOM = true;\r
+       }\r
+       return isOOM;\r
+};\r
+\r
+// END UTILITY METHODS\r
+\r
+// BEGIN EVENT HANDLERS\r
+\r
+/**\r
+* Event executed before a date is selected in the calendar widget.\r
+* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {\r
+       if (this.cfg.getProperty("MULTI_SELECT") === false) {\r
+               if (this.parent) {\r
+                       this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);\r
+                       this.parent.deselectAll();\r
+               } else {\r
+                       this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);\r
+                       this.deselectAll();\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* Event executed when a date is selected in the calendar widget.\r
+* @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] ]\r
+* @deprecated Event handlers for this event should be susbcribed to selectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onSelect = function(selected) { };\r
+\r
+/**\r
+* Event executed before a date is deselected in the calendar widget.\r
+* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onBeforeDeselect = function() { };\r
+\r
+/**\r
+* Event executed when a date is deselected in the calendar widget.\r
+* @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] ]\r
+* @deprecated Event handlers for this event should be susbcribed to deselectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onDeselect = function(deselected) { };\r
+\r
+/**\r
+* Event executed when the user navigates to a different calendar page.\r
+* @deprecated Event handlers for this event should be susbcribed to changePageEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onChangePage = function() {\r
+       this.render();\r
+};\r
+\r
+/**\r
+* Event executed when the calendar widget is rendered.\r
+* @deprecated Event handlers for this event should be susbcribed to renderEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onRender = function() { };\r
+\r
+/**\r
+* Event executed when the calendar widget is reset to its original state.\r
+* @deprecated Event handlers for this event should be susbcribed to resetEvemt.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onReset = function() { this.render(); };\r
+\r
+/**\r
+* Event executed when the calendar widget is completely cleared to the current month with no selections.\r
+* @deprecated Event handlers for this event should be susbcribed to clearEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onClear = function() { this.render(); };\r
+\r
+/**\r
+* Validates the calendar widget. This method has no default implementation\r
+* and must be extended by subclassing the widget.\r
+* @return      Should return true if the widget validates, and false if\r
+* it doesn't.\r
+* @type Boolean\r
+*/\r
+YAHOO.widget.Calendar.prototype.validate = function() { return true; };\r
+\r
+// END EVENT HANDLERS\r
+\r
+// BEGIN DATE PARSE METHODS\r
+\r
+/**\r
+* Converts a date string to a date field array\r
+* @private\r
+* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.\r
+* @return                              A date field array representing the string passed to the method\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseDate = function(sDate) {\r
+       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);\r
+       var rArray;\r
+\r
+       if (aDate.length == 2) {\r
+               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];\r
+               rArray.type = YAHOO.widget.Calendar.MONTH_DAY;\r
+       } else {\r
+               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];\r
+               rArray.type = YAHOO.widget.Calendar.DATE;\r
+       }\r
+\r
+       for (var i=0;i<rArray.length;i++) {\r
+               rArray[i] = parseInt(rArray[i], 10);\r
+       }\r
+\r
+       return rArray;\r
+};\r
+\r
+/**\r
+* Converts a multi or single-date string to an array of date field arrays\r
+* @private\r
+* @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\r
+* @return                                                      An array of date field arrays\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseDates = function(sDates) {\r
+       var aReturn = [];\r
+\r
+       var aDates = sDates.split(this.Locale.DATE_DELIMITER);\r
+\r
+       for (var d=0;d<aDates.length;++d) {\r
+               var sDate = aDates[d];\r
+\r
+               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {\r
+                       // This is a range\r
+                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);\r
+\r
+                       var dateStart = this._parseDate(aRange[0]);\r
+                       var dateEnd = this._parseDate(aRange[1]);\r
+\r
+                       var fullRange = this._parseRange(dateStart, dateEnd);\r
+                       aReturn = aReturn.concat(fullRange);\r
+               } else {\r
+                       // This is not a range\r
+                       var aDate = this._parseDate(sDate);\r
+                       aReturn.push(aDate);\r
+               }\r
+       }\r
+       return aReturn;\r
+};\r
+\r
+/**\r
+* Converts a date range to the full list of included dates\r
+* @private\r
+* @param       {Number[]}      startDate       Date field array representing the first date in the range\r
+* @param       {Number[]}      endDate         Date field array representing the last date in the range\r
+* @return                                                      An array of date field arrays\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseRange = function(startDate, endDate) {\r
+       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);\r
+       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);\r
+       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);\r
+\r
+       var results = [];\r
+       results.push(startDate);\r
+       while (dCurrent.getTime() <= dEnd.getTime()) {\r
+               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);\r
+               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);\r
+       }\r
+       return results;\r
+};\r
+\r
+// END DATE PARSE METHODS\r
+\r
+// BEGIN RENDERER METHODS\r
+\r
+/**\r
+* Resets the render stack of the current calendar to its original pre-render value.\r
+*/\r
+YAHOO.widget.Calendar.prototype.resetRenderers = function() {\r
+       this.renderStack = this._renderStack.concat();\r
+};\r
+\r
+/**\r
+* Clears the inner HTML, CSS class and style information from the specified cell.\r
+* @method clearElement\r
+* @param       {HTMLTableCellElement}  The cell to clear\r
+*/\r
+YAHOO.widget.Calendar.prototype.clearElement = function(cell) {\r
+       cell.innerHTML = "&#160;";\r
+       cell.className="";\r
+};\r
+\r
+/**\r
+* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the conditions specified in the date string for this renderer.\r
+* @method addRenderer\r
+* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
+*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addRenderer = function(sDates, fnRender) {\r
+       var aDates = this._parseDates(sDates);\r
+       for (var i=0;i<aDates.length;++i) {\r
+               var aDate = aDates[i];\r
+\r
+               if (aDate.length == 2) { // this is either a range or a month/day combo\r
+                       if (aDate[0] instanceof Array) { // this is a range\r
+                               this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);\r
+                       } else { // this is a month/day combo\r
+                               this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);\r
+                       }\r
+               } else if (aDate.length == 3) {\r
+                       this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* The private method used for adding cell renderers to the local render stack.\r
+* This method is called by other methods that set the renderer type prior to the method call.\r
+* @method _addRenderer\r
+* @private\r
+* @param       {String}        type            The type string that indicates the type of date renderer being added.\r
+*                                                                      Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,\r
+*                                                                      YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH\r
+* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based\r
+*                                                                      on the renderer type\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype._addRenderer = function(type, aDates, fnRender) {\r
+       var add = [type,aDates,fnRender];\r
+       this.renderStack.unshift(add);\r
+       this._renderStack = this.renderStack.concat();\r
+};\r
+\r
+/**\r
+* Adds a month to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the month passed to this method.\r
+* @method addMonthRenderer\r
+* @param       {Number}        month           The month (1-12) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addMonthRenderer = function(month, fnRender) {\r
+       this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);\r
+};\r
+\r
+/**\r
+* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the weekday passed to this method.\r
+* @method addWeekdayRenderer\r
+* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
+       this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);\r
+};\r
+\r
+// END RENDERER METHODS\r
+\r
+// BEGIN CSS METHODS\r
+\r
+/**\r
+* Removes all styles from all body cells in the current calendar table.\r
+* @method clearAllBodyCellStyles\r
+* @param       {style}         The CSS class name to remove from all calendar body cells\r
+*/\r
+YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {\r
+       for (var c=0;c<this.cells.length;++c) {\r
+               YAHOO.util.Dom.removeClass(this.cells[c],style);\r
+       }\r
+};\r
+\r
+// END CSS METHODS\r
+\r
+// BEGIN GETTER/SETTER METHODS\r
+/**\r
+* Sets the calendar's month explicitly\r
+* @method setMonth\r
+* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)\r
+*/\r
+YAHOO.widget.Calendar.prototype.setMonth = function(month) {\r
+       var current = this.cfg.getProperty("pagedate");\r
+       current.setMonth(month);\r
+       this.cfg.setProperty("pagedate", current);\r
+};\r
+\r
+/**\r
+* Sets the calendar's year explicitly.\r
+* @method setYear\r
+* @param {Number}      year            The numeric 4-digit year\r
+*/\r
+YAHOO.widget.Calendar.prototype.setYear = function(year) {\r
+       var current = this.cfg.getProperty("pagedate");\r
+       current.setFullYear(year);\r
+       this.cfg.setProperty("pagedate", current);\r
+};\r
+\r
+/**\r
+* Gets the list of currently selected dates from the calendar.\r
+* @method getSelectedDates\r
+* @return {Date[]} An array of currently selected JavaScript Date objects.\r
+*/\r
+YAHOO.widget.Calendar.prototype.getSelectedDates = function() {\r
+       var returnDates = [];\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       for (var d=0;d<selected.length;++d) {\r
+               var dateArray = selected[d];\r
+\r
+               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
+               returnDates.push(date);\r
+       }\r
+\r
+       returnDates.sort( function(a,b) { return a-b; } );\r
+       return returnDates;\r
+};\r
+\r
+/// END GETTER/SETTER METHODS ///\r
+\r
+/**\r
+* Hides the Calendar's outer container from view.\r
+* @method hide\r
+*/\r
+YAHOO.widget.Calendar.prototype.hide = function() {\r
+       this.oDomContainer.style.display = "none";\r
+};\r
+\r
+/**\r
+* Shows the Calendar's outer container.\r
+* @method show\r
+*/\r
+YAHOO.widget.Calendar.prototype.show = function() {\r
+       this.oDomContainer.style.display = "block";\r
+};\r
+\r
+/**\r
+* Returns a string representing the current browser.\r
+* @property browser\r
+* @type String\r
+*/\r
+YAHOO.widget.Calendar.prototype.browser = function() {\r
+                       var ua = navigator.userAgent.toLowerCase();\r
+                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)\r
+                                        return 'opera';\r
+                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7\r
+                                        return 'ie7';\r
+                                 } else if (ua.indexOf('msie') !=-1) { // IE\r
+                                        return 'ie';\r
+                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")\r
+                                        return 'safari';\r
+                                 } else if (ua.indexOf('gecko') != -1) { // Gecko\r
+                                        return 'gecko';\r
+                                 } else {\r
+                                        return false;\r
+                                 }\r
+                       }();\r
+/**\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     A string representation of the Calendar object.\r
+*/\r
+YAHOO.widget.Calendar.prototype.toString = function() {\r
+       return "Calendar " + this.id;\r
+};\r
+\r
+/**\r
+* @namespace YAHOO.widget\r
+* @class Calendar_Core\r
+* @extends YAHOO.widget.Calendar\r
+* @deprecated The old Calendar_Core class is no longer necessary.\r
+*/\r
+YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;\r
+\r
+YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;\r
+\r
+/**\r
+* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates\r
+* the ability to have multi-page calendar views that share a single dataset and are\r
+* dependent on each other.\r
+*\r
+* The calendar group instance will refer to each of its elements using a 0-based index.\r
+* For example, to construct the placeholder for a calendar group widget with id "cal1" and\r
+* containerId of "cal1Container", the markup would be as follows:\r
+*      <xmp>\r
+*              <div id="cal1Container_0"></div>\r
+*              <div id="cal1Container_1"></div>\r
+*      </xmp>\r
+* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.\r
+* @namespace YAHOO.widget\r
+* @class CalendarGroup\r
+* @constructor\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.CalendarGroup = function(id, containerId, config) {\r
+       if (arguments.length > 0) {\r
+               this.init(id, containerId, config);\r
+       }\r
+};\r
+\r
+/**\r
+* Initializes the calendar group. All subclasses must call this method in order for the\r
+* group to be initialized properly.\r
+* @method init\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {\r
+       this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + id);\r
+\r
+       this.initEvents();\r
+       this.initStyles();\r
+\r
+       /**\r
+       * The collection of Calendar pages contained within the CalendarGroup\r
+       * @property pages\r
+       * @type YAHOO.widget.Calendar[]\r
+       */\r
+       this.pages = [];\r
+\r
+       /**\r
+       * The unique id associated with the CalendarGroup\r
+       * @property id\r
+       * @type String\r
+       */\r
+       this.id = id;\r
+\r
+       /**\r
+       * The unique id associated with the CalendarGroup container\r
+       * @property containerId\r
+       * @type String\r
+       */\r
+       this.containerId = containerId;\r
+\r
+       /**\r
+       * The outer containing element for the CalendarGroup\r
+       * @property oDomContainer\r
+       * @type HTMLElement\r
+       */\r
+       this.oDomContainer = document.getElementById(containerId);\r
+\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);\r
+\r
+       /**\r
+       * The Config object used to hold the configuration variables for the CalendarGroup\r
+       * @property cfg\r
+       * @type YAHOO.util.Config\r
+       */\r
+       this.cfg = new YAHOO.util.Config(this);\r
+\r
+       /**\r
+       * The local object which contains the CalendarGroup's options\r
+       * @property Options\r
+       * @type Object\r
+       */\r
+       this.Options = {};\r
+\r
+       /**\r
+       * The local object which contains the CalendarGroup's locale settings\r
+       * @property Locale\r
+       * @type Object\r
+       */\r
+       this.Locale = {};\r
+\r
+       this.setupConfig();\r
+\r
+       if (config) {\r
+               this.cfg.applyConfig(config, true);\r
+       }\r
+\r
+       this.cfg.fireQueue();\r
+\r
+       // OPERA HACK FOR MISWRAPPED FLOATS\r
+       if (this.browser == "opera"){\r
+               var fixWidth = function() {\r
+                       var startW = this.oDomContainer.offsetWidth;\r
+                       var w = 0;\r
+                       for (var p=0;p<this.pages.length;++p) {\r
+                               var cal = this.pages[p];\r
+                               w += cal.oDomContainer.offsetWidth;\r
+                       }\r
+                       if (w > 0) {\r
+                               this.oDomContainer.style.width = w + "px";\r
+                       }\r
+               };\r
+               this.renderEvent.subscribe(fixWidth,this,true);\r
+       }\r
+\r
+       this.logger.log("Initialized " + pageCount + "-page CalendarGroup", "info");\r
+};\r
+\r
+\r
+YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {\r
+       /**\r
+       * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.\r
+       * @config pages\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("pages", { value:2, validator:this.cfg.checkNumber, handler:this.configPages } );\r
+\r
+       /**\r
+       * The month/year representing the current visible Calendar date (mm/yyyy)\r
+       * @config pagedate\r
+       * @type String\r
+       * @default today's date\r
+       */\r
+       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );\r
+\r
+       /**\r
+       * The date or range of dates representing the current Calendar selection\r
+       * @config selected\r
+       * @type String\r
+       * @default []\r
+       */\r
+       this.cfg.addProperty("selected", { value:[], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The title to display above the CalendarGroup's month header\r
+       * @config title\r
+       * @type String\r
+       * @default ""\r
+       */\r
+       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );\r
+\r
+       /**\r
+       * Whether or not a close button should be displayed for this CalendarGroup\r
+       * @config close\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("close", { value:false, handler:this.configClose } );\r
+\r
+       /**\r
+       * 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.\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("iframe", { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The minimum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config mindate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("mindate", { value:null, handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The maximum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config maxdate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("maxdate", { value:null, handler:this.delegateConfig  } );\r
+\r
+       // Options properties\r
+\r
+       /**\r
+       * True if the Calendar should allow multiple selections. False by default.\r
+       * @config MULTI_SELECT\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The weekday the week begins on. Default is 0 (Sunday).\r
+       * @config START_WEEKDAY\r
+       * @type number\r
+       * @default 0\r
+       */\r
+       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );\r
+\r
+       /**\r
+       * True if the Calendar should show weekday labels. True by default.\r
+       * @config SHOW_WEEKDAYS\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row headers. False by default.\r
+       * @config SHOW_WEEK_HEADER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row footers. False by default.\r
+       * @config SHOW_WEEK_FOOTER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.\r
+       * @config HIDE_BLANK_WEEKS\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_LEFT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_RIGHT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.delegateConfig } );\r
+\r
+       // Locale properties\r
+\r
+       /**\r
+       * The short month labels for the current locale.\r
+       * @config MONTHS_SHORT\r
+       * @type String[]\r
+       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]\r
+       */\r
+       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The long month labels for the current locale.\r
+       * @config MONTHS_LONG\r
+       * @type String[]\r
+       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"\r
+       */\r
+       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The 1-character weekday labels for the current locale.\r
+       * @config WEEKDAYS_1CHAR\r
+       * @type String[]\r
+       * @default ["S", "M", "T", "W", "T", "F", "S"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The short weekday labels for the current locale.\r
+       * @config WEEKDAYS_SHORT\r
+       * @type String[]\r
+       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The medium weekday labels for the current locale.\r
+       * @config WEEKDAYS_MEDIUM\r
+       * @type String[]\r
+       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The long weekday labels for the current locale.\r
+       * @config WEEKDAYS_LONG\r
+       * @type String[]\r
+       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".\r
+       * @config LOCALE_MONTHS\r
+       * @type String\r
+       * @default "long"\r
+       */\r
+       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".\r
+       * @config LOCALE_WEEKDAYS\r
+       * @type String\r
+       * @default "short"\r
+       */\r
+       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit individual dates in a date string passed to various Calendar functions.\r
+       * @config DATE_DELIMITER\r
+       * @type String\r
+       * @default ","\r
+       */\r
+       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit date fields in a date string passed to various Calendar functions.\r
+       * @config DATE_FIELD_DELIMITER\r
+       * @type String\r
+       * @default "/"\r
+       */\r
+       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit date ranges in a date string passed to various Calendar functions.\r
+       * @config DATE_RANGE_DELIMITER\r
+       * @type String\r
+       * @default "-"\r
+       */\r
+       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The position of the month in a month/year date string\r
+       * @config MY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/year date string\r
+       * @config MY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day date string\r
+       * @config MD_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/year date string\r
+       * @config MD_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day/year date string\r
+       * @config MDY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/day/year date string\r
+       * @config MDY_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/day/year date string\r
+       * @config MDY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 3\r
+       */\r
+       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+};\r
+\r
+/**\r
+* Initializes CalendarGroup's built-in CustomEvents\r
+* @method initEvents\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.initEvents = function() {\r
+       var me = this;\r
+\r
+       /**\r
+       * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents\r
+       * @method sub\r
+       * @private\r
+       * @param {Function} fn  The function to subscribe to this CustomEvent\r
+       * @param {Object}       obj     The CustomEvent's scope object\r
+       * @param {Boolean}      bOverride       Whether or not to apply scope correction\r
+       */\r
+       var sub = function(fn, obj, bOverride) {\r
+               for (var p=0;p<me.pages.length;++p) {\r
+                       var cal = me.pages[p];\r
+                       cal[this.type + "Event"].subscribe(fn, obj, bOverride);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents\r
+       * @method unsub\r
+       * @private\r
+       * @param {Function} fn  The function to subscribe to this CustomEvent\r
+       * @param {Object}       obj     The CustomEvent's scope object\r
+       */\r
+       var unsub = function(fn, obj) {\r
+               for (var p=0;p<me.pages.length;++p) {\r
+                       var cal = me.pages[p];\r
+                       cal[this.type + "Event"].unsubscribe(fn, obj);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeSelectEvent\r
+       */\r
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");\r
+       this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;\r
+\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event selectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.selectEvent = new YAHOO.util.CustomEvent("select");\r
+       this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the weekday passed to this method.\r
-* @param       {Integer}       weekay          The weekday (1-7) to associate with this renderer\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
-       this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[weekday],fnRender);\r
-};\r
-//// END RENDERER METHODS ////\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeDeselectEvent\r
+       */\r
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");\r
+       this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;\r
 \r
-//// BEGIN CSS METHODS ////\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event deselectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");\r
+       this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Sets the specified array of CSS classes into the referenced element\r
-* @param       {HTMLElement}   element         The element to set the CSS classes into\r
-* @param       {String[]}              aStyles         An array of CSS class names\r
-*/\r
-YAHOO.widget.Calendar_Core.setCssClasses = function(element, aStyles) {\r
-       element.className = "";\r
-       var className = aStyles.join(" ");\r
-       element.className = className;\r
-};\r
+       /**\r
+       * Fired when the Calendar page is changed\r
+       * @event changePageEvent\r
+       */\r
+       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");\r
+       this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Removes all styles from all body cells in the current calendar table.\r
-* @param       {style}         The CSS class name to remove from all calendar body cells\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles = function(style) {\r
-       for (var c=0;c<this.cells.length;++c) {\r
-               YAHOO.util.Dom.removeClass(this.cells[c],style);\r
-       }\r
-};\r
+       /**\r
+       * Fired before the Calendar is rendered\r
+       * @event beforeRenderEvent\r
+       */\r
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+       this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;\r
 \r
-//// END CSS METHODS ////\r
+       /**\r
+       * Fired when the Calendar is rendered\r
+       * @event renderEvent\r
+       */\r
+       this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+       this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;\r
 \r
-//// BEGIN GETTER/SETTER METHODS ////\r
-/**\r
-* Sets the calendar's month explicitly.\r
-* @param {Integer}     month           The numeric month, from 1 (January) to 12 (December)\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setMonth = function(month) {\r
-       this.pageDate.setMonth(month);\r
-};\r
+       /**\r
+       * Fired when the Calendar is reset\r
+       * @event resetEvent\r
+       */\r
+       this.resetEvent = new YAHOO.util.CustomEvent("reset");\r
+       this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;\r
+\r
+       /**\r
+       * Fired when the Calendar is cleared\r
+       * @event clearEvent\r
+       */\r
+       this.clearEvent = new YAHOO.util.CustomEvent("clear");\r
+       this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Sets the calendar's year explicitly.\r
-* @param {Integer}     year            The numeric 4-digit year\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setYear = function(year) {\r
-       this.pageDate.setFullYear(year);\r
 };\r
 \r
 /**\r
-* Gets the list of currently selected dates from the calendar.\r
-* @return      An array of currently selected JavaScript Date objects.\r
-* @type Date[]\r
+* The default Config handler for the "pages" property\r
+* @method configPages\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.getSelectedDates = function() {\r
-       var returnDates = new Array();\r
+YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {\r
+       var pageCount = args[0];\r
 \r
-       for (var d=0;d<this.selectedDates.length;++d) {\r
-               var dateArray = this.selectedDates[d];\r
-\r
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
-               returnDates.push(date);\r
-       }\r
+       for (var p=0;p<pageCount;++p) {\r
+               var calId = this.id + "_" + p;\r
+               var calContainerId = this.containerId + "_" + p;\r
 \r
-       returnDates.sort();\r
-       return returnDates;\r
-};\r
+               var childConfig = this.cfg.getConfig();\r
+               childConfig.close = false;\r
+               childConfig.title = false;\r
 \r
-/// END GETTER/SETTER METHODS ///\r
+               var cal = this.constructChild(calId, calContainerId, childConfig);\r
+               var caldate = cal.cfg.getProperty("pagedate");\r
+               caldate.setMonth(caldate.getMonth()+p);\r
+               cal.cfg.setProperty("pagedate", caldate);\r
 \r
-/**\r
-* Returns a string representing the current browser.\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core._getBrowser = function() {\r
-  /**\r
-   * UserAgent\r
-   * @private\r
-   * @type String\r
-   */\r
-  var ua = navigator.userAgent.toLowerCase();\r
-  \r
-  if (ua.indexOf('opera')!=-1) // Opera (check first in case of spoof)\r
-        return 'opera';\r
-  else if (ua.indexOf('msie')!=-1) // IE\r
-        return 'ie';\r
-  else if (ua.indexOf('safari')!=-1) // Safari (check before Gecko because it includes "like Gecko")\r
-        return 'safari';\r
-  else if (ua.indexOf('gecko') != -1) // Gecko\r
-        return 'gecko';\r
- else\r
-  return false;\r
-}\r
+               YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);\r
+               YAHOO.util.Dom.addClass(cal.oDomContainer, "groupcal");\r
 \r
-/**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.toString = function() {\r
-       return "Calendar_Core " + this.id;\r
-}\r
+               if (p===0) {\r
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, "first");\r
+               }\r
 \r
-YAHOO.widget.Cal_Core = YAHOO.widget.Calendar_Core;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+               if (p==(pageCount-1)) {\r
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, "last");\r
+               }\r
 \r
-/**\r
-* @class\r
-* Calendar is the default implementation of the YAHOO.widget.Calendar_Core base class.\r
-* This class is the UED-approved version of the calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for YAHOO.widget.Calendar_Core.\r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
-\r
-YAHOO.widget.Calendar.prototype = new YAHOO.widget.Calendar_Core();\r
-\r
-YAHOO.widget.Calendar.prototype.buildShell = function() {\r
-       this.border = document.createElement("DIV");\r
-       this.border.className =  this.Style.CSS_CONTAINER;\r
-       \r
-       this.table = document.createElement("TABLE");\r
-       this.table.cellSpacing = 0;     \r
-       \r
-       YAHOO.widget.Calendar_Core.setCssClasses(this.table, [this.Style.CSS_CALENDAR]);\r
-\r
-       this.border.id = this.id;\r
-       \r
-       this.buildShellHeader();\r
-       this.buildShellBody();\r
-       this.buildShellFooter();\r
-};\r
-\r
-YAHOO.widget.Calendar.prototype.renderShell = function() {\r
-       this.border.appendChild(this.table);\r
-       this.oDomContainer.appendChild(this.border);\r
-       this.shellRendered = true;\r
-};\r
-\r
-YAHOO.widget.Calendar.prototype.renderHeader = function() {\r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       if (this.linkLeft) {\r
-               YAHOO.util.Event.removeListener(this.linkLeft, "mousedown", this.previousMonth);\r
-       }\r
-       this.linkLeft = document.createElement("A");\r
-       this.linkLeft.innerHTML = "&nbsp;";\r
-       YAHOO.util.Event.addListener(this.linkLeft, "mousedown", this.previousMonth, this, true);\r
-       this.linkLeft.style.backgroundImage =  "url(" + this.Options.NAV_ARROW_LEFT + ")";\r
-       this.linkLeft.className = this.Style.CSS_NAV_LEFT;\r
-       \r
-       if (this.linkRight) {\r
-               YAHOO.util.Event.removeListener(this.linkRight, "mousedown", this.nextMonth);\r
-       }\r
-       this.linkRight = document.createElement("A");\r
-       this.linkRight.innerHTML = "&nbsp;";\r
-       YAHOO.util.Event.addListener(this.linkRight, "mousedown", this.nextMonth, this, true);\r
-       this.linkRight.style.backgroundImage = "url(" + this.Options.NAV_ARROW_RIGHT + ")";\r
-       this.linkRight.className = this.Style.CSS_NAV_RIGHT;\r
-       \r
-       headerContainer.appendChild(this.linkLeft);\r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       headerContainer.appendChild(this.linkRight);\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
-};\r
-\r
-YAHOO.widget.Cal = YAHOO.widget.Calendar;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+               cal.parent = this;\r
+               cal.index = p;\r
 \r
-/**\r
-* @class\r
-* <p>YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar_Core. This class facilitates\r
-* the ability to have multi-page calendar views that share a single dataset and are\r
-* dependent on each other.</p>\r
-* \r
-* <p>The calendar group instance will refer to each of its elements using a 0-based index.\r
-* For example, to construct the placeholder for a calendar group widget with id "cal1" and\r
-* containerId of "cal1Container", the markup would be as follows:\r
-*      <xmp>\r
-*              <div id="cal1Container_0"></div>\r
-*              <div id="cal1Container_1"></div>\r
-*      </xmp>\r
-* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.\r
-* </p>\r
-* @constructor\r
-* @param {Integer}             pageCount       The number of pages that this calendar should display.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}      containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.CalendarGroup = function(pageCount, id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {\r
-               this.init(pageCount, id, containerId, monthyear, selected);\r
+               this.pages[this.pages.length] = cal;\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Initializes the calendar group. All subclasses must call this method in order for the\r
-* group to be initialized properly.\r
-* @param {Integer}             pageCount       The number of pages that this calendar should display.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}              containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.CalendarGroup.prototype.init = function(pageCount, id, containerId, monthyear, selected) {\r
-       this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + id);        \r
-       \r
-       this.id = id;\r
-       this.selectedDates = new Array();\r
-       this.containerId = containerId;\r
-       \r
-       this.pageCount = pageCount;\r
+* The default Config handler for the "pagedate" property\r
+* @method configPageDate\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {\r
+       var val = args[0];\r
 \r
-       this.pages = new Array();\r
+       for (var p=0;p<this.pages.length;++p) {\r
+               var cal = this.pages[p];\r
+               cal.cfg.setProperty("pagedate", val);\r
+               var calDate = cal.cfg.getProperty("pagedate");\r
+               calDate.setMonth(calDate.getMonth()+p);\r
+       }\r
+};\r
 \r
-       for (var p=0;p<pageCount;++p) {\r
-               var cal = this.constructChild(id + "_" + p, this.containerId + "_" + p , monthyear, selected);\r
-                               \r
-               cal.parent = this;\r
-               \r
-               cal.index = p;\r
+/**\r
+* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children\r
+* @method delegateConfig\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj) {\r
+       var val = args[0];\r
+       var cal;\r
 \r
-               cal.pageDate.setMonth(cal.pageDate.getMonth()+p);\r
-               cal._pageDate = new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());\r
-               this.pages.push(cal);\r
+       for (var p=0;p<this.pages.length;p++) {\r
+               cal = this.pages[p];\r
+               cal.cfg.setProperty(type, val);\r
        }\r
-       \r
-       this.doNextMonth = function(e, calGroup) {\r
-               calGroup.nextMonth();\r
-       };\r
-       \r
-       this.doPreviousMonth = function(e, calGroup) {\r
-               calGroup.previousMonth();\r
-       };\r
-       \r
-       this.logger.log("Initialized " + pageCount + "-page CalendarGroup", "info");\r
 };\r
 \r
+\r
 /**\r
 * Adds a function to all child Calendars within this CalendarGroup.\r
+* @method setChildFunction\r
 * @param {String}              fnName          The name of the function\r
 * @param {Function}            fn                      The function to apply to each Calendar page object\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {\r
-       for (var p=0;p<this.pageCount;++p) {\r
+       var pageCount = this.cfg.getProperty("pages");\r
+\r
+       for (var p=0;p<pageCount;++p) {\r
                this.pages[p][fnName] = fn;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Calls a function within all child Calendars within this CalendarGroup.\r
+* @method callChildFunction\r
 * @param {String}              fnName          The name of the function\r
 * @param {Array}               args            The arguments to pass to the function\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {\r
-       for (var p=0;p<this.pageCount;++p) {\r
+       var pageCount = this.cfg.getProperty("pages");\r
+\r
+       for (var p=0;p<pageCount;++p) {\r
                var page = this.pages[p];\r
                if (page[fnName]) {\r
                        var fn = page[fnName];\r
                        fn.call(page, args);\r
                }\r
-       }       \r
-}\r
+       }\r
+};\r
 \r
 /**\r
 * Constructs a child calendar. This method can be overridden if a subclassed version of the default\r
 * calendar is to be used.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}              containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-* @return                                                      The YAHOO.widget.Calendar_Core instance that is constructed\r
-* @type YAHOO.widget.Calendar_Core\r
+* @method constructChild\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+* @return {YAHOO.widget.Calendar}      The YAHOO.widget.Calendar instance that is constructed\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,monthyear,selected) {\r
-       return new YAHOO.widget.Calendar_Core(id,containerId,monthyear,selected);\r
+YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,config) {\r
+       var container = document.getElementById(containerId);\r
+       if (! container) {\r
+               container = document.createElement("div");\r
+               container.id = containerId;\r
+               this.oDomContainer.appendChild(container);\r
+       }\r
+       return new YAHOO.widget.Calendar(id,containerId,config);\r
 };\r
 \r
 \r
 /**\r
 * Sets the calendar group's month explicitly. This month will be set into the first\r
+* @method setMonth\r
 * page of the multi-page calendar, and all other months will be iterated appropriately.\r
-* @param {Integer}     month           The numeric month, from 1 (January) to 12 (December)\r
+* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.setMonth(month+p);\r
        }\r
@@ -2389,90 +3891,114 @@ YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
 \r
 /**\r
 * Sets the calendar group's year explicitly. This year will be set into the first\r
+* @method setYear\r
 * page of the multi-page calendar, and all other months will be iterated appropriately.\r
-* @param {Integer}     year            The numeric 4-digit year\r
+* @param {Number}      year            The numeric 4-digit year\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               if ((cal.pageDate.getMonth()+1) == 1 && p>0)\r
-               {\r
+               var pageDate = cal.cfg.getProperty("pageDate");\r
+\r
+               if ((pageDate.getMonth()+1) == 1 && p>0) {\r
                        year+=1;\r
                }\r
                cal.setYear(year);\r
        }\r
 };\r
-\r
 /**\r
 * Calls the render function of all child calendars within the group.\r
+* @method render\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.render = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       this.renderHeader();\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.render();\r
        }\r
+       this.renderFooter();\r
 };\r
 \r
 /**\r
-* Calls the select function of all child calendars within the group.\r
+* Selects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once selection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method select\r
+* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.select = function(date) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.select(date);\r
+               cal.select(date);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the selectCell function of all child calendars within the group.\r
+* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
+* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is applied to the cell directly.\r
+* @method selectCell\r
+* @param       {Number}        cellIndex       The index of the cell to select in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.selectCell(cellIndex);\r
+               cal.selectCell(cellIndex);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselect function of all child calendars within the group.\r
+* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once deselection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method deselect\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselect = function(date) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.deselect(date);\r
+               cal.deselect(date);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselectAll function of all child calendars within the group.\r
+* Deselects all dates on the current calendar.\r
+* @method deselectAll\r
+* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*                                              Assuming that this function executes properly, the return value should be an empty array.\r
+*                                              However, the empty array is returned for the sake of being able to check the selection status\r
+*                                              of the calendar.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.deselectAll();\r
+               cal.deselectAll();\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselectAll function of all child calendars within the group.\r
+* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
+* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is removed from the cell directly.\r
+* @method deselectCell\r
+* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.deselectCell(cellIndex);\r
        }\r
@@ -2480,439 +4006,272 @@ YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
 };\r
 \r
 /**\r
-* Calls the reset function of all child calendars within the group.\r
+* Resets the calendar widget to the originally selected month and year, and\r
+* sets the calendar to the initial selection(s).\r
+* @method reset\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.reset = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.reset();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the clear function of all child calendars within the group.\r
+* Clears the selected dates in the current calendar widget and sets the calendar\r
+* to the current month and year.\r
+* @method clear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.clear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.clear();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the nextMonth function of all child calendars within the group.\r
+* Navigates to the next month page in the calendar widget.\r
+* @method nextMonth\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.nextMonth = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.nextMonth();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the previousMonth function of all child calendars within the group.\r
+* Navigates to the previous month page in the calendar widget.\r
+* @method previousMonth\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.previousMonth = function() {\r
-       for (var p=this.pages.length-1;p>=0;--p)\r
-       {\r
+       for (var p=this.pages.length-1;p>=0;--p) {\r
                var cal = this.pages[p];\r
                cal.previousMonth();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the nextYear function of all child calendars within the group.\r
+* Navigates to the next year in the currently selected month in the calendar widget.\r
+* @method nextYear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.nextYear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.nextYear();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the previousYear function of all child calendars within the group.\r
+* Navigates to the previous year in the currently selected month in the calendar widget.\r
+* @method previousYear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.previousYear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.previousYear();\r
        }\r
 };\r
 \r
-/**\r
-* Synchronizes the data values for all child calendars within the group. If the sync\r
-* method is called passing in the caller object, the values of all children will be set\r
-* to the values of the caller. If the argument is ommitted, the values from all children\r
-* will be combined into one distinct list and set into each child.\r
-* @param       {YAHOO.widget.Calendar_Core}    caller          The YAHOO.widget.Calendar_Core that is initiating the call to sync().\r
-* @return                                                              Array of selected dates, in JavaScript Date object form.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.CalendarGroup.prototype.sync = function(caller) {\r
-       var calendar;\r
-\r
-       if (caller)\r
-       {\r
-               this.selectedDates = caller.selectedDates.concat();\r
-       } else {\r
-               var hash = new Object();\r
-               var combinedDates = new Array();\r
-\r
-               for (var p=0;p<this.pages.length;++p)\r
-               {\r
-                       calendar = this.pages[p];\r
-\r
-                       var values = calendar.selectedDates;\r
-\r
-                       for (var v=0;v<values.length;++v)\r
-                       {\r
-                               var valueArray = values[v];\r
-                               hash[valueArray.toString()] = valueArray;\r
-                       }\r
-               }\r
-\r
-               for (var val in hash)\r
-               {\r
-                       combinedDates[combinedDates.length]=hash[val];\r
-               }\r
-               \r
-               this.selectedDates = combinedDates.concat();\r
-       }\r
-\r
-       // Set all the values into the children\r
-       for (p=0;p<this.pages.length;++p)\r
-       {\r
-               calendar = this.pages[p];\r
-               if (! calendar.Options.MULTI_SELECT) {\r
-                       calendar.clearAllBodyCellStyles(calendar.Config.Style.CSS_CELL_SELECTED);\r
-               }\r
-               calendar.selectedDates = this.selectedDates.concat();\r
-               \r
-       }\r
-       \r
-       return this.getSelectedDates();\r
-};\r
 \r
 /**\r
 * Gets the list of currently selected dates from the calendar.\r
 * @return                      An array of currently selected JavaScript Date objects.\r
 * @type Date[]\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { \r
-       var returnDates = new Array();\r
+YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() {\r
+       var returnDates = [];\r
+       var selected = this.cfg.getProperty("selected");\r
 \r
-       for (var d=0;d<this.selectedDates.length;++d)\r
-       {\r
-               var dateArray = this.selectedDates[d];\r
+       for (var d=0;d<selected.length;++d) {\r
+               var dateArray = selected[d];\r
 \r
                var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
                returnDates.push(date);\r
        }\r
 \r
-       returnDates.sort();\r
+       returnDates.sort( function(a,b) { return a-b; } );\r
        return returnDates;\r
 };\r
 \r
 /**\r
-* Calls the addRenderer function of all child calendars within the group.\r
+* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the conditions specified in the date string for this renderer.\r
+* @method addRenderer\r
+* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
+*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addRenderer = function(sDates, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addRenderer(sDates, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Calls the addMonthRenderer function of all child calendars within the group.\r
+* Adds a month to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the month passed to this method.\r
+* @method addMonthRenderer\r
+* @param       {Number}        month           The month (1-12) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addMonthRenderer(month, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Calls the addWeekdayRenderer function of all child calendars within the group.\r
+* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the weekday passed to this method.\r
+* @method addWeekdayRenderer\r
+* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addWeekdayRenderer(weekday, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Sets an event handler universally across all child calendars within the group. For instance,\r
-* to set the onSelect handler for all child calendars to a function called fnSelect, the call would be:\r
-* <code>\r
-* calGroup.wireEvent("onSelect", fnSelect);\r
-* </code>\r
-* @param       {String}        eventName       The name of the event to handler to set within all child calendars.\r
-* @param       {Function}      fn                      The function to set into the specified event handler.\r
+* Renders the header for the CalendarGroup.\r
+* @method renderHeader\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.wireEvent = function(eventName, fn) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
-               var cal = this.pages[p];\r
-               cal[eventName] = fn;\r
-       }\r
-};\r
+YAHOO.widget.CalendarGroup.prototype.renderHeader = function() {};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
-YAHOO.widget.CalendarGroup.prototype.toString = function() {\r
-       return "CalendarGroup " + this.id;\r
-}\r
-\r
-YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+* Renders a footer for the 2-up calendar container. By default, this method is\r
+* unimplemented.\r
+* @method renderFooter\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.renderFooter = function() {};\r
 \r
 /**\r
-* @class\r
-* Calendar2up_Cal is the default implementation of the Calendar_Core base class, when used\r
-* in a 2-up view. This class is the UED-approved version of the calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for Calendar_Core. This class\r
-* has some special attributes that only apply to calendars rendered within the calendar group implementation. \r
-* There should be no reason to instantiate this class directly.\r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar2up_Cal = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0)\r
-       {\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
-\r
-YAHOO.widget.Calendar2up_Cal.prototype = new YAHOO.widget.Calendar_Core();\r
-\r
-/**\r
-* Renders the header for each individual calendar in the 2-up view. More\r
-* specifically, this method handles the placement of left and right arrows for\r
-* navigating between calendar pages.\r
-*/\r
-YAHOO.widget.Calendar2up_Cal.prototype.renderHeader = function() {\r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       if (this.index == 0) {\r
-\r
-               if (this.linkLeft) {\r
-                       YAHOO.util.Event.removeListener(this.linkLeft, "mousedown", this.parent.doPreviousMonth);\r
-               }\r
-               this.linkLeft = document.createElement("A");\r
-               this.linkLeft.innerHTML = "&nbsp;";\r
-               this.linkLeft.style.backgroundImage =  "url(" + this.Options.NAV_ARROW_LEFT + ")";\r
-               this.linkLeft.className = this.Style.CSS_NAV_LEFT;\r
-               \r
-               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", this.parent.doPreviousMonth, this.parent);\r
-               headerContainer.appendChild(this.linkLeft);\r
-       }\r
-       \r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       \r
-       if (this.index == 1) {\r
-\r
-               if (this.linkRight) {\r
-                       YAHOO.util.Event.removeListener(this.linkRight, "mousedown", this.parent.doNextMonth);\r
-               }\r
-               this.linkRight = document.createElement("A");\r
-               this.linkRight.innerHTML = "&nbsp;";\r
-               this.linkRight.style.backgroundImage = "url(" + this.Options.NAV_ARROW_RIGHT + ")";\r
-               this.linkRight.className = this.Style.CSS_NAV_RIGHT;\r
-\r
-               YAHOO.util.Event.addListener(this.linkRight, "mousedown", this.parent.doNextMonth, this.parent);\r
-               headerContainer.appendChild(this.linkRight);\r
-       }\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
+* Adds the designated number of months to the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method addMonths\r
+* @param {Number}      count   The number of months to add to the current calendar\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.addMonths = function(count) {\r
+       this.callChildFunction("addMonths", count);\r
 };\r
 \r
 \r
-\r
-\r
 /**\r
-* @class\r
-* Calendar2up is the default implementation of the CalendarGroup base class, when used\r
-* in a 2-up view. This class is the UED-approved version of the 2-up calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for CalendarGroup. \r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
+* Subtracts the designated number of months from the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractMonths\r
+* @param {Number}      count   The number of months to subtract from the current calendar\r
 */\r
-YAHOO.widget.Calendar2up = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0)\r
-       {       \r
-               this.buildWrapper(containerId);\r
-               this.init(2, id, containerId, monthyear, selected);\r
-       }\r
-}\r
+YAHOO.widget.CalendarGroup.prototype.subtractMonths = function(count) {\r
+       this.callChildFunction("subtractMonths", count);\r
+};\r
 \r
-YAHOO.widget.Calendar2up.prototype = new YAHOO.widget.CalendarGroup();\r
+/**\r
+* Adds the designated number of years to the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method addYears\r
+* @param {Number}      count   The number of years to add to the current calendar\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.addYears = function(count) {\r
+       this.callChildFunction("addYears", count);\r
+};\r
 \r
 /**\r
-* CSS class representing the wrapper for the 2-up calendar\r
-* @type string\r
+* Subtcats the designated number of years from the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractYears\r
+* @param {Number}      count   The number of years to subtract from the current calendar\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPWRAPPER = "yui-cal2upwrapper";\r
+YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {\r
+       this.callChildFunction("subtractYears", count);\r
+};\r
 \r
 /**\r
 * CSS class representing the container for the calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_CONTAINER = "yui-calcontainer";\r
+YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";\r
 \r
 /**\r
-* CSS class representing the container for the 2-up calendar\r
-* @type string\r
+* CSS class representing the container for the calendar\r
+* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPCONTAINER = "cal2up";\r
+YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";\r
 \r
 /**\r
 * CSS class representing the title for the 2-up calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPTITLE = "title";\r
+YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";\r
 \r
 /**\r
 * CSS class representing the close icon for the 2-up calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPCLOSE = "close-icon";\r
+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";\r
+\r
+YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",\r
+                                                                                                                                "buildMonthLabel",\r
+                                                                                                                                "renderOutOfBoundsDate",\r
+                                                                                                                                "renderRowHeader",\r
+                                                                                                                                "renderRowFooter",\r
+                                                                                                                                "renderCellDefault",\r
+                                                                                                                                "styleCellDefault",\r
+                                                                                                                                "renderCellStyleHighlight1",\r
+                                                                                                                                "renderCellStyleHighlight2",\r
+                                                                                                                                "renderCellStyleHighlight3",\r
+                                                                                                                                "renderCellStyleHighlight4",\r
+                                                                                                                                "renderCellStyleToday",\r
+                                                                                                                                "renderCellStyleSelected",\r
+                                                                                                                                "renderCellNotThisMonth",\r
+                                                                                                                                "renderBodyCellRestricted",\r
+                                                                                                                                "initStyles",\r
+                                                                                                                                "configTitle",\r
+                                                                                                                                "configClose",\r
+                                                                                                                                "hide",\r
+                                                                                                                                "show",\r
+                                                                                                                                "browser");\r
 \r
 /**\r
-* Implementation of CalendarGroup.constructChild that ensures that child calendars of \r
-* Calendar2up will be of type Calendar2up_Cal.\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     A string representation of the CalendarGroup object.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.constructChild = function(id,containerId,monthyear,selected) {\r
-       var cal = new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);\r
-       return cal;\r
+YAHOO.widget.CalendarGroup.prototype.toString = function() {\r
+       return "CalendarGroup " + this.id;\r
 };\r
 \r
-/**\r
-* Builds the wrapper container for the 2-up calendar.\r
-* @param {String} containerId  The id of the outer container element.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.buildWrapper = function(containerId) {\r
-       var outerContainer = document.getElementById(containerId);\r
-       \r
-       outerContainer.className = YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;\r
-       \r
-       var innerContainer = document.createElement("DIV");\r
-       innerContainer.className = YAHOO.widget.Calendar2up.CSS_CONTAINER;\r
-       innerContainer.id = containerId + "_inner";\r
-       \r
-       var cal1Container = document.createElement("DIV");\r
-       cal1Container.id = containerId + "_0";\r
-       cal1Container.className = YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;\r
-       cal1Container.style.marginRight = "10px";\r
-       \r
-       var cal2Container = document.createElement("DIV");\r
-       cal2Container.id = containerId + "_1"; \r
-       cal2Container.className = YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;\r
-       \r
-       outerContainer.appendChild(innerContainer);\r
-       innerContainer.appendChild(cal1Container);\r
-       innerContainer.appendChild(cal2Container);\r
-       \r
-       this.innerContainer = innerContainer;\r
-       this.outerContainer = outerContainer;\r
-}\r
+YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;\r
 \r
 /**\r
-* Renders the 2-up calendar.\r
+* @class YAHOO.widget.Calendar2up\r
+* @extends YAHOO.widget.CalendarGroup\r
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.render = function() {\r
-       this.renderHeader();\r
-       YAHOO.widget.CalendarGroup.prototype.render.call(this);\r
-       this.renderFooter();\r
+YAHOO.widget.Calendar2up = function(id, containerId, config) {\r
+       this.init(id, containerId, config);\r
 };\r
 \r
-/**\r
-* Renders the header located at the top of the container for the 2-up calendar.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.renderHeader = function() {\r
-       if (! this.title) {\r
-               this.title = "";\r
-       }\r
-       if (! this.titleDiv)\r
-       {\r
-               this.titleDiv = document.createElement("DIV");\r
-               if (this.title == "")\r
-               {\r
-                       this.titleDiv.style.display="none";\r
-               }\r
-       }\r
-\r
-       this.titleDiv.className = YAHOO.widget.Calendar2up.CSS_2UPTITLE;\r
-       this.titleDiv.innerHTML = this.title;\r
-\r
-       if (this.outerContainer.style.position == "absolute")\r
-       {\r
-               var linkClose = document.createElement("A");\r
-               linkClose.href = "javascript:void(null)";\r
-               YAHOO.util.Event.addListener(linkClose, "click", this.hide, this);\r
-\r
-               var imgClose = document.createElement("IMG");\r
-               imgClose.src = YAHOO.widget.Calendar_Core.IMG_ROOT + "us/my/bn/x_d.gif";\r
-               imgClose.className = YAHOO.widget.Calendar2up.CSS_2UPCLOSE;\r
-\r
-               linkClose.appendChild(imgClose);\r
-\r
-               this.linkClose = linkClose;\r
-\r
-               this.titleDiv.appendChild(linkClose);\r
-       }\r
-\r
-       this.innerContainer.insertBefore(this.titleDiv, this.innerContainer.firstChild);\r
-}\r
-\r
-/**\r
-* Hides the 2-up calendar's outer container from view.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.hide = function(e, cal) {\r
-       if (! cal)\r
-       {\r
-               cal = this;\r
-       }\r
-       cal.outerContainer.style.display = "none";\r
-}\r
+YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);\r
 \r
 /**\r
-* Renders a footer for the 2-up calendar container. By default, this method is\r
-* unimplemented.\r
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.renderFooter = function() {}\r
-\r
 YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
\ No newline at end of file
index fbf497c5ba32ad1553825073a96c53b23de29702..9c91b944e47cb8dc0f261ee53aa4ef5c6ed66160 100755 (executable)
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.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;}}\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}\r
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
+return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
+return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}\r
+return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}\r
+var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}\r
+if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}\r
+if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}\r
+return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}\r
+for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}\r
+this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}\r
+return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
+return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
+return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}\r
+return false;};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;}}\r
 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;}\r
-return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}};this.after=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;}\r
-if(!calendarYear){calendarYear=date.getFullYear();}\r
-var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}}\r
-return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}\r
-return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}\r
-return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.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;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};}\r
-YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}\r
-YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();}\r
-this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();}\r
-this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur()\r
-cal.selectCell(index);}}}\r
-this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}}\r
-this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);}\r
-this.doNextMonth=function(e,cal){cal.nextMonth();}\r
-this.doPreviousMonth=function(e,cal){cal.previousMonth();}}\r
-YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){}\r
-YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",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"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;}\r
-if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;}\r
-if(this.Options.START_WEEKDAY>0){for(var w=0;w<this.Options.START_WEEKDAY;++w){this.Locale.WEEKDAYS_SHORT.push(this.Locale.WEEKDAYS_SHORT.shift());this.Locale.WEEKDAYS_MEDIUM.push(this.Locale.WEEKDAYS_MEDIUM.shift());this.Locale.WEEKDAYS_LONG.push(this.Locale.WEEKDAYS_LONG.shift());}}};YAHOO.widget.Calendar_Core.prototype.customConfig=function(){};YAHOO.widget.Calendar_Core.prototype.buildMonthLabel=function(){var text=this.Options.LOCALE_MONTHS[this.pageDate.getMonth()]+" "+this.pageDate.getFullYear();return text;};YAHOO.widget.Calendar_Core.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar_Core.prototype.buildShell=function(){this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.table.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();YAHOO.util.Event.addListener(window,"unload",this._unload,this);};YAHOO.widget.Calendar_Core.prototype.buildShellHeader=function(){var head=document.createElement("THEAD");var headRow=document.createElement("TR");var headerCell=document.createElement("TH");var colSpan=7;if(this.Config.Options.SHOW_WEEK_HEADER){this.weekHeaderCells=new Array();colSpan+=1;}\r
-if(this.Config.Options.SHOW_WEEK_FOOTER){this.weekFooterCells=new Array();colSpan+=1;}\r
-headerCell.colSpan=colSpan;YAHOO.widget.Calendar_Core.setCssClasses(headerCell,[this.Style.CSS_HEADER_TEXT]);this.headerCell=headerCell;headRow.appendChild(headerCell);head.appendChild(headRow);if(this.Options.SHOW_WEEKDAYS){var row=document.createElement("TR");var fillerCell;YAHOO.widget.Calendar_Core.setCssClasses(row,[this.Style.CSS_WEEKDAY_ROW]);if(this.Config.Options.SHOW_WEEK_HEADER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}\r
-for(var i=0;i<this.Options.LOCALE_WEEKDAYS.length;++i){var cell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_WEEKDAY_CELL]);cell.innerHTML=this.Options.LOCALE_WEEKDAYS[i];row.appendChild(cell);}\r
-if(this.Config.Options.SHOW_WEEK_FOOTER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}\r
-head.appendChild(row);}\r
-this.table.appendChild(head);};YAHOO.widget.Calendar_Core.prototype.buildShellBody=function(){this.tbody=document.createElement("TBODY");for(var r=0;r<6;++r){var row=document.createElement("TR");for(var c=0;c<this.headerCell.colSpan;++c){var cell;if(this.Config.Options.SHOW_WEEK_HEADER&&c===0){cell=document.createElement("TH");this.weekHeaderCells[this.weekHeaderCells.length]=cell;}else if(this.Config.Options.SHOW_WEEK_FOOTER&&c==(this.headerCell.colSpan-1)){cell=document.createElement("TH");this.weekFooterCells[this.weekFooterCells.length]=cell;}else{cell=document.createElement("TD");this.cells[this.cells.length]=cell;YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL]);YAHOO.util.Event.addListener(cell,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(cell,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(cell,"mouseout",this.doCellMouseOut,this);}\r
-row.appendChild(cell);}\r
-this.tbody.appendChild(row);}\r
-this.table.appendChild(this.tbody);};YAHOO.widget.Calendar_Core.prototype.buildShellFooter=function(){};YAHOO.widget.Calendar_Core.prototype.renderShell=function(){this.oDomContainer.appendChild(this.table);this.shellRendered=true;};YAHOO.widget.Calendar_Core.prototype.render=function(){if(!this.shellRendered){this.buildShell();this.renderShell();}\r
-this.resetRenderers();this.cellDates.length=0;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(workingDate);this.renderFooter();this.onRender();};YAHOO.widget.Calendar_Core.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar_Core.prototype.renderBody=function(workingDate){this.preMonthDays=workingDate.getDay();if(this.Options.START_WEEKDAY>0){this.preMonthDays-=this.Options.START_WEEKDAY;}\r
+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;}\r
+return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}\r
+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=(window.location.href.toLowerCase().indexOf("https")===0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");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.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_pageDate: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);}\r
+this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");if(this.browser=="ie"&&(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");this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}\r
+this.iframe=null;}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty("close");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);}\r
+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("title");var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="javascript:void(null);";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this,true);var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);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);}\r
+if(!title||title===""){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.selectEvent=new YAHOO.util.CustomEvent("select");this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.resetEvent=new YAHOO.util.CustomEvent("reset");this.clearEvent=new YAHOO.util.CustomEvent("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 target=YAHOO.util.Event.getTarget(e);var cell,index,d,date;while(target.tagName.toLowerCase()!="td"&&!YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}\r
+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();}\r
+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();}\r
+cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}\r
+while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}\r
+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;}\r
+while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}\r
+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(){this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.configSelected});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.configMinDate});this.cfg.addProperty("maxdate",{value:null,handler:this.configMaxDate});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/callt.gif",handler:this.configOptions});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/calrt.gif",handler:this.configOptions});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.configLocale});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};this.cfg.subscribeToConfigEvent("START_WEEKDAY",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_LONG",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_1CHAR",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_MEDIUM",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_LONG",refreshLocale,this,true);this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.configLocaleValues});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.configLocaleValues});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.configLocale});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.configLocale});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.configLocale});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.configLocale,validator:this.cfg.checkNumber});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){var val=args[0];var month,year,aMonthYear;if(val){if(val instanceof Date){val=YAHOO.widget.DateMath.findMonthStart(val);this.cfg.setProperty("pagedate",val,true);if(!this._pageDate){this._pageDate=this.cfg.getProperty("pagedate");}\r
+return;}else{aMonthYear=val.split(this.cfg.getProperty("DATE_FIELD_DELIMITER"));month=parseInt(aMonthYear[this.cfg.getProperty("MY_MONTH_POSITION")-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty("MY_YEAR_POSITION")-1],10);}}else{month=this.today.getMonth();year=this.today.getFullYear();}\r
+this.cfg.setProperty("pagedate",new Date(year,month,1),true);if(!this._pageDate){this._pageDate=this.cfg.getProperty("pagedate");}};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("mindate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("maxdate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];if(selected){if(typeof selected=='string'){this.cfg.setProperty("selected",this._parseDates(selected),true);}}\r
+if(!this._selectedDates){this._selectedDates=this.cfg.getProperty("selected");}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Options[type]=val;};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Locale[type]=val;this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){type=type.toUpperCase();var val=args[0];switch(type){case"LOCALE_MONTHS":switch(val){case"short":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_SHORT").concat();break;case"long":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_LONG").concat();break;}\r
+break;case"LOCALE_WEEKDAYS":switch(val){case"1char":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_1CHAR").concat();break;case"short":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_SHORT").concat();break;case"medium":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();break;case"long":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_LONG").concat();break;}\r
+var START_WEEKDAY=this.cfg.getProperty("START_WEEKDAY");if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}\r
+break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){this.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",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_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_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.buildMonthLabel=function(){var text=this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()]+" "+this.cfg.getProperty("pagedate").getFullYear();return text;};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;if(this.cfg.getProperty("SHOW_WEEK_HEADER")){colSpan+=1;}\r
+if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){colSpan+=1;}\r
+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;}\r
+if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}\r
+var cal=this.parent||this;if(renderLeft){html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'" style="background-image:url('+this.cfg.getProperty("NAV_ARROW_LEFT")+')">&#160;</a>';}\r
+html[html.length]=this.buildMonthLabel();if(renderRight){html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'" style="background-image:url('+this.cfg.getProperty("NAV_ARROW_RIGHT")+')">&#160;</a>';}\r
+html[html.length]='</div>';html[html.length]='</th>';html[html.length]='</tr>';if(this.cfg.getProperty("SHOW_WEEKDAYS")){html=this.buildWeekdays(html);}\r
+html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html[html.length]='<th>&#160;</th>';}\r
+for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}\r
+if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html[html.length]='<th>&#160;</th>';}\r
+html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var startDay=this.cfg.getProperty("START_WEEKDAY");this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}\r
 if(this.preMonthDays<0){this.preMonthDays+=7;}\r
-this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c<this.cells.length;++c){var cellRenderers=new Array();var cell=this.cells[c];this.clearElement(cell);cell.index=c;cell.id=this.id+"_cell"+c;this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(workingDate.getDay()==this.Options.START_WEEKDAY){var rowHeaderCell=null;var rowFooterCell=null;if(this.Options.SHOW_WEEK_HEADER){rowHeaderCell=this.weekHeaderCells[weekRowIndex];this.clearElement(rowHeaderCell);}\r
-if(this.Options.SHOW_WEEK_FOOTER){rowFooterCell=this.weekFooterCells[weekRowIndex];this.clearElement(rowFooterCell);}\r
-if(this.Options.HIDE_BLANK_WEEKS&&this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){continue;}else{if(rowHeaderCell){this.renderRowHeader(workingDate,rowHeaderCell);}\r
-if(rowFooterCell){this.renderRowFooter(workingDate,rowFooterCell);}}}\r
-var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=this.renderCellStyleToday;}\r
-if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=this.renderCellNotThisMonth;}else{for(var r=0;r<this.renderStack.length;++r){var rArray=this.renderStack[r];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar_Core.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(r,1);}\r
-break;case YAHOO.widget.Calendar_Core.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(r,1);}\r
-break;case YAHOO.widget.Calendar_Core.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(r,1);}}\r
-break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}\r
-break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}\r
+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 useDate,weekNum,weekClass;useDate=this.cfg.getProperty("pagedate");html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+'">';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="w"+weekNum;if(r!==0&&this.isDateOOM(workingDate)&&this.cfg.getProperty("HIDE_BLANK_WEEKS")===true){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html=this.renderRowHeader(weekNum,html);}\r
+for(var d=0;d<7;d++){var cellRenderers=[];this.clearElement(cell);YAHOO.util.Dom.addClass(cell,"calcell");cell.id=this.id+"_cell"+i;cell.innerHTML=i;var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}\r
+this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{YAHOO.util.Dom.addClass(cell,"wd"+workingDate.getDay());YAHOO.util.Dom.addClass(cell,"d"+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);}\r
+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);}\r
+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);}}\r
+break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}\r
+break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}\r
 break;}\r
 if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}\r
-if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;}\r
-if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);}\r
-if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);}\r
-if((this.minDate&&(workingDate.getTime()<this.minDate.getTime()))||(this.maxDate&&(workingDate.getTime()>this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;}\r
-for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call(this,workingDate,cell)==YAHOO.widget.Calendar_Core.STOP_RENDER){break;}}\r
-workingDate=YAHOO.widget.DateMath.add(workingDate,YAHOO.widget.DateMath.DAY,1);if(workingDate.getDay()==this.Options.START_WEEKDAY){weekRowIndex+=1;}\r
-YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);if(c>=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}\r
-if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}\r
-if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}\r
-var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}\r
-if(c>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;}\r
-cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;}\r
-YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();}\r
-var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){this.selectedDates[this.selectedDates.length]=toSelect;}}\r
-if(this.parent){this.parent.sync(this);}\r
-this.onSelect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.selectCell=function(cellIndex){this.onBeforeSelect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();this.selectedDates.push(selectDate);if(this.parent){this.parent.sync(this);}\r
-this.renderCellStyleSelected(dCellDate,cell);this.onSelect();this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselect=function(date){this.onBeforeDeselect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){this.selectedDates.splice(index,1);}}\r
-if(this.parent){this.parent.sync(this);}\r
-this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectCell=function(i){this.onBeforeDeselect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}\r
-this.selectedDates.splice(cellDateIndex,1);}\r
-if(this.parent){this.parent.sync(this);}\r
-this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);}\r
-if(count>0){this.onDeselect();}\r
-return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}\r
-return returnDate;};YAHOO.widget.Calendar_Core.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}\r
-return match;};YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;for(var s=0;s<this.selectedDates.length;++s){var sArray=this.selectedDates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}\r
-return selected;};YAHOO.widget.Calendar_Core.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.pageDate.getMonth()){isOOM=true;}\r
-return isOOM;};YAHOO.widget.Calendar_Core.prototype.onBeforeSelect=function(){if(!this.Options.MULTI_SELECT){this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}};YAHOO.widget.Calendar_Core.prototype.onSelect=function(){};YAHOO.widget.Calendar_Core.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onChangePage=function(){var me=this;this.renderHeader();if(this.renderProcId){clearTimeout(this.renderProcId);}\r
-this.renderProcId=setTimeout(function(){me.render();me.renderProcId=null;},1);};YAHOO.widget.Calendar_Core.prototype.onRender=function(){};YAHOO.widget.Calendar_Core.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.validate=function(){return true;};YAHOO.widget.Calendar_Core.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_Core.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_Core.DATE;}\r
-return rArray;};YAHOO.widget.Calendar_Core.prototype._parseDates=function(sDates){var aReturn=new Array();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);}}\r
-return aReturn;};YAHOO.widget.Calendar_Core.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=new Array();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);}\r
-return results;};YAHOO.widget.Calendar_Core.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.clearElement=function(cell){cell.innerHTML="&nbsp;";cell.className="";};YAHOO.widget.Calendar_Core.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_Core.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar_Core.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar_Core.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[month],fnRender);};YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar_Core.setCssClasses=function(element,aStyles){element.className="";var className=aStyles.join(" ");element.className=className;};YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar_Core.prototype.setMonth=function(month){this.pageDate.setMonth(month);};YAHOO.widget.Calendar_Core.prototype.setYear=function(year){this.pageDate.setFullYear(year);};YAHOO.widget.Calendar_Core.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d){var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}\r
-returnDates.sort();return returnDates;};YAHOO.widget.Calendar_Core._getBrowser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1)\r
-return'opera';else if(ua.indexOf('msie')!=-1)\r
-return'ie';else if(ua.indexOf('safari')!=-1)\r
-return'safari';else if(ua.indexOf('gecko')!=-1)\r
-return'gecko';else\r
-return false;}\r
-YAHOO.widget.Calendar_Core.prototype.toString=function(){return"Calendar_Core "+this.id;}\r
-YAHOO.widget.Cal_Core=YAHOO.widget.Calendar_Core;YAHOO.widget.Calendar=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}\r
-YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);}\r
-this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);}\r
-this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}}\r
-YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p<pageCount;++p){var cal=this.constructChild(id+"_"+p,this.containerId+"_"+p,monthyear,selected);cal.parent=this;cal.index=p;cal.pageDate.setMonth(cal.pageDate.getMonth()+p);cal._pageDate=new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());this.pages.push(cal);}\r
-this.doNextMonth=function(e,calGroup){calGroup.nextMonth();};this.doPreviousMonth=function(e,calGroup){calGroup.previousMonth();};};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){for(var p=0;p<this.pageCount;++p){this.pages[p][fnName]=fn;}}\r
-YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){for(var p=0;p<this.pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}}\r
-YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,monthyear,selected){return new YAHOO.widget.Calendar_Core(id,containerId,monthyear,selected);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];if((cal.pageDate.getMonth()+1)==1&&p>0)\r
-{year+=1;}\r
-cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.render();}};YAHOO.widget.CalendarGroup.prototype.select=function(date){var ret;for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];ret=cal.select(date);}\r
-return ret;};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){var ret;for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];ret=cal.selectCell(cellIndex);}\r
-return ret;};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){var ret;for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];ret=cal.deselect(date);}\r
-return ret;};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){var ret;for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];ret=cal.deselectAll();}\r
-return ret;};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.deselectCell(cellIndex);}\r
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p)\r
-{var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.sync=function(caller){var calendar;if(caller)\r
-{this.selectedDates=caller.selectedDates.concat();}else{var hash=new Object();var combinedDates=new Array();for(var p=0;p<this.pages.length;++p)\r
-{calendar=this.pages[p];var values=calendar.selectedDates;for(var v=0;v<values.length;++v)\r
-{var valueArray=values[v];hash[valueArray.toString()]=valueArray;}}\r
-for(var val in hash)\r
-{combinedDates[combinedDates.length]=hash[val];}\r
-this.selectedDates=combinedDates.concat();}\r
-for(p=0;p<this.pages.length;++p)\r
-{calendar=this.pages[p];if(!calendar.Options.MULTI_SELECT){calendar.clearAllBodyCellStyles(calendar.Config.Style.CSS_CELL_SELECTED);}\r
-calendar.selectedDates=this.selectedDates.concat();}\r
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d)\r
-{var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}\r
-returnDates.sort();return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p)\r
-{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)\r
-{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)\r
-{var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.wireEvent=function(eventName,fn){for(var p=0;p<this.pages.length;++p)\r
-{var cal=this.pages[p];cal[eventName]=fn;}};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;}\r
-YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up_Cal=function(id,containerId,monthyear,selected){if(arguments.length>0)\r
-{this.init(id,containerId,monthyear,selected);}}\r
-YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);}\r
-this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);}\r
-headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);}\r
-this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);}\r
-this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0)\r
-{this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}}\r
-YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;}\r
-YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";}\r
-if(!this.titleDiv)\r
-{this.titleDiv=document.createElement("DIV");if(this.title=="")\r
-{this.titleDiv.style.display="none";}}\r
-this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute")\r
-{var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);}\r
-this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);}\r
-YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal)\r
-{cal=this;}\r
-cal.outerContainer.style.display="none";}\r
-YAHOO.widget.Calendar2up.prototype.renderFooter=function(){}\r
-YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;\r
+if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}\r
+var mindate=this.cfg.getProperty("mindate");var maxdate=this.cfg.getProperty("maxdate");if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}\r
+if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}\r
+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;}\r
+for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call((this.parent||this),workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}\r
+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);}\r
+if((i%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}\r
+if(((i+1)%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}\r
+var postDays=this.postMonthDays;if(postDays>=7&&this.cfg.getProperty("HIDE_BLANK_WEEKS")){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}\r
+if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}\r
+html[html.length]=tempDiv.innerHTML;i++;}\r
+if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html=this.renderRowFooter(weekNum,html);}\r
+html[html.length]='</tr>';}}\r
+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 workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));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("title");this.cfg.refireEvent("close");this.cfg.refireEvent("iframe");this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners=function(){var root=this.oDomContainer;var cal=this.parent||this;var linkLeft,linkRight;linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,"a",root);linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,"a",root);if(linkLeft){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,"mousedown",cal.previousMonth,cal,true);}\r
+if(linkRight){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,"mousedown",cal.nextMonth,cal,true);}\r
+if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(this.domEventMap.hasOwnProperty(cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}\r
+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);}}}}}\r
+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="javascript:void(null);" >'+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){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),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(){this.cfg.resetProperty("selected");this.cfg.resetProperty("pagedate");this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){this.cfg.setProperty("selected",[]);this.cfg.setProperty("pagedate",new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.select=function(date){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}\r
+if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}\r
+this.selectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();selected[selected.length]=selectDate;if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}\r
+this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){selected.splice(index,1);}}\r
+if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}\r
+this.deselectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(i){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty("pagedate").getMonth()==dCellDate.getMonth()&&this.cfg.getProperty("pagedate").getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}\r
+selected.splice(cellDateIndex,1);}\r
+if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}\r
+this.deselectEvent.fire(selectDate);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty("selected",[]);}else{this.cfg.setProperty("selected",[]);}\r
+if(count>0){this.deselectEvent.fire(sel);}\r
+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(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}\r
+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;}\r
+return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty("selected");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;}}\r
+return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.cfg.getProperty("pagedate").getMonth()){isOOM=true;}\r
+return isOOM;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty("MULTI_SELECT")===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;}\r
+for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}\r
+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);}}\r
+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);}\r
+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 current=this.cfg.getProperty("pagedate");current.setMonth(month);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(year);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");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);}\r
+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);}\r
+this.cfg.fireQueue();if(this.browser=="opera"){var 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;}\r
+if(w>0){this.oDomContainer.style.width=w+"px";}};this.renderEvent.subscribe(fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){this.cfg.addProperty("pages",{value:2,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.delegateConfig});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("maxdate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/callt.gif",handler:this.delegateConfig});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/calrt.gif",handler:this.delegateConfig});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.delegateConfig});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.delegateConfig});this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.delegateConfig});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.delegateConfig});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.delegateConfig});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.delegateConfig});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.delegateConfig});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.delegateConfig,validator:this.cfg.checkNumber});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].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+"Event"].unsubscribe(fn,obj);}};this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent("select");this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent("render");this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent("reset");this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent("clear");this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];for(var p=0;p<pageCount;++p){var calId=this.id+"_"+p;var calContainerId=this.containerId+"_"+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty("pagedate");caldate.setMonth(caldate.getMonth()+p);cal.cfg.setProperty("pagedate",caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(cal.oDomContainer,"groupcal");if(p===0){YAHOO.util.Dom.addClass(cal.oDomContainer,"first");}\r
+if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,"last");}\r
+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];for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.cfg.setProperty("pagedate",val);var calDate=cal.cfg.getProperty("pagedate");calDate.setMonth(calDate.getMonth()+p);}};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("pages");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("pages");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);}\r
+return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pageDate");if((pageDate.getMonth()+1)==1&&p>0){year+=1;}\r
+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();}\r
+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);}\r
+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);}\r
+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);}\r
+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();}\r
+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);}\r
+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("selected");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);}\r
+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.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.augment(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","hide","show","browser");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;
\ No newline at end of file
index 4e6e836dbd9005eff887166d036b892e38ad32dd..35935516c6f8cc88cbf1e51467e7c36c954d3cd9 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version 0.12.0\r
 */\r
 \r
 /**\r
-* @class\r
-* <p>YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
-* used for adding, subtracting, and comparing dates.</p>\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
+* @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
+*/\r
+YAHOO.util.Config = function(owner) {\r
+       if (owner) {\r
+               this.init(owner);\r
+       }\r
+};\r
+\r
+YAHOO.util.Config.prototype = {\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
+       */\r
+       owner : null,\r
+\r
+       /**\r
+       * Boolean flag that specifies whether a queue is currently being executed\r
+       * @property queueInProgress\r
+       * @type Boolean\r
+       */\r
+       queueInProgress : false,\r
+\r
+\r
+       /**\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
+       */\r
+       checkBoolean: function(val) {\r
+               if (typeof val == 'boolean') {\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       },\r
+\r
+       /**\r
+       * Validates that the value passed in is a number.\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
+       */\r
+       checkNumber: function(val) {\r
+               if (isNaN(val)) {\r
+                       return false;\r
+               } else {\r
+                       return true;\r
+               }\r
+       }\r
+};\r
+\r
+\r
+/**\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
+*/\r
+YAHOO.util.Config.prototype.init = function(owner) {\r
+\r
+       this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
+       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
+\r
+       this.queueInProgress = false;\r
+\r
+       /* Private Members */\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
+       var eventQueue = [];\r
+\r
+       /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
+       * @private\r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
+       var fireEvent = function( key, value ) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       property.event.fire(value);\r
+               }\r
+       };\r
+       /* End Private Members */\r
+\r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
+       this.addProperty = function( key, propertyObject ) {\r
+               key = key.toLowerCase();\r
+\r
+               config[key] = propertyObject;\r
+\r
+               propertyObject.event = new YAHOO.util.CustomEvent(key);\r
+               propertyObject.key = key;\r
+\r
+               if (propertyObject.handler) {\r
+                       propertyObject.event.subscribe(propertyObject.handler, this.owner, true);\r
+               }\r
+\r
+               this.setProperty(key, propertyObject.value, true);\r
+\r
+               if (! propertyObject.suppressEvent) {\r
+                       this.queueProperty(key, propertyObject.value);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
+       this.getConfig = function() {\r
+               var cfg = {};\r
+\r
+               for (var prop in config) {\r
+                       var property = config[prop];\r
+                       if (typeof property != 'undefined' && property.event) {\r
+                               cfg[prop] = property.value;\r
+                       }\r
+               }\r
+\r
+               return cfg;\r
+       };\r
+\r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
+       this.getProperty = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       return property.value;\r
+               } else {\r
+                       return undefined;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
+       this.resetProperty = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
+       this.setProperty = function(key, value, silent) {\r
+               key = key.toLowerCase();\r
+\r
+               if (this.queueInProgress && ! silent) {\r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
+                       return true;\r
+               } else {\r
+                       var property = config[key];\r
+                       if (typeof property != 'undefined' && property.event) {\r
+                               if (property.validator && ! property.validator(value)) { // validator\r
+                                       return false;\r
+                               } else {\r
+                                       property.value = value;\r
+                                       if (! silent) {\r
+                                               fireEvent(key, value);\r
+                                               this.configChangedEvent.fire([key, value]);\r
+                                       }\r
+                                       return true;\r
+                               }\r
+                       } else {\r
+                               return false;\r
+                       }\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
+       this.queueProperty = function(key, value) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
+                               return false;\r
+                       } else {\r
+\r
+                               if (typeof value != 'undefined') {\r
+                                       property.value = value;\r
+                               } else {\r
+                                       value = property.value;\r
+                               }\r
+\r
+                               var foundDuplicate = false;\r
+\r
+                               for (var i=0;i<eventQueue.length;i++) {\r
+                                       var queueItem = eventQueue[i];\r
+\r
+                                       if (queueItem) {\r
+                                               var queueItemKey = queueItem[0];\r
+                                               var queueItemValue = queueItem[1];\r
+\r
+                                               if (queueItemKey.toLowerCase() == key) {\r
+                                                       // found a dupe... push to end of queue, null current item, and break\r
+                                                       eventQueue[i] = null;\r
+                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);\r
+                                                       foundDuplicate = true;\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
+                                       eventQueue.push([key, value]);\r
+                               }\r
+                       }\r
+\r
+                       if (property.supercedes) {\r
+                               for (var s=0;s<property.supercedes.length;s++) {\r
+                                       var supercedesCheck = property.supercedes[s];\r
+\r
+                                       for (var q=0;q<eventQueue.length;q++) {\r
+                                               var queueItemCheck = eventQueue[q];\r
+\r
+                                               if (queueItemCheck) {\r
+                                                       var queueItemCheckKey = queueItemCheck[0];\r
+                                                       var queueItemCheckValue = queueItemCheck[1];\r
+\r
+                                                       if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
+                                                               eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
+                                                               eventQueue[q] = null;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
+       this.refireEvent = function(key) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event && typeof property.value != 'undefined') {\r
+                       if (this.queueInProgress) {\r
+                               this.queueProperty(key);\r
+                       } else {\r
+                               fireEvent(key, property.value);\r
+                       }\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
+       this.applyConfig = function(userConfig, init) {\r
+               if (init) {\r
+                       initialConfig = userConfig;\r
+               }\r
+               for (var prop in userConfig) {\r
+                       this.queueProperty(prop, userConfig[prop]);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
+       this.refresh = function() {\r
+               for (var prop in config) {\r
+                       this.refireEvent(prop);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
+       this.fireQueue = function() {\r
+               this.queueInProgress = true;\r
+               for (var i=0;i<eventQueue.length;i++) {\r
+                       var queueItem = eventQueue[i];\r
+                       if (queueItem) {\r
+                               var key = queueItem[0];\r
+                               var value = queueItem[1];\r
+\r
+                               var property = config[key];\r
+                               property.value = value;\r
+\r
+                               fireEvent(key,value);\r
+                       }\r
+               }\r
+\r
+               this.queueInProgress = false;\r
+               eventQueue = [];\r
+       };\r
+\r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
+       this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       if (! YAHOO.util.Config.alreadySubscribed(property.event, handler, obj)) {\r
+                               property.event.subscribe(handler, obj, override);\r
+                       }\r
+                       return true;\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
+       this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
+               key = key.toLowerCase();\r
+\r
+               var property = config[key];\r
+               if (typeof property != 'undefined' && property.event) {\r
+                       return property.event.unsubscribe(handler, obj);\r
+               } else {\r
+                       return false;\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
+       this.toString = function() {\r
+               var output = "Config";\r
+               if (this.owner) {\r
+                       output += " [" + this.owner.toString() + "]";\r
+               }\r
+               return output;\r
+       };\r
+\r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
+       this.outputEventQueue = function() {\r
+               var output = "";\r
+               for (var q=0;q<eventQueue.length;q++) {\r
+                       var queueItem = eventQueue[q];\r
+                       if (queueItem) {\r
+                               output += queueItem[0] + "=" + queueItem[1] + ", ";\r
+                       }\r
+               }\r
+               return output;\r
+       };\r
+};\r
+\r
+/**\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
+* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
+* @param {Function}    fn      The function to look for in the subscribers list\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
-YAHOO.widget.DateMath = new function() {\r
+YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
+       for (var e=0;e<evt.subscribers.length;e++) {\r
+               var subsc = evt.subscribers[e];\r
+               if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
+                       return true;\r
+               }\r
+       }\r
+       return false;\r
+};\r
 \r
+/**\r
+* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
+* used for adding, subtracting, and comparing dates.\r
+* @class YAHOO.widget.DateMath\r
+*/\r
+YAHOO.widget.DateMath = {\r
        /**\r
        * Constant field representing Day\r
+       * @property DAY\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.DAY = "D";\r
+       DAY : "D",\r
 \r
        /**\r
        * Constant field representing Week\r
+       * @property WEEK\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.WEEK = "W";\r
+       WEEK : "W",\r
 \r
        /**\r
        * Constant field representing Year\r
+       * @property YEAR\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.YEAR = "Y";\r
+       YEAR : "Y",\r
 \r
        /**\r
        * Constant field representing Month\r
+       * @property MONTH\r
+       * @static\r
+       * @final\r
        * @type String\r
        */\r
-       this.MONTH = "M";\r
+       MONTH : "M",\r
 \r
        /**\r
        * Constant field representing one day, in milliseconds\r
-       * @type Integer\r
+       * @property ONE_DAY_MS\r
+       * @static\r
+       * @final\r
+       * @type Number\r
        */\r
-       this.ONE_DAY_MS = 1000*60*60*24;\r
+       ONE_DAY_MS : 1000*60*60*24,\r
 \r
        /**\r
        * Adds the specified amount of time to the this instance.\r
+       * @method add\r
        * @param {Date} date    The JavaScript Date object to perform addition on\r
-       * @param {string} field The this field constant to be used for performing addition.\r
-       * @param {Integer} amount       The number of units (measured in the field constant) to add to the date.\r
+       * @param {String} field The field constant to be used for performing addition.\r
+       * @param {Number} amount        The number of units (measured in the field constant) to add to the date.\r
+       * @return {Date} The resulting Date object\r
        */\r
-       this.add = function(date, field, amount) {\r
+       add : function(date, field, amount) {\r
                var d = new Date(date.getTime());\r
                switch (field) {\r
                        case this.MONTH:\r
@@ -67,7 +550,7 @@ YAHOO.widget.DateMath = new function() {
                                                years += 1;\r
                                        }\r
                                }\r
-                               \r
+\r
                                d.setMonth(newMonth);\r
                                d.setFullYear(date.getFullYear() + years);\r
                                break;\r
@@ -82,86 +565,93 @@ YAHOO.widget.DateMath = new function() {
                                break;\r
                }\r
                return d;\r
-       };\r
+       },\r
 \r
        /**\r
        * Subtracts the specified amount of time from the this instance.\r
+       * @method subtract\r
        * @param {Date} date    The JavaScript Date object to perform subtraction on\r
-       * @param {Integer} field        The this field constant to be used for performing subtraction.\r
-       * @param {Integer} amount       The number of units (measured in the field constant) to subtract from the date.\r
+       * @param {Number} field The this field constant to be used for performing subtraction.\r
+       * @param {Number} amount        The number of units (measured in the field constant) to subtract from the date.\r
+       * @return {Date} The resulting Date object\r
        */\r
-       this.subtract = function(date, field, amount) {\r
+       subtract : function(date, field, amount) {\r
                return this.add(date, field, (amount*-1));\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is before another date on the calendar.\r
+       * @method before\r
        * @param {Date} date            The Date object to compare with the compare argument\r
        * @param {Date} compareTo       The Date object to use for the comparison\r
        * @return {Boolean} true if the date occurs before the compared date; false if not.\r
        */\r
-       this.before = function(date, compareTo) {\r
+       before : function(date, compareTo) {\r
                var ms = compareTo.getTime();\r
                if (date.getTime() < ms) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is after another date on the calendar.\r
+       * @method after\r
        * @param {Date} date            The Date object to compare with the compare argument\r
        * @param {Date} compareTo       The Date object to use for the comparison\r
        * @return {Boolean} true if the date occurs after the compared date; false if not.\r
        */\r
-       this.after = function(date, compareTo) {\r
+       after : function(date, compareTo) {\r
                var ms = compareTo.getTime();\r
                if (date.getTime() > ms) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines whether a given date is between two other dates on the calendar.\r
+       * @method between\r
        * @param {Date} date            The date to check for\r
        * @param {Date} dateBegin       The start of the range\r
        * @param {Date} dateEnd         The end of the range\r
        * @return {Boolean} true if the date occurs between the compared dates; false if not.\r
        */\r
-       this.between = function(date, dateBegin, dateEnd) {\r
+       between : function(date, dateBegin, dateEnd) {\r
                if (this.after(date, dateBegin) && this.before(date, dateEnd)) {\r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       };\r
-       \r
+       },\r
+\r
        /**\r
        * Retrieves a JavaScript Date object representing January 1 of any given year.\r
-       * @param {Integer} calendarYear         The calendar year for which to retrieve January 1\r
+       * @method getJan1\r
+       * @param {Number} calendarYear          The calendar year for which to retrieve January 1\r
        * @return {Date}        January 1 of the calendar year specified.\r
        */\r
-       this.getJan1 = function(calendarYear) {\r
-               return new Date(calendarYear,0,1); \r
-       };\r
+       getJan1 : function(calendarYear) {\r
+               return new Date(calendarYear,0,1);\r
+       },\r
 \r
        /**\r
        * Calculates the number of days the specified date is from January 1 of the specified calendar year.\r
        * Passing January 1 to this function would return an offset value of zero.\r
+       * @method getDayOffset\r
        * @param {Date} date    The JavaScript date for which to find the offset\r
-       * @param {Integer} calendarYear The calendar year to use for determining the offset\r
-       * @return {Integer}     The number of days since January 1 of the given year\r
+       * @param {Number} calendarYear  The calendar year to use for determining the offset\r
+       * @return {Number}      The number of days since January 1 of the given year\r
        */\r
-       this.getDayOffset = function(date, calendarYear) {\r
+       getDayOffset : function(date, calendarYear) {\r
                var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.\r
-               \r
+\r
                // Find the number of days the passed in date is away from the calendar year start\r
                var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);\r
                return dayOffset;\r
-       };\r
+       },\r
 \r
        /**\r
        * Calculates the week number for the given date. This function assumes that week 1 is the\r
@@ -170,126 +660,103 @@ YAHOO.widget.DateMath = new function() {
        * date if the date overlaps years. For instance, a week may be considered week 1 of 2005, or\r
        * week 53 of 2004. Specifying the optional calendarYear allows one to make this distinction\r
        * easily.\r
+       * @method getWeekNumber\r
        * @param {Date} date    The JavaScript date for which to find the week number\r
-       * @param {Integer} calendarYear OPTIONAL - The calendar year to use for determining the week number. Default is\r
+       * @param {Number} calendarYear  OPTIONAL - The calendar year to use for determining the week number. Default is\r
        *                                                                                       the calendar year of parameter "date".\r
-       * @param {Integer} weekStartsOn OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).\r
-       * @return {Integer}     The week number of the given date.\r
+       * @param {Number} weekStartsOn  OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).\r
+       * @return {Number}      The week number of the given date.\r
        */\r
-       this.getWeekNumber = function(date, calendarYear, weekStartsOn) {\r
-               date.setHours(12,0,0,0);\r
+       getWeekNumber : function(date, calendarYear) {\r
+               date = this.clearTime(date);\r
+               var nearestThurs = new Date(date.getTime() + (4 * this.ONE_DAY_MS) - ((date.getDay()) * this.ONE_DAY_MS));\r
 \r
-               if (! weekStartsOn) {\r
-                       weekStartsOn = 0;\r
-               }\r
-               if (! calendarYear) {\r
-                       calendarYear = date.getFullYear();\r
-               }\r
-               \r
-               var weekNum = -1;\r
-               \r
-               var jan1 = this.getJan1(calendarYear);\r
-\r
-               var jan1Offset = jan1.getDay() - weekStartsOn;\r
-               var jan1DayOfWeek = (jan1Offset >= 0 ? jan1Offset : (7 + jan1Offset));\r
-\r
-               var endOfWeek1 = this.add(jan1, this.DAY, (6 - jan1DayOfWeek));\r
-               endOfWeek1.setHours(23,59,59,999);\r
-\r
-               var month = date.getMonth();\r
-               var day = date.getDate();\r
-               var year = date.getFullYear();\r
-               \r
-               var dayOffset = this.getDayOffset(date, calendarYear); // Days since Jan 1, Calendar Year\r
-                       \r
-               if (dayOffset < 0 || this.before(date, endOfWeek1)) {\r
-                       weekNum = 1;\r
-               } else {\r
-                       weekNum = 2;\r
-                       var weekBegin = new Date(endOfWeek1.getTime() + 1);\r
-                       var weekEnd = this.add(weekBegin, this.WEEK, 1);\r
-\r
-                       while (! this.between(date, weekBegin, weekEnd)) {\r
-                               weekBegin = this.add(weekBegin, this.WEEK, 1);\r
-                               weekEnd = this.add(weekEnd, this.WEEK, 1);\r
-                               weekNum += 1;\r
-                       }\r
-               }\r
-               \r
+               var jan1 = new Date(nearestThurs.getFullYear(),0,1);\r
+               var dayOfYear = ((nearestThurs.getTime() - jan1.getTime()) / this.ONE_DAY_MS) - 1;\r
+\r
+               var weekNum = Math.ceil((dayOfYear)/ 7);\r
                return weekNum;\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines if a given week overlaps two different years.\r
+       * @method isYearOverlapWeek\r
        * @param {Date} weekBeginDate   The JavaScript Date representing the first day of the week.\r
        * @return {Boolean}     true if the date overlaps two different years.\r
        */\r
-       this.isYearOverlapWeek = function(weekBeginDate) {\r
+       isYearOverlapWeek : function(weekBeginDate) {\r
                var overlaps = false;\r
                var nextWeek = this.add(weekBeginDate, this.DAY, 6);\r
                if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {\r
                        overlaps = true;\r
                }\r
                return overlaps;\r
-       };\r
+       },\r
 \r
        /**\r
        * Determines if a given week overlaps two different months.\r
+       * @method isMonthOverlapWeek\r
        * @param {Date} weekBeginDate   The JavaScript Date representing the first day of the week.\r
        * @return {Boolean}     true if the date overlaps two different months.\r
        */\r
-       this.isMonthOverlapWeek = function(weekBeginDate) {\r
+       isMonthOverlapWeek : function(weekBeginDate) {\r
                var overlaps = false;\r
                var nextWeek = this.add(weekBeginDate, this.DAY, 6);\r
                if (nextWeek.getMonth() != weekBeginDate.getMonth()) {\r
                        overlaps = true;\r
                }\r
                return overlaps;\r
-       };\r
+       },\r
 \r
        /**\r
        * Gets the first day of a month containing a given date.\r
+       * @method findMonthStart\r
        * @param {Date} date    The JavaScript Date used to calculate the month start\r
        * @return {Date}                The JavaScript Date representing the first day of the month\r
        */\r
-       this.findMonthStart = function(date) {\r
+       findMonthStart : function(date) {\r
                var start = new Date(date.getFullYear(), date.getMonth(), 1);\r
                return start;\r
-       };\r
+       },\r
 \r
        /**\r
        * Gets the last day of a month containing a given date.\r
+       * @method findMonthEnd\r
        * @param {Date} date    The JavaScript Date used to calculate the month end\r
        * @return {Date}                The JavaScript Date representing the last day of the month\r
        */\r
-       this.findMonthEnd = function(date) {\r
+       findMonthEnd : function(date) {\r
                var start = this.findMonthStart(date);\r
                var nextMonth = this.add(start, this.MONTH, 1);\r
                var end = this.subtract(nextMonth, this.DAY, 1);\r
                return end;\r
-       };\r
+       },\r
 \r
        /**\r
        * Clears the time fields from a given date, effectively setting the time to midnight.\r
+       * @method clearTime\r
        * @param {Date} date    The JavaScript Date for which the time fields will be cleared\r
        * @return {Date}                The JavaScript Date cleared of all time fields\r
        */\r
-       this.clearTime = function(date) {\r
-               date.setHours(0,0,0,0);\r
+       clearTime : function(date) {\r
+               date.setHours(12,0,0,0);\r
                return date;\r
-       };\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+       }\r
+};\r
+\r
+/**\r
+* 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 ("one-up") or two-month ("two-up") interface. Calendars are generated entirely via script and can be navigated without any page refreshes.\r
+* @module    Calendar\r
+* @title     Calendar Widget\r
+* @namespace YAHOO.widget\r
+* @requires  yahoo,dom,event\r
+*/\r
 \r
 /**\r
-* @class\r
-* <p>Calendar_Core is the base class for the Calendar widget. In its most basic\r
+* Calendar is the base class for the Calendar widget. In its most basic\r
 * implementation, it has the ability to render a calendar widget on the page\r
 * that can be manipulated to select a single date, move back and forth between\r
-* months and years.</p>\r
+* months and years.\r
 * <p>To construct the placeholder for the calendar widget, the code is as\r
 * follows:\r
 *      <xmp>\r
@@ -297,2049 +764,3088 @@ http://developer.yahoo.net/yui/license.txt
 *      </xmp>\r
 * Note that the table can be replaced with any kind of element.\r
 * </p>\r
+* @namespace YAHOO.widget\r
+* @class Calendar\r
 * @constructor\r
 * @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar_Core = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.Calendar = function(id, containerId, config) {\r
+       this.init(id, containerId, config);\r
+};\r
 \r
 /**\r
 * The path to be used for images loaded for the Calendar\r
+* @property YAHOO.widget.Calendar.IMG_ROOT\r
+* @static\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.IMG_ROOT = (window.location.href.toLowerCase().indexOf("https") == 0 ? "https://a248.e.akamai.net/sec.yimg.com/i/" : "http://us.i1.yimg.com/us.yimg.com/i/");\r
+YAHOO.widget.Calendar.IMG_ROOT = (window.location.href.toLowerCase().indexOf("https") === 0 ? "https://a248.e.akamai.net/sec.yimg.com/i/" : "http://us.i1.yimg.com/us.yimg.com/i/");\r
 \r
 /**\r
 * Type constant used for renderers to represent an individual date (M/D/Y)\r
+* @property YAHOO.widget.Calendar.DATE\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.DATE = "D";\r
+YAHOO.widget.Calendar.DATE = "D";\r
 \r
 /**\r
 * Type constant used for renderers to represent an individual date across any year (M/D)\r
+* @property YAHOO.widget.Calendar.MONTH_DAY\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.MONTH_DAY = "MD";\r
+YAHOO.widget.Calendar.MONTH_DAY = "MD";\r
 \r
 /**\r
 * Type constant used for renderers to represent a weekday\r
+* @property YAHOO.widget.Calendar.WEEKDAY\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.WEEKDAY = "WD";\r
+YAHOO.widget.Calendar.WEEKDAY = "WD";\r
 \r
 /**\r
 * Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y)\r
+* @property YAHOO.widget.Calendar.RANGE\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.RANGE = "R";\r
+YAHOO.widget.Calendar.RANGE = "R";\r
 \r
 /**\r
 * Type constant used for renderers to represent a month across any year\r
+* @property YAHOO.widget.Calendar.MONTH\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.MONTH = "M";\r
+YAHOO.widget.Calendar.MONTH = "M";\r
 \r
 /**\r
 * Constant that represents the total number of date cells that are displayed in a given month\r
-* including \r
+* @property YAHOO.widget.Calendar.DISPLAY_DAYS\r
+* @static\r
 * @final\r
-* @type Integer\r
+* @type Number\r
 */\r
-YAHOO.widget.Calendar_Core.DISPLAY_DAYS = 42;\r
+YAHOO.widget.Calendar.DISPLAY_DAYS = 42;\r
 \r
 /**\r
 * Constant used for halting the execution of the remainder of the render stack\r
+* @property YAHOO.widget.Calendar.STOP_RENDER\r
+* @static\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.Calendar_Core.STOP_RENDER = "S";\r
+YAHOO.widget.Calendar.STOP_RENDER = "S";\r
 \r
-YAHOO.widget.Calendar_Core.prototype = {\r
+YAHOO.widget.Calendar.prototype = {\r
 \r
        /**\r
        * The configuration object used to set up the calendars various locale and style options.\r
+       * @property Config\r
+       * @private\r
+       * @deprecated Configuration properties should be set by calling Calendar.cfg.setProperty.\r
        * @type Object\r
        */\r
        Config : null,\r
 \r
        /**\r
        * The parent CalendarGroup, only to be set explicitly by the parent group\r
+       * @property parent\r
        * @type CalendarGroup\r
-       */      \r
+       */\r
        parent : null,\r
 \r
        /**\r
        * The index of this item in the parent group\r
-       * @type Integer\r
+       * @property index\r
+       * @type Number\r
        */\r
        index : -1,\r
 \r
        /**\r
        * The collection of calendar table cells\r
+       * @property cells\r
        * @type HTMLTableCellElement[]\r
        */\r
        cells : null,\r
 \r
-       /**\r
-       * The collection of calendar week header cells\r
-       * @type HTMLTableCellElement[]\r
-       */\r
-       weekHeaderCells : null,\r
-\r
-       /**\r
-       * The collection of calendar week footer cells\r
-       * @type HTMLTableCellElement[]\r
-       */\r
-       weekFooterCells : null,\r
-       \r
        /**\r
        * 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].\r
-       * @type Array[](Integer[])\r
+       * @property cellDates\r
+       * @type Array[](Number[])\r
        */\r
        cellDates : null,\r
 \r
        /**\r
        * The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.\r
+       * @property id\r
        * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
        * 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.\r
+       * @property oDomContainer\r
        * @type HTMLElement\r
        */\r
        oDomContainer : null,\r
 \r
        /**\r
        * A Date object representing today's date.\r
+       * @property today\r
        * @type Date\r
        */\r
        today : null,\r
 \r
        /**\r
-       * The list of render functions, along with required parameters, used to render cells. \r
+       * The list of render functions, along with required parameters, used to render cells.\r
+       * @property renderStack\r
        * @type Array[]\r
        */\r
        renderStack : null,\r
 \r
        /**\r
        * A copy of the initial render functions created before rendering.\r
-       * @type Array\r
+       * @property _renderStack\r
        * @private\r
+       * @type Array\r
        */\r
        _renderStack : null,\r
 \r
-       /**\r
-       * A Date object representing the month/year that the calendar is currently set to\r
-       * @type Date\r
-       */\r
-       pageDate : null,\r
-\r
        /**\r
        * A Date object representing the month/year that the calendar is initially set to\r
-       * @type Date\r
+       * @property _pageDate\r
        * @private\r
-       */\r
-       _pageDate : null,\r
-       \r
-       /**\r
-       * A Date object representing the minimum selectable date\r
        * @type Date\r
        */\r
-       minDate : null,\r
-       \r
-       /**\r
-       * A Date object representing the maximum selectable date\r
-       * @type Date\r
-       */\r
-       maxDate : null,\r
-       \r
-       /**\r
-       * The list of currently selected dates. The data format for this local collection is \r
-       * an array of date field arrays, e.g:\r
-       * [\r
-       *       [2004,5,25],\r
-       *       [2004,5,26]\r
-       * ]\r
-       * @type Array[](Integer[])\r
-       */\r
-       selectedDates : null,\r
+       _pageDate : null,\r
 \r
        /**\r
        * The private list of initially selected dates.\r
-       * @type Array\r
+       * @property _selectedDates\r
        * @private\r
+       * @type Array\r
        */\r
        _selectedDates : null,\r
 \r
        /**\r
-       * A boolean indicating whether the shell of the calendar has already been rendered to the page\r
-       * @type Boolean\r
-       */      \r
-       shellRendered : false,\r
-\r
-       /**\r
-       * The HTML table element that represents this calendar\r
-       * @type HTMLTableElement\r
-       */      \r
-       table : null,\r
-\r
-       /**\r
-       * The HTML cell element that represents the main header cell TH used in the calendar table\r
-       * @type HTMLTableCellElement\r
-       */      \r
-       headerCell : null\r
+       * A map of DOM event handlers to attach to cells associated with specific CSS class names\r
+       * @property domEventMap\r
+       * @type Object\r
+       */\r
+       domEventMap : null\r
 };\r
 \r
 \r
 \r
 /**\r
-* Initializes the calendar widget. This method must be called by all subclass constructors.\r
+* Initializes the Calendar widget.\r
+* @method init\r
 * @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.init = function(id, containerId, monthyear, selected) {\r
-       this.setupConfig();\r
-\r
-       this.id = id;\r
-\r
-       this.cellDates = new Array();\r
-       \r
-       this.cells = new Array();\r
-       \r
-       this.renderStack = new Array();\r
-       this._renderStack = new Array();\r
-\r
-       this.oDomContainer = document.getElementById(containerId);\r
-       \r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {\r
+       this.initEvents();\r
        this.today = new Date();\r
        YAHOO.widget.DateMath.clearTime(this.today);\r
 \r
-       var month;\r
-       var year;\r
-\r
-       if (monthyear) {\r
-               var aMonthYear = monthyear.split(this.Locale.DATE_FIELD_DELIMITER);\r
-               month = parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);\r
-               year = parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);\r
-       } else {\r
-               month = this.today.getMonth()+1;\r
-               year = this.today.getFullYear();\r
-       }\r
-\r
-       this.pageDate = new Date(year, month-1, 1);\r
-       this._pageDate = new Date(this.pageDate.getTime());\r
-\r
-       if (selected) {\r
-               this.selectedDates = this._parseDates(selected);\r
-               this._selectedDates = this.selectedDates.concat();\r
-       } else {\r
-               this.selectedDates = new Array();\r
-               this._selectedDates = new Array();\r
-       }\r
-\r
-       this.wireDefaultEvents();\r
-       this.wireCustomEvents();\r
-};\r
-\r
+       this.id = id;\r
+       this.oDomContainer = document.getElementById(containerId);\r
 \r
-/**\r
-* Wires the local DOM events for the Calendar, including cell selection, hover, and\r
-* default navigation that is used for moving back and forth between calendar pages.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents = function() {\r
-       \r
        /**\r
-       * The default event function that is attached to a date link within a calendar cell\r
-       * when the calendar is rendered. \r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
+       * The Config object used to hold the configuration variables for the Calendar\r
+       * @property cfg\r
+       * @type YAHOO.util.Config\r
        */\r
-       this.doSelectCell = function(e, cal) {          \r
-               var cell = this;\r
-               var index = cell.index;\r
-               var d = cal.cellDates[index];\r
-               var date = new Date(d[0],d[1]-1,d[2]);\r
-               \r
-               if (! cal.isDateOOM(date) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_RESTRICTED) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_OOB)) {\r
-                       if (cal.Options.MULTI_SELECT) {\r
-                               var link = cell.getElementsByTagName("A")[0];\r
-                               link.blur();\r
-                               \r
-                               var cellDate = cal.cellDates[index];\r
-                               var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);\r
-                               \r
-                               if (cellDateIndex > -1) {       \r
-                                       cal.deselectCell(index);\r
-                               } else {\r
-                                       cal.selectCell(index);\r
-                               }       \r
-                               \r
-                       } else {\r
-                               var link = cell.getElementsByTagName("A")[0];\r
-                               link.blur()\r
-                               cal.selectCell(index);\r
-                       }\r
-               }\r
-       }\r
+       this.cfg = new YAHOO.util.Config(this);\r
 \r
        /**\r
-       * The event that is executed when the user hovers over a cell\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
+       * The local object which contains the Calendar's options\r
+       * @property Options\r
+       * @type Object\r
        */\r
-       this.doCellMouseOver = function(e, cal) {\r
-               var cell = this;\r
-               var index = cell.index;\r
-               var d = cal.cellDates[index];\r
-               var date = new Date(d[0],d[1]-1,d[2]);\r
-\r
-               if (! cal.isDateOOM(date) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_RESTRICTED) && ! YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_OOB)) {\r
-                       YAHOO.util.Dom.addClass(cell, cal.Style.CSS_CELL_HOVER);\r
-               }\r
-       }\r
+       this.Options = {};\r
 \r
        /**\r
-       * The event that is executed when the user moves the mouse out of a cell\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
+       * The local object which contains the Calendar's locale settings\r
+       * @property Locale\r
+       * @type Object\r
        */\r
-       this.doCellMouseOut = function(e, cal) {\r
-               YAHOO.util.Dom.removeClass(this, cal.Style.CSS_CELL_HOVER);\r
-       }\r
-       \r
-       /**\r
-       * A wrapper event that executes the nextMonth method through a DOM event\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
-       */      \r
-       this.doNextMonth = function(e, cal) {\r
-               cal.nextMonth();\r
-       }\r
-\r
-       /**\r
-       * A wrapper event that executes the previousMonth method through a DOM event\r
-       * @param        e               The event\r
-       * @param        cal             A reference to the calendar passed by the Event utility\r
-       * @private\r
-       */              \r
-       this.doPreviousMonth = function(e, cal) {\r
-               cal.previousMonth();\r
-       }\r
-}\r
-\r
-/**\r
-* This function can be extended by subclasses to attach additional DOM events to\r
-* the calendar. By default, this method is unimplemented.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.wireCustomEvents = function() { }\r
-\r
-/**\r
-This method is called to initialize the widget configuration variables, including\r
-style, localization, and other display and behavioral options.\r
-<p>Config: Container for the CSS style configuration variables.</p>\r
-<p><strong>Config.Style</strong> - Defines the CSS classes used for different calendar elements</p>\r
-<blockquote>\r
-       <div><em>CSS_CALENDAR</em> : Container table</div>\r
-       <div><em>CSS_HEADER</em> : </div>\r
-       <div><em>CSS_HEADER_TEXT</em> : Calendar header</div>\r
-       <div><em>CSS_FOOTER</em> : Calendar footer</div>\r
-       <div><em>CSS_CELL</em> : Calendar day cell</div>\r
-       <div><em>CSS_CELL_OOM</em> : Calendar OOM (out of month) cell</div>\r
-       <div><em>CSS_CELL_SELECTED</em> : Calendar selected cell</div>\r
-       <div><em>CSS_CELL_RESTRICTED</em> : Calendar restricted cell</div>\r
-       <div><em>CSS_CELL_TODAY</em> : Calendar cell for today's date</div>\r
-       <div><em>CSS_ROW_HEADER</em> : The cell preceding a row (used for week number by default)</div>\r
-       <div><em>CSS_ROW_FOOTER</em> : The cell following a row (not implemented by default)</div>\r
-       <div><em>CSS_WEEKDAY_CELL</em> : The cells used for labeling weekdays</div>\r
-       <div><em>CSS_WEEKDAY_ROW</em> : The row containing the weekday label cells</div>\r
-       <div><em>CSS_CONTAINER</em> : The border style used for the default UED rendering</div>\r
-       <div><em>CSS_2UPWRAPPER</em> : Special container class used to properly adjust the sizing and float</div>\r
-       <div><em>CSS_NAV_LEFT</em> : Left navigation arrow</div>\r
-       <div><em>CSS_NAV_RIGHT</em> : Right navigation arrow</div>\r
-       <div><em>CSS_CELL_TOP</em> : Outlying cell along the top row</div>\r
-       <div><em>CSS_CELL_LEFT</em> : Outlying cell along the left row</div>\r
-       <div><em>CSS_CELL_RIGHT</em> : Outlying cell along the right row</div>\r
-       <div><em>CSS_CELL_BOTTOM</em> : Outlying cell along the bottom row</div>\r
-       <div><em>CSS_CELL_HOVER</em> : Cell hover style</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT1</em> : Highlight color 1 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT2</em> : Highlight color 2 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT3</em> : Highlight color 3 for styling cells</div>\r
-       <div><em>CSS_CELL_HIGHLIGHT4</em> : Highlight color 4 for styling cells</div>\r
-\r
-</blockquote>\r
-<p><strong>Config.Locale</strong> - Defines the locale string arrays used for localization</p>\r
-<blockquote>\r
-       <div><em>MONTHS_SHORT</em> : Array of 12 months in short format ("Jan", "Feb", etc.)</div>\r
-       <div><em>MONTHS_LONG</em> : Array of 12 months in short format ("Jan", "Feb", etc.)</div>\r
-       <div><em>WEEKDAYS_1CHAR</em> : Array of 7 days in 1-character format ("S", "M", etc.)</div>\r
-       <div><em>WEEKDAYS_SHORT</em> : Array of 7 days in short format ("Su", "Mo", etc.)</div>\r
-       <div><em>WEEKDAYS_MEDIUM</em> : Array of 7 days in medium format ("Sun", "Mon", etc.)</div>\r
-       <div><em>WEEKDAYS_LONG</em> : Array of 7 days in long format ("Sunday", "Monday", etc.)</div>\r
-       <div><em>DATE_DELIMITER</em> : The value used to delimit series of multiple dates (Default: ",")</div>\r
-       <div><em>DATE_FIELD_DELIMITER</em> : The value used to delimit date fields (Default: "/")</div>\r
-       <div><em>DATE_RANGE_DELIMITER</em> : The value used to delimit date fields (Default: "-")</div>\r
-       <div><em>MY_MONTH_POSITION</em> : The value used to determine the position of the month in a month/year combo (e.g. 12/2005) (Default: 1)</div>\r
-       <div><em>MY_YEAR_POSITION</em> : The value used to determine the position of the year in a month/year combo (e.g. 12/2005) (Default: 2)</div>   \r
-       <div><em>MD_MONTH_POSITION</em> : The value used to determine the position of the month in a month/day combo (e.g. 12/25) (Default: 1)</div>\r
-       <div><em>MD_DAY_POSITION</em> : The value used to determine the position of the day in a month/day combo (e.g. 12/25) (Default: 2)</div>\r
-       <div><em>MDY_MONTH_POSITION</em> : The value used to determine the position of the month in a month/day/year combo (e.g. 12/25/2005) (Default: 1)</div>\r
-       <div><em>MDY_DAY_POSITION</em> : The value used to determine the position of the day in a month/day/year combo (e.g. 12/25/2005) (Default: 2)</div>\r
-       <div><em>MDY_YEAR_POSITION</em> : The value used to determine the position of the year in a month/day/year combo (e.g. 12/25/2005) (Default: 3)</div>\r
-</blockquote>\r
-<p><strong>Config.Options</strong> - Defines other configurable calendar widget options</p>\r
-<blockquote>\r
-       <div><em>SHOW_WEEKDAYS</em> : Boolean, determines whether to display the weekday headers (defaults to true)</div>\r
-       <div><em>LOCALE_MONTHS</em> : Array, points to the desired Config.Locale array (defaults to Config.Locale.MONTHS_LONG)</div>\r
-       <div><em>LOCALE_WEEKDAYS</em> : Array, points to the desired Config.Locale array (defaults to Config.Locale.WEEKDAYS_SHORT)</div>\r
-       <div><em>START_WEEKDAY</em> : Integer, 0-6, representing the day that a week begins on</div>\r
-       <div><em>SHOW_WEEK_HEADER</em> : Boolean, determines whether to display row headers</div>\r
-       <div><em>SHOW_WEEK_FOOTER</em> : Boolean, determines whether to display row footers</div>\r
-       <div><em>HIDE_BLANK_WEEKS</em> : Boolean, determines whether to hide extra weeks that are completely OOM</div>\r
-       <div><em>NAV_ARROW_LEFT</em> : String, the image path used for the left navigation arrow</div>\r
-       <div><em>NAV_ARROW_RIGHT</em> : String, the image path used for the right navigation arrow</div>\r
-</blockquote>\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setupConfig = function() {\r
-       /**\r
-       * Container for the CSS style configuration variables.\r
-       */\r
-       this.Config = new Object();\r
-       \r
-       this.Config.Style = {\r
-               // Style variables\r
-               CSS_ROW_HEADER: "calrowhead",\r
-               CSS_ROW_FOOTER: "calrowfoot",\r
-               CSS_CELL : "calcell",\r
-               CSS_CELL_SELECTED : "selected",\r
-               CSS_CELL_RESTRICTED : "restricted",\r
-               CSS_CELL_TODAY : "today",\r
-               CSS_CELL_OOM : "oom",\r
-               CSS_CELL_OOB : "previous",\r
-               CSS_HEADER : "calheader",\r
-               CSS_HEADER_TEXT : "calhead",\r
-               CSS_WEEKDAY_CELL : "calweekdaycell",\r
-               CSS_WEEKDAY_ROW : "calweekdayrow",\r
-               CSS_FOOTER : "calfoot",\r
-               CSS_CALENDAR : "yui-calendar",\r
-               CSS_CONTAINER : "yui-calcontainer",\r
-               CSS_2UPWRAPPER : "yui-cal2upwrapper", \r
-               CSS_NAV_LEFT : "calnavleft",\r
-               CSS_NAV_RIGHT : "calnavright",\r
-               CSS_CELL_TOP : "calcelltop",\r
-               CSS_CELL_LEFT : "calcellleft",\r
-               CSS_CELL_RIGHT : "calcellright",\r
-               CSS_CELL_BOTTOM : "calcellbottom",\r
-               CSS_CELL_HOVER : "calcellhover",\r
-               CSS_CELL_HIGHLIGHT1 : "highlight1",\r
-               CSS_CELL_HIGHLIGHT2 : "highlight2",\r
-               CSS_CELL_HIGHLIGHT3 : "highlight3",\r
-               CSS_CELL_HIGHLIGHT4 : "highlight4"\r
-       };\r
-\r
-       this.Style = this.Config.Style;\r
-\r
-       this.Config.Locale = {\r
-               // Locale definition\r
-               MONTHS_SHORT : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],\r
-               MONTHS_LONG : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],\r
-               WEEKDAYS_1CHAR : ["S", "M", "T", "W", "T", "F", "S"],\r
-               WEEKDAYS_SHORT : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],\r
-               WEEKDAYS_MEDIUM : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],\r
-               WEEKDAYS_LONG : ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],\r
-               DATE_DELIMITER : ",",\r
-               DATE_FIELD_DELIMITER : "/",\r
-               DATE_RANGE_DELIMITER : "-",\r
-               MY_MONTH_POSITION : 1,\r
-               MY_YEAR_POSITION : 2,\r
-               MD_MONTH_POSITION : 1,\r
-               MD_DAY_POSITION : 2,\r
-               MDY_MONTH_POSITION : 1,\r
-               MDY_DAY_POSITION : 2,\r
-               MDY_YEAR_POSITION : 3\r
-       };\r
+       this.Locale = {};\r
 \r
-       this.Locale = this.Config.Locale;\r
-\r
-       this.Config.Options = {\r
-               // Configuration variables\r
-               MULTI_SELECT : false,\r
-               SHOW_WEEKDAYS : true,\r
-               START_WEEKDAY : 0,\r
-               SHOW_WEEK_HEADER : false,\r
-               SHOW_WEEK_FOOTER : false,\r
-               HIDE_BLANK_WEEKS : false,\r
-               NAV_ARROW_LEFT : YAHOO.widget.Calendar_Core.IMG_ROOT + "us/tr/callt.gif",\r
-               NAV_ARROW_RIGHT : YAHOO.widget.Calendar_Core.IMG_ROOT + "us/tr/calrt.gif"\r
-       };\r
+       this.initStyles();\r
 \r
-       this.Options = this.Config.Options;\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);\r
 \r
-       this.customConfig();\r
+       this.cellDates = [];\r
+       this.cells = [];\r
+       this.renderStack = [];\r
+       this._renderStack = [];\r
 \r
-       if (! this.Options.LOCALE_MONTHS) {\r
-               this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;\r
-       }\r
-       if (! this.Options.LOCALE_WEEKDAYS) {\r
-               this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;\r
-       }\r
+       this.setupConfig();\r
 \r
-       // If true, reconfigure weekday arrays to place Mondays first\r
-       if (this.Options.START_WEEKDAY > 0) {\r
-               for (var w=0;w<this.Options.START_WEEKDAY;++w) {\r
-                       this.Locale.WEEKDAYS_SHORT.push(this.Locale.WEEKDAYS_SHORT.shift());\r
-                       this.Locale.WEEKDAYS_MEDIUM.push(this.Locale.WEEKDAYS_MEDIUM.shift());\r
-                       this.Locale.WEEKDAYS_LONG.push(this.Locale.WEEKDAYS_LONG.shift());              \r
-               }\r
+       if (config) {\r
+               this.cfg.applyConfig(config, true);\r
        }\r
-};\r
-\r
-/**\r
-* This method is called when subclasses need to override configuration variables\r
-* or create new ones. Values can be explicitly set as follows:\r
-* <blockquote><code>\r
-*      this.Config.Style.CSS_CELL = "newcalcell";\r
-*      this.Config.Locale.MONTHS_SHORT = ["Jan", "Fv", "Mars", "Avr", "Mai", "Juin", "Juil", "Aot", "Sept", "Oct", "Nov", "Dc"];\r
-* </code></blockquote>\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.customConfig = function() { };\r
-\r
-/**\r
-* Builds the date label that will be displayed in the calendar header or\r
-* footer, depending on configuration.\r
-* @return      The formatted calendar month label\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildMonthLabel = function() {\r
-       var text = this.Options.LOCALE_MONTHS[this.pageDate.getMonth()] + " " + this.pageDate.getFullYear();\r
-       return text;\r
-};\r
 \r
-/**\r
-* Builds the date digit that will be displayed in calendar cells\r
-* @return      The formatted day label\r
-* @type        String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildDayLabel = function(workingDate) {\r
-       var day = workingDate.getDate();\r
-       return day;\r
+       this.cfg.fireQueue();\r
 };\r
 \r
-\r
-\r
 /**\r
-* Builds the calendar table shell that will be filled in with dates and formatting.\r
-* This method calls buildShellHeader, buildShellBody, and buildShellFooter (in that order) \r
-* to construct the pieces of the calendar table. The construction of the shell should\r
-* only happen one time when the calendar is initialized.\r
+* Renders the built-in IFRAME shim for the IE6 and below\r
+* @method configIframe\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildShell = function() {\r
-       \r
-       this.table = document.createElement("TABLE");\r
-       this.table.cellSpacing = 0;     \r
-       YAHOO.widget.Calendar_Core.setCssClasses(this.table, [this.Style.CSS_CALENDAR]);\r
-\r
-       this.table.id = this.id;\r
-       \r
-       this.buildShellHeader();\r
-       this.buildShellBody();\r
-       this.buildShellFooter();\r
-       \r
-       YAHOO.util.Event.addListener(window, "unload", this._unload, this);\r
+YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {\r
+       var useIframe = args[0];\r
+\r
+       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {\r
+               if (useIframe) {\r
+                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");\r
+\r
+                       if (this.browser == "ie" && (pos == "absolute" || pos == "relative")) {\r
+                               if (! YAHOO.util.Dom.inDocument(this.iframe)) {\r
+                                       this.iframe = document.createElement("iframe");\r
+                                       this.iframe.src = "javascript:false;";\r
+                                       YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
+                                       this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);\r
+                               }\r
+                       }\r
+               } else {\r
+                       if (this.iframe) {\r
+                               if (this.iframe.parentNode) {\r
+                                       this.iframe.parentNode.removeChild(this.iframe);\r
+                               }\r
+                               this.iframe = null;\r
+                       }\r
+               }\r
+       }\r
 };\r
 \r
 /**\r
-* Builds the calendar shell header by inserting a THEAD into the local calendar table.\r
+* Default handler for the "title" property\r
+* @method configTitle\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildShellHeader = function() {\r
-       var head = document.createElement("THEAD");\r
-       var headRow = document.createElement("TR");\r
+YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {\r
+       var title = args[0];\r
+       var close = this.cfg.getProperty("close");\r
+\r
+       var titleDiv;\r
+\r
+       if (title && title !== "") {\r
+               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");\r
+               titleDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;\r
+               titleDiv.innerHTML = title;\r
+               this.oDomContainer.insertBefore(titleDiv, this.oDomContainer.firstChild);\r
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");\r
+       } else {\r
+               titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;\r
 \r
-       var headerCell = document.createElement("TH");\r
-       \r
-       var colSpan = 7;\r
-       if (this.Config.Options.SHOW_WEEK_HEADER) {\r
-               this.weekHeaderCells = new Array();\r
-               colSpan += 1;\r
-       }\r
-       if (this.Config.Options.SHOW_WEEK_FOOTER) {\r
-               this.weekFooterCells = new Array();\r
-               colSpan += 1;\r
-       }       \r
-       \r
-       headerCell.colSpan = colSpan;\r
-       \r
-       YAHOO.widget.Calendar_Core.setCssClasses(headerCell,[this.Style.CSS_HEADER_TEXT]);\r
-\r
-       this.headerCell = headerCell;\r
-\r
-       headRow.appendChild(headerCell);\r
-       head.appendChild(headRow);\r
-\r
-       // Append day labels, if needed\r
-       if (this.Options.SHOW_WEEKDAYS) {\r
-               var row = document.createElement("TR");\r
-               var fillerCell;\r
-\r
-               YAHOO.widget.Calendar_Core.setCssClasses(row,[this.Style.CSS_WEEKDAY_ROW]);\r
-               \r
-               if (this.Config.Options.SHOW_WEEK_HEADER) {\r
-                       fillerCell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       row.appendChild(fillerCell);\r
+               if (titleDiv) {\r
+                       YAHOO.util.Event.purgeElement(titleDiv);\r
+                       this.oDomContainer.removeChild(titleDiv);\r
                }\r
-               \r
-               for(var i=0;i<this.Options.LOCALE_WEEKDAYS.length;++i) {\r
-                       var cell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       cell.innerHTML=this.Options.LOCALE_WEEKDAYS[i];\r
-                       row.appendChild(cell);\r
+               if (! close) {\r
+                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");\r
                }\r
-\r
-               if (this.Config.Options.SHOW_WEEK_FOOTER) {\r
-                       fillerCell = document.createElement("TH");\r
-                       YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);\r
-                       row.appendChild(fillerCell);\r
-               }\r
-                               \r
-               head.appendChild(row);\r
        }\r
-\r
-       this.table.appendChild(head);\r
 };\r
 \r
 /**\r
-* Builds the calendar shell body (6 weeks by 7 days)\r
+* Default handler for the "close" property\r
+* @method configClose\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.buildShellBody = function() {\r
-       // This should only get executed once\r
-       this.tbody = document.createElement("TBODY");\r
-\r
-       for (var r=0;r<6;++r) {\r
-               var row = document.createElement("TR");\r
-               \r
-               for (var c=0;c<this.headerCell.colSpan;++c) {\r
-                       var cell;\r
-                       if (this.Config.Options.SHOW_WEEK_HEADER && c===0) { // Row header\r
-                               cell = document.createElement("TH");\r
-                               this.weekHeaderCells[this.weekHeaderCells.length] = cell;\r
-                       } else if (this.Config.Options.SHOW_WEEK_FOOTER && c==(this.headerCell.colSpan-1)){ // Row footer\r
-                               cell = document.createElement("TH");\r
-                               this.weekFooterCells[this.weekFooterCells.length] = cell;\r
-                       } else {\r
-                               cell = document.createElement("TD");\r
-                               this.cells[this.cells.length] = cell;\r
-                               YAHOO.widget.Calendar_Core.setCssClasses(cell, [this.Style.CSS_CELL]);\r
-                               YAHOO.util.Event.addListener(cell, "click", this.doSelectCell, this);\r
+YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {\r
+       var close = args[0];\r
+       var title = this.cfg.getProperty("title");\r
+\r
+       var linkClose;\r
+\r
+       if (close === true) {\r
+               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");\r
+               linkClose.href = "javascript:void(null);";\r
+               linkClose.className = "link-close";\r
+               YAHOO.util.Event.addListener(linkClose, "click", this.hide, this, true);\r
+               var imgClose = document.createElement("img");\r
+               imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + "us/my/bn/x_d.gif";\r
+               imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;\r
+               linkClose.appendChild(imgClose);\r
+               this.oDomContainer.appendChild(linkClose);\r
+               YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");\r
+       } else {\r
+               linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;\r
 \r
-                               YAHOO.util.Event.addListener(cell, "mouseover", this.doCellMouseOver, this);\r
-                               YAHOO.util.Event.addListener(cell, "mouseout", this.doCellMouseOut, this);\r
-                       }\r
-                       row.appendChild(cell);\r
+               if (linkClose) {\r
+                       YAHOO.util.Event.purgeElement(linkClose);\r
+                       this.oDomContainer.removeChild(linkClose);\r
+               }\r
+               if (! title || title === "") {\r
+                       YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");\r
                }\r
-               this.tbody.appendChild(row);\r
        }\r
-       \r
-       this.table.appendChild(this.tbody);\r
 };\r
 \r
 /**\r
-* Builds the calendar shell footer. In the default implementation, there is\r
-* no footer.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.buildShellFooter = function() { };\r
-\r
-/**\r
-* Outputs the calendar shell to the DOM, inserting it into the placeholder element.\r
+* Initializes Calendar's built-in CustomEvents\r
+* @method initEvents\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderShell = function() {\r
-       this.oDomContainer.appendChild(this.table);\r
-       this.shellRendered = true;\r
-};\r
+YAHOO.widget.Calendar.prototype.initEvents = function() {\r
 \r
-/**\r
-* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute\r
-* when the method is called: renderHeader, renderBody, renderFooter.\r
-* Refer to the documentation for those methods for information on \r
-* individual render tasks.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.render = function() {\r
-       if (! this.shellRendered) {\r
-               this.buildShell();\r
-               this.renderShell();\r
-       }\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeSelectEvent\r
+       */\r
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");\r
 \r
-       this.resetRenderers();\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event selectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.selectEvent = new YAHOO.util.CustomEvent("select");\r
 \r
-       this.cellDates.length = 0;\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeDeselectEvent\r
+       */\r
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");\r
 \r
-       // Find starting day of the current month\r
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.pageDate);\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event deselectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");\r
 \r
-       this.renderHeader();\r
-       this.renderBody(workingDate);\r
-       this.renderFooter();\r
+       /**\r
+       * Fired when the Calendar page is changed\r
+       * @event changePageEvent\r
+       */\r
+       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");\r
 \r
-       this.onRender();\r
-};\r
+       /**\r
+       * Fired before the Calendar is rendered\r
+       * @event beforeRenderEvent\r
+       */\r
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
 \r
+       /**\r
+       * Fired when the Calendar is rendered\r
+       * @event renderEvent\r
+       */\r
+       this.renderEvent = new YAHOO.util.CustomEvent("render");\r
 \r
+       /**\r
+       * Fired when the Calendar is reset\r
+       * @event resetEvent\r
+       */\r
+       this.resetEvent = new YAHOO.util.CustomEvent("reset");\r
 \r
-/**\r
-* Appends the header contents into the widget header.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderHeader = function() {\r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
+       /**\r
+       * Fired when the Calendar is cleared\r
+       * @event clearEvent\r
+       */\r
+       this.clearEvent = new YAHOO.util.CustomEvent("clear");\r
+\r
+       this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);\r
+       this.selectEvent.subscribe(this.onSelect, this, true);\r
+       this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);\r
+       this.deselectEvent.subscribe(this.onDeselect, this, true);\r
+       this.changePageEvent.subscribe(this.onChangePage, this, true);\r
+       this.renderEvent.subscribe(this.onRender, this, true);\r
+       this.resetEvent.subscribe(this.onReset, this, true);\r
+       this.clearEvent.subscribe(this.onClear, this, true);\r
 };\r
 \r
+\r
 /**\r
-* Appends the calendar body. The default implementation calculates the number of\r
-* OOM (out of month) cells that need to be rendered at the start of the month, renders those, \r
-* and renders all the day cells using the built-in cell rendering methods.\r
-*\r
-* While iterating through all of the cells, the calendar checks for renderers in the\r
-* local render stack that match the date of the current cell, and then applies styles\r
-* as necessary.\r
-* \r
-* @param {Date}        workingDate     The current working Date object being used to generate the calendar\r
+* The default event function that is attached to a date link within a calendar cell\r
+* when the calendar is rendered.\r
+* @method doSelectCell\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderBody = function(workingDate) {\r
-\r
-       this.preMonthDays = workingDate.getDay();\r
-       if (this.Options.START_WEEKDAY > 0) {\r
-               this.preMonthDays -= this.Options.START_WEEKDAY;\r
-       }\r
-       if (this.preMonthDays < 0) {\r
-               this.preMonthDays += 7;\r
-       }\r
-       \r
-       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();\r
-       this.postMonthDays = YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;\r
-       \r
-       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);\r
-       \r
-       var weekRowIndex = 0;\r
-       \r
-       for (var c=0;c<this.cells.length;++c) {\r
-               var cellRenderers = new Array();\r
-               \r
-               var cell = this.cells[c];\r
-               this.clearElement(cell);\r
-\r
-               cell.index = c;\r
-               cell.id = this.id + "_cell" + c;\r
-               \r
-               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates\r
-\r
-               if (workingDate.getDay() == this.Options.START_WEEKDAY) {\r
-                       var rowHeaderCell = null;\r
-                       var rowFooterCell = null;\r
-                       \r
-                       if (this.Options.SHOW_WEEK_HEADER) {\r
-                               rowHeaderCell = this.weekHeaderCells[weekRowIndex];\r
-                               this.clearElement(rowHeaderCell);\r
-                       }\r
-                       \r
-                       if (this.Options.SHOW_WEEK_FOOTER) {\r
-                               rowFooterCell = this.weekFooterCells[weekRowIndex];\r
-                               this.clearElement(rowFooterCell);\r
-                       }                       \r
-                       \r
-                       if (this.Options.HIDE_BLANK_WEEKS && this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-                               // The first day of the week is not in this month, and it's not an overlap week\r
-                               continue;\r
-                       } else {\r
-                               if (rowHeaderCell) {\r
-                                       this.renderRowHeader(workingDate, rowHeaderCell);\r
-                               }\r
-                               if (rowFooterCell) {\r
-                                       this.renderRowFooter(workingDate, rowFooterCell);\r
-                               }       \r
-                       }\r
-               }\r
+YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {\r
+       var target = YAHOO.util.Event.getTarget(e);\r
 \r
-               \r
+       var cell,index,d,date;\r
 \r
-               var renderer = null;\r
-               \r
-               if (workingDate.getFullYear()   == this.today.getFullYear() &&\r
-                       workingDate.getMonth()          == this.today.getMonth() &&\r
-                       workingDate.getDate()           == this.today.getDate()) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellStyleToday;\r
+       while (target.tagName.toLowerCase() != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
                }\r
-               \r
-               if (this.isDateOOM(workingDate)) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellNotThisMonth;\r
-               } else {\r
-                       for (var r=0;r<this.renderStack.length;++r) {\r
-                               var rArray = this.renderStack[r];\r
-                               var type = rArray[0];\r
-                               \r
-                               var month;\r
-                               var day;\r
-                               var year;\r
-\r
-                               switch (type) {\r
-                                       case YAHOO.widget.Calendar_Core.DATE:\r
-                                               month = rArray[1][1];\r
-                                               day = rArray[1][2];\r
-                                               year = rArray[1][0];\r
-\r
-                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {\r
-                                                       renderer = rArray[2];\r
-                                                       this.renderStack.splice(r,1);\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.MONTH_DAY:\r
-                                               month = rArray[1][0];\r
-                                               day = rArray[1][1];\r
-                                               \r
-                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {\r
-                                                       renderer = rArray[2];\r
-                                                       this.renderStack.splice(r,1);\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.RANGE:\r
-                                               var date1 = rArray[1][0];\r
-                                               var date2 = rArray[1][1];\r
-\r
-                                               var d1month = date1[1];\r
-                                               var d1day = date1[2];\r
-                                               var d1year = date1[0];\r
-                                               \r
-                                               var d1 = new Date(d1year, d1month-1, d1day);\r
+       }\r
 \r
-                                               var d2month = date2[1];\r
-                                               var d2day = date2[2];\r
-                                               var d2year = date2[0];\r
+       cell = target;\r
 \r
-                                               var d2 = new Date(d2year, d2month-1, d2day);\r
+       if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               index = cell.id.split("cell")[1];\r
+               d = cal.cellDates[index];\r
+               date = new Date(d[0],d[1]-1,d[2]);\r
 \r
-                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {\r
-                                                       renderer = rArray[2];\r
+               var link;\r
 \r
-                                                       if (workingDate.getTime()==d2.getTime()) { \r
-                                                               this.renderStack.splice(r,1);\r
-                                                       }\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.WEEKDAY:\r
-                                               \r
-                                               var weekday = rArray[1][0];\r
-                                               if (workingDate.getDay()+1 == weekday) {\r
-                                                       renderer = rArray[2];\r
-                                               }\r
-                                               break;\r
-                                       case YAHOO.widget.Calendar_Core.MONTH:\r
-                                               \r
-                                               month = rArray[1][0];\r
-                                               if (workingDate.getMonth()+1 == month) {\r
-                                                       renderer = rArray[2];\r
-                                               }\r
-                                               break;\r
-                               }\r
-                               \r
-                               if (renderer) {\r
-                                       cellRenderers[cellRenderers.length]=renderer;\r
-                               }\r
+               if (cal.Options.MULTI_SELECT) {\r
+                       link = cell.getElementsByTagName("a")[0];\r
+                       if (link) {\r
+                               link.blur();\r
                        }\r
 \r
-               }\r
-\r
-               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellStyleSelected; \r
-               }\r
-\r
-               if (this.minDate) {\r
-                       this.minDate = YAHOO.widget.DateMath.clearTime(this.minDate);\r
-               }\r
-               if (this.maxDate) {\r
-                       this.maxDate = YAHOO.widget.DateMath.clearTime(this.maxDate);\r
-               }\r
+                       var cellDate = cal.cellDates[index];\r
+                       var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);\r
 \r
-               if (\r
-                       (this.minDate && (workingDate.getTime() < this.minDate.getTime())) ||\r
-                       (this.maxDate && (workingDate.getTime() > this.maxDate.getTime()))\r
-               ) {\r
-                       cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;\r
-               } else {\r
-                       cellRenderers[cellRenderers.length]=this.renderCellDefault;     \r
-               }\r
-               \r
-               for (var x=0;x<cellRenderers.length;++x) {\r
-                       var ren = cellRenderers[x];\r
-                       if (ren.call(this,workingDate,cell) == YAHOO.widget.Calendar_Core.STOP_RENDER) {\r
-                               break;\r
+                       if (cellDateIndex > -1) {\r
+                               cal.deselectCell(index);\r
+                       } else {\r
+                               cal.selectCell(index);\r
                        }\r
-               }\r
-               \r
-               workingDate = YAHOO.widget.DateMath.add(workingDate, YAHOO.widget.DateMath.DAY, 1); // Go to the next day\r
-               if (workingDate.getDay() == this.Options.START_WEEKDAY) {\r
-                       weekRowIndex += 1;\r
-               }\r
 \r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);\r
-\r
-               if (c >= 0 && c <= 6) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);\r
-               }\r
-               if ((c % 7) == 0) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);\r
-               }\r
-               if (((c+1) % 7) == 0) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);\r
-               }\r
-               \r
-               var postDays = this.postMonthDays; \r
-               if (postDays >= 7 && this.Options.HIDE_BLANK_WEEKS) {\r
-                       var blankWeeks = Math.floor(postDays/7);\r
-                       for (var p=0;p<blankWeeks;++p) {\r
-                               postDays -= 7;\r
+               } else {\r
+                       link = cell.getElementsByTagName("a")[0];\r
+                       if (link) {\r
+                               link.blur();\r
                        }\r
-               }\r
-               \r
-               if (c >= ((this.preMonthDays+postDays+this.monthDays)-7)) {\r
-                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);\r
+                       cal.selectCell(index);\r
                }\r
        }\r
-               \r
 };\r
 \r
 /**\r
-* Appends the contents of the calendar widget footer into the shell. By default, \r
-* the calendar does not contain a footer, and this method must be implemented by \r
-* subclassing the widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderFooter = function() { };\r
-\r
-/**\r
-* @private\r
+* The event that is executed when the user hovers over a cell\r
+* @method doCellMouseOver\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._unload = function(e, cal) {\r
-       for (var c in cal.cells) {\r
-               c = null;\r
-       }\r
-       \r
-       cal.cells = null;\r
-       \r
-       cal.tbody = null;\r
-       cal.oDomContainer = null;\r
-       cal.table = null;\r
-       cal.headerCell = null;\r
-       \r
-       cal = null;\r
-};\r
-                                                                                                 \r
-                                                                                                 \r
-/****************** BEGIN BUILT-IN TABLE CELL RENDERERS ************************************/\r
-\r
-YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);\r
-       cell.innerHTML = workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
-}\r
+YAHOO.widget.Calendar.prototype.doCellMouseOver = function(e, cal) {\r
+       var target;\r
+       if (e) {\r
+               target = YAHOO.util.Event.getTarget(e);\r
+       } else {\r
+               target = this;\r
+       }\r
 \r
-/**\r
-* Renders the row header for a week. The date passed in should be\r
-* the first date of the given week.\r
-* @param {Date}                                        workingDate             The current working Date object (beginning of the week) being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderRowHeader = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_ROW_HEADER);\r
-       \r
-       var useYear = this.pageDate.getFullYear();\r
-       \r
-       if (! YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)) {\r
-               useYear = workingDate.getFullYear();\r
+       while (target.tagName.toLowerCase() != "td") {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
+               }\r
        }\r
-       \r
-       var weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useYear, this.Options.START_WEEKDAY);\r
-       cell.innerHTML = weekNum;\r
-       \r
-       if (this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM); \r
+\r
+       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);\r
        }\r
 };\r
 \r
 /**\r
-* Renders the row footer for a week. The date passed in should be\r
-* the first date of the given week.\r
-* @param {Date}                                        workingDate             The current working Date object (beginning of the week) being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* The event that is executed when the user moves the mouse out of a cell\r
+* @method doCellMouseOut\r
+* @param {DOMEvent} e  The event\r
+* @param {Calendar} cal        A reference to the calendar passed by the Event utility\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.renderRowFooter = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_ROW_FOOTER);\r
-       \r
-       if (this.isDateOOM(workingDate) && ! YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)) {\r
-               YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM); \r
+YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {\r
+       var target;\r
+       if (e) {\r
+               target = YAHOO.util.Event.getTarget(e);\r
+       } else {\r
+               target = this;\r
+       }\r
+\r
+       while (target.tagName.toLowerCase() != "td") {\r
+               target = target.parentNode;\r
+               if (target.tagName.toLowerCase() == "html") {\r
+                       return;\r
+               }\r
+       }\r
+\r
+       if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {\r
+               YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);\r
        }\r
 };\r
 \r
-/**\r
-* Renders a single standard calendar cell in the calendar widget table.\r
-* All logic for determining how a standard default cell will be rendered is \r
-* encapsulated in this method, and must be accounted for when extending the\r
-* widget class.\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellDefault = function(workingDate, cell) {\r
-       cell.innerHTML = "";\r
-       var link = document.createElement("a");\r
+YAHOO.widget.Calendar.prototype.setupConfig = function() {\r
 \r
-       link.href="javascript:void(null);";\r
-       link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();\r
+       /**\r
+       * The month/year representing the current visible Calendar date (mm/yyyy)\r
+       * @config pagedate\r
+       * @type String\r
+       * @default today's date\r
+       */\r
+       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );\r
 \r
-       link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));\r
-       cell.appendChild(link);\r
-};\r
+       /**\r
+       * The date or range of dates representing the current Calendar selection\r
+       * @config selected\r
+       * @type String\r
+       * @default []\r
+       */\r
+       this.cfg.addProperty("selected", { value:[], handler:this.configSelected } );\r
 \r
-/**\r
-* Renders a single standard calendar cell using the CSS hightlight1 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);\r
-};\r
+       /**\r
+       * The title to display above the Calendar's month header\r
+       * @config title\r
+       * @type String\r
+       * @default ""\r
+       */\r
+       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );\r
 \r
-/**\r
-* Renders a single standard calendar cell using the CSS hightlight2 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);\r
-};\r
+       /**\r
+       * Whether or not a close button should be displayed for this Calendar\r
+       * @config close\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("close", { value:false, handler:this.configClose } );\r
 \r
-/**\r
-* Renders a single standard calendar cell using the CSS hightlight3 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);\r
-};\r
+       /**\r
+       * 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.\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("iframe", { value:true, handler:this.configIframe, validator:this.cfg.checkBoolean } );\r
 \r
-/**\r
-* Renders a single standard calendar cell using the CSS hightlight4 style\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);\r
-};\r
+       /**\r
+       * The minimum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config mindate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("mindate", { value:null, handler:this.configMinDate } );\r
 \r
-/**\r
-* Applies the default style used for rendering today's date to the current calendar cell\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);\r
-};\r
+       /**\r
+       * The maximum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config maxdate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("maxdate", { value:null, handler:this.configMaxDate } );\r
 \r
-/**\r
-* Applies the default style used for rendering selected dates to the current calendar cell\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);\r
-};\r
 \r
-/**\r
-* Applies the default style used for rendering dates that are not a part of the current\r
-* month (preceding or trailing the cells for the current month)\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth = function(workingDate, cell) {\r
-       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);\r
-       cell.innerHTML=workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
-};\r
+       // Options properties\r
 \r
-/**\r
-* Renders the current calendar cell as a non-selectable "black-out" date using the default\r
-* restricted style.\r
-* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
-* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
-* @return      YAHOO.widget.Calendar_Core.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
-*                      should not be terminated\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted = function(workingDate, cell) {\r
-       YAHOO.widget.Calendar_Core.setCssClasses(cell, [this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);\r
-       cell.innerHTML=workingDate.getDate();\r
-       return YAHOO.widget.Calendar_Core.STOP_RENDER;\r
-};\r
-/******************** END BUILT-IN TABLE CELL RENDERERS ************************************/\r
+       /**\r
+       * True if the Calendar should allow multiple selections. False by default.\r
+       * @config MULTI_SELECT\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
 \r
-/******************** BEGIN MONTH NAVIGATION METHODS ************************************/\r
-/**\r
-* Adds the designated number of months to the current calendar month, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of months to add to the current calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.addMonths = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.add(this.pageDate, YAHOO.widget.DateMath.MONTH, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
-};\r
+       /**\r
+       * The weekday the week begins on. Default is 0 (Sunday).\r
+       * @config START_WEEKDAY\r
+       * @type number\r
+       * @default 0\r
+       */\r
+       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.configOptions, validator:this.cfg.checkNumber  } );\r
 \r
-/**\r
-* Subtracts the designated number of months from the current calendar month, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of months to subtract from the current calendar\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.subtractMonths = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.subtract(this.pageDate, YAHOO.widget.DateMath.MONTH, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
+       /**\r
+       * True if the Calendar should show weekday labels. True by default.\r
+       * @config SHOW_WEEKDAYS\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.configOptions, validator:this.cfg.checkBoolean  } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row headers. False by default.\r
+       * @config SHOW_WEEK_HEADER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row footers. False by default.\r
+       * @config SHOW_WEEK_FOOTER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.\r
+       * @config HIDE_BLANK_WEEKS\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_LEFT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.configOptions } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_RIGHT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.configOptions } );\r
+\r
+       // Locale properties\r
+\r
+       /**\r
+       * The short month labels for the current locale.\r
+       * @config MONTHS_SHORT\r
+       * @type String[]\r
+       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]\r
+       */\r
+       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * The long month labels for the current locale.\r
+       * @config MONTHS_LONG\r
+       * @type String[]\r
+       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"\r
+       */\r
+       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * The 1-character weekday labels for the current locale.\r
+       * @config WEEKDAYS_1CHAR\r
+       * @type String[]\r
+       * @default ["S", "M", "T", "W", "T", "F", "S"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * The short weekday labels for the current locale.\r
+       * @config WEEKDAYS_SHORT\r
+       * @type String[]\r
+       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * The medium weekday labels for the current locale.\r
+       * @config WEEKDAYS_MEDIUM\r
+       * @type String[]\r
+       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * The long weekday labels for the current locale.\r
+       * @config WEEKDAYS_LONG\r
+       * @type String[]\r
+       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.configLocale } );\r
+\r
+       /**\r
+       * Refreshes the locale values used to build the Calendar.\r
+       * @method refreshLocale\r
+       * @private\r
+       */\r
+       var refreshLocale = function() {\r
+               this.cfg.refireEvent("LOCALE_MONTHS");\r
+               this.cfg.refireEvent("LOCALE_WEEKDAYS");\r
+       };\r
+\r
+       this.cfg.subscribeToConfigEvent("START_WEEKDAY", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("MONTHS_SHORT", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("MONTHS_LONG", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_1CHAR", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_SHORT", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_MEDIUM", refreshLocale, this, true);\r
+       this.cfg.subscribeToConfigEvent("WEEKDAYS_LONG", refreshLocale, this, true);\r
+\r
+       /**\r
+       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".\r
+       * @config LOCALE_MONTHS\r
+       * @type String\r
+       * @default "long"\r
+       */\r
+       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.configLocaleValues } );\r
+\r
+       /**\r
+       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".\r
+       * @config LOCALE_WEEKDAYS\r
+       * @type String\r
+       * @default "short"\r
+       */\r
+       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.configLocaleValues } );\r
+\r
+       /**\r
+       * The value used to delimit individual dates in a date string passed to various Calendar functions.\r
+       * @config DATE_DELIMITER\r
+       * @type String\r
+       * @default ","\r
+       */\r
+       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.configLocale } );\r
+\r
+       /**\r
+       * The value used to delimit date fields in a date string passed to various Calendar functions.\r
+       * @config DATE_FIELD_DELIMITER\r
+       * @type String\r
+       * @default "/"\r
+       */\r
+       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.configLocale } );\r
+\r
+       /**\r
+       * The value used to delimit date ranges in a date string passed to various Calendar functions.\r
+       * @config DATE_RANGE_DELIMITER\r
+       * @type String\r
+       * @default "-"\r
+       */\r
+       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.configLocale } );\r
+\r
+       /**\r
+       * The position of the month in a month/year date string\r
+       * @config MY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/year date string\r
+       * @config MY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day date string\r
+       * @config MD_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/year date string\r
+       * @config MD_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day/year date string\r
+       * @config MDY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/day/year date string\r
+       * @config MDY_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/day/year date string\r
+       * @config MDY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 3\r
+       */\r
+       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.configLocale, validator:this.cfg.checkNumber } );\r
 };\r
 \r
 /**\r
-* Adds the designated number of years to the current calendar, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of years to add to the current calendar\r
+* The default handler for the "pagedate" property\r
+* @method configPageDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.addYears = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.add(this.pageDate, YAHOO.widget.DateMath.YEAR, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
+YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       var month, year, aMonthYear;\r
+\r
+       if (val) {\r
+               if (val instanceof Date) {\r
+                       val = YAHOO.widget.DateMath.findMonthStart(val);\r
+                       this.cfg.setProperty("pagedate", val, true);\r
+                       if (! this._pageDate) {\r
+                               this._pageDate = this.cfg.getProperty("pagedate");\r
+                       }\r
+                       return;\r
+               } else {\r
+                       aMonthYear = val.split(this.cfg.getProperty("DATE_FIELD_DELIMITER"));\r
+                       month = parseInt(aMonthYear[this.cfg.getProperty("MY_MONTH_POSITION")-1], 10)-1;\r
+                       year = parseInt(aMonthYear[this.cfg.getProperty("MY_YEAR_POSITION")-1], 10);\r
+               }\r
+       } else {\r
+               month = this.today.getMonth();\r
+               year = this.today.getFullYear();\r
+       }\r
+\r
+       this.cfg.setProperty("pagedate", new Date(year, month, 1), true);\r
+       if (! this._pageDate) {\r
+               this._pageDate = this.cfg.getProperty("pagedate");\r
+       }\r
 };\r
 \r
 /**\r
-* Subtcats the designated number of years from the current calendar, and sets the current\r
-* calendar page date to the new month.\r
-* @param {Integer}     count   The number of years to subtract from the current calendar\r
+* The default handler for the "mindate" property\r
+* @method configMinDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.subtractYears = function(count) {\r
-       this.pageDate = YAHOO.widget.DateMath.subtract(this.pageDate, YAHOO.widget.DateMath.YEAR, count);\r
-       this.resetRenderers();\r
-       this.onChangePage();\r
+YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       if (typeof val == 'string') {\r
+               val = this._parseDate(val);\r
+               this.cfg.setProperty("mindate", new Date(val[0],(val[1]-1),val[2]));\r
+       }\r
 };\r
 \r
 /**\r
-* Navigates to the next month page in the calendar widget.\r
+* The default handler for the "maxdate" property\r
+* @method configMaxDate\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.nextMonth = function() {\r
-       this.addMonths(1);\r
+YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {\r
+       var val = args[0];\r
+       if (typeof val == 'string') {\r
+               val = this._parseDate(val);\r
+               this.cfg.setProperty("maxdate", new Date(val[0],(val[1]-1),val[2]));\r
+       }\r
 };\r
 \r
 /**\r
-* Navigates to the previous month page in the calendar widget.\r
+* The default handler for the "selected" property\r
+* @method configSelected\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.previousMonth = function() {\r
-       this.subtractMonths(1);\r
+YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {\r
+       var selected = args[0];\r
+\r
+       if (selected) {\r
+               if (typeof selected == 'string') {\r
+                       this.cfg.setProperty("selected", this._parseDates(selected), true);\r
+               }\r
+       }\r
+       if (! this._selectedDates) {\r
+               this._selectedDates = this.cfg.getProperty("selected");\r
+       }\r
 };\r
 \r
 /**\r
-* Navigates to the next year in the currently selected month in the calendar widget.\r
+* The default handler for all configuration options properties\r
+* @method configOptions\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.nextYear = function() {\r
-       this.addYears(1);\r
+YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+       this.Options[type] = val;\r
 };\r
 \r
 /**\r
-* Navigates to the previous year in the currently selected month in the calendar widget.\r
+* The default handler for all configuration locale properties\r
+* @method configLocale\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.previousYear = function() {\r
-       this.subtractYears(1);\r
-};\r
+YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+       this.Locale[type] = val;\r
 \r
-/****************** END MONTH NAVIGATION METHODS ************************************/\r
+       this.cfg.refireEvent("LOCALE_MONTHS");\r
+       this.cfg.refireEvent("LOCALE_WEEKDAYS");\r
 \r
-/************* BEGIN SELECTION METHODS *************************************************************/\r
+};\r
 \r
 /**\r
-* Resets the calendar widget to the originally selected month and year, and \r
-* sets the calendar to the initial selection(s).\r
+* The default handler for all configuration locale field length properties\r
+* @method configLocaleValues\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.reset = function() {\r
-       this.selectedDates.length = 0;\r
-       this.selectedDates = this._selectedDates.concat();\r
+YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {\r
+       type = type.toUpperCase();\r
+       var val = args[0];\r
+\r
+       switch (type) {\r
+               case "LOCALE_MONTHS":\r
+                       switch (val) {\r
+                               case "short":\r
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_SHORT").concat();\r
+                                       break;\r
+                               case "long":\r
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_LONG").concat();\r
+                                       break;\r
+                       }\r
+                       break;\r
+               case "LOCALE_WEEKDAYS":\r
+                       switch (val) {\r
+                               case "1char":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_1CHAR").concat();\r
+                                       break;\r
+                               case "short":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_SHORT").concat();\r
+                                       break;\r
+                               case "medium":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();\r
+                                       break;\r
+                               case "long":\r
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_LONG").concat();\r
+                                       break;\r
+                       }\r
+\r
+                       var START_WEEKDAY = this.cfg.getProperty("START_WEEKDAY");\r
 \r
-       this.pageDate = new Date(this._pageDate.getTime());\r
-       this.onReset();\r
+                       if (START_WEEKDAY > 0) {\r
+                               for (var w=0;w<START_WEEKDAY;++w) {\r
+                                       this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());\r
+                               }\r
+                       }\r
+                       break;\r
+       }\r
 };\r
 \r
 /**\r
-* Clears the selected dates in the current calendar widget and sets the calendar\r
-* to the current month and year.\r
+* Defines the style constants for the Calendar\r
+* @method initStyles\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.clear = function() {\r
-       this.selectedDates.length = 0;\r
-       this.pageDate = new Date(this.today.getTime());\r
-       this.onClear();\r
-};\r
+YAHOO.widget.Calendar.prototype.initStyles = function() {\r
 \r
-/**\r
-* Selects a date or a collection of dates on the current calendar. This method, by default,\r
-* does not call the render method explicitly. Once selection has completed, render must be \r
-* called for the changes to be reflected visually.\r
-* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
-* @return                                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.select = function(date) {\r
-       this.onBeforeSelect();\r
-\r
-       var aToBeSelected = this._toFieldArray(date);\r
-\r
-       for (var a=0;a<aToBeSelected.length;++a) {\r
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
-               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?\r
-                       this.selectedDates[this.selectedDates.length]=toSelect;\r
-               }\r
-       }\r
-       \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       }\r
+       /**\r
+       * Collection of Style constants for the Calendar\r
+       * @property Style\r
+       */\r
+       this.Style = {\r
+               /**\r
+               * @property Style.CSS_ROW_HEADER\r
+               */\r
+               CSS_ROW_HEADER: "calrowhead",\r
+               /**\r
+               * @property Style.CSS_ROW_FOOTER\r
+               */\r
+               CSS_ROW_FOOTER: "calrowfoot",\r
+               /**\r
+               * @property Style.CSS_CELL\r
+               */\r
+               CSS_CELL : "calcell",\r
+               /**\r
+               * @property Style.CSS_CELL_SELECTED\r
+               */\r
+               CSS_CELL_SELECTED : "selected",\r
+               /**\r
+               * @property Style.CSS_CELL_SELECTABLE\r
+               */\r
+               CSS_CELL_SELECTABLE : "selectable",\r
+               /**\r
+               * @property Style.CSS_CELL_RESTRICTED\r
+               */\r
+               CSS_CELL_RESTRICTED : "restricted",\r
+               /**\r
+               * @property Style.CSS_CELL_TODAY\r
+               */\r
+               CSS_CELL_TODAY : "today",\r
+               /**\r
+               * @property Style.CSS_CELL_OOM\r
+               */\r
+               CSS_CELL_OOM : "oom",\r
+               /**\r
+               * @property Style.CSS_CELL_OOB\r
+               */\r
+               CSS_CELL_OOB : "previous",\r
+               /**\r
+               * @property Style.CSS_HEADER\r
+               */\r
+               CSS_HEADER : "calheader",\r
+               /**\r
+               * @property Style.CSS_HEADER_TEXT\r
+               */\r
+               CSS_HEADER_TEXT : "calhead",\r
+               /**\r
+               * @property Style.CSS_WEEKDAY_CELL\r
+               */\r
+               CSS_WEEKDAY_CELL : "calweekdaycell",\r
+               /**\r
+               * @property Style.CSS_WEEKDAY_ROW\r
+               */\r
+               CSS_WEEKDAY_ROW : "calweekdayrow",\r
+               /**\r
+               * @property Style.CSS_FOOTER\r
+               */\r
+               CSS_FOOTER : "calfoot",\r
+               /**\r
+               * @property Style.CSS_CALENDAR\r
+               */\r
+               CSS_CALENDAR : "yui-calendar",\r
+               /**\r
+               * @property Style.CSS_SINGLE\r
+               */\r
+               CSS_SINGLE : "single",\r
+               /**\r
+               * @property Style.CSS_CONTAINER\r
+               */\r
+               CSS_CONTAINER : "yui-calcontainer",\r
+               /**\r
+               * @property Style.CSS_NAV_LEFT\r
+               */\r
+               CSS_NAV_LEFT : "calnavleft",\r
+               /**\r
+               * @property Style.CSS_NAV_RIGHT\r
+               */\r
+               CSS_NAV_RIGHT : "calnavright",\r
+               /**\r
+               * @property Style.CSS_CELL_TOP\r
+               */\r
+               CSS_CELL_TOP : "calcelltop",\r
+               /**\r
+               * @property Style.CSS_CELL_LEFT\r
+               */\r
+               CSS_CELL_LEFT : "calcellleft",\r
+               /**\r
+               * @property Style.CSS_CELL_RIGHT\r
+               */\r
+               CSS_CELL_RIGHT : "calcellright",\r
+               /**\r
+               * @property Style.CSS_CELL_BOTTOM\r
+               */\r
+               CSS_CELL_BOTTOM : "calcellbottom",\r
+               /**\r
+               * @property Style.CSS_CELL_HOVER\r
+               */\r
+               CSS_CELL_HOVER : "calcellhover",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT1\r
+               */\r
+               CSS_CELL_HIGHLIGHT1 : "highlight1",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT2\r
+               */\r
+               CSS_CELL_HIGHLIGHT2 : "highlight2",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT3\r
+               */\r
+               CSS_CELL_HIGHLIGHT3 : "highlight3",\r
+               /**\r
+               * @property Style.CSS_CELL_HIGHLIGHT4\r
+               */\r
+               CSS_CELL_HIGHLIGHT4 : "highlight4"\r
+       };\r
+};\r
 \r
-       this.onSelect();\r
+/**\r
+* Builds the date label that will be displayed in the calendar header or\r
+* footer, depending on configuration.\r
+* @method buildMonthLabel\r
+* @return      {String}        The formatted calendar month label\r
+*/\r
+YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {\r
+       var text = this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()] + " " + this.cfg.getProperty("pagedate").getFullYear();\r
+       return text;\r
+};\r
 \r
-       return this.getSelectedDates();\r
+/**\r
+* Builds the date digit that will be displayed in calendar cells\r
+* @method buildDayLabel\r
+* @param {Date}        workingDate     The current working date\r
+* @return      {String}        The formatted day label\r
+*/\r
+YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {\r
+       var day = workingDate.getDate();\r
+       return day;\r
 };\r
 \r
 /**\r
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
-* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
-* a full render. The selected style is applied to the cell directly.\r
-* @param       {Integer}       cellIndex       The index of the cell to select in the current calendar. \r
-* @return                                                      Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
+* Renders the calendar header.\r
+* @method renderHeader\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.selectCell = function(cellIndex) {\r
-       this.onBeforeSelect();\r
+YAHOO.widget.Calendar.prototype.renderHeader = function(html) {\r
+       var colSpan = 7;\r
+\r
+       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {\r
+               colSpan += 1;\r
+       }\r
 \r
-       this.cells = this.tbody.getElementsByTagName("TD");\r
+       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {\r
+               colSpan += 1;\r
+       }\r
 \r
-       var cell = this.cells[cellIndex];\r
-       var cellDate = this.cellDates[cellIndex];\r
+       html[html.length] = "<thead>";\r
+       html[html.length] =             "<tr>";\r
+       html[html.length] =                     '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';\r
+       html[html.length] =                             '<div class="' + this.Style.CSS_HEADER + '">';\r
 \r
-       var dCellDate = this._toDate(cellDate);\r
+               var renderLeft, renderRight = false;\r
 \r
-       var selectDate = cellDate.concat();\r
+               if (this.parent) {\r
+                       if (this.index === 0) {\r
+                               renderLeft = true;\r
+                       }\r
+                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {\r
+                               renderRight = true;\r
+                       }\r
+               } else {\r
+                       renderLeft = true;\r
+                       renderRight = true;\r
+               }\r
 \r
-       this.selectedDates.push(selectDate);\r
-       \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       }\r
+               var cal = this.parent || this;\r
 \r
-       this.renderCellStyleSelected(dCellDate,cell);\r
+               if (renderLeft) {\r
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_LEFT") + ')">&#160;</a>';\r
+               }\r
 \r
-       this.onSelect();\r
-       this.doCellMouseOut.call(cell, null, this);\r
+               html[html.length] = this.buildMonthLabel();\r
 \r
-       return this.getSelectedDates();\r
-};\r
+               if (renderRight) {\r
+                       html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_RIGHT") + ')">&#160;</a>';\r
+               }\r
 \r
-/**\r
-* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
-* does not call the render method explicitly. Once deselection has completed, render must be \r
-* called for the changes to be reflected visually.\r
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. \r
-* @return                                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.deselect = function(date) {\r
-       this.onBeforeDeselect();\r
 \r
-       var aToBeSelected = this._toFieldArray(date);\r
+       html[html.length] =                             '</div>';\r
+       html[html.length] =                     '</th>';\r
+       html[html.length] =             '</tr>';\r
 \r
-       for (var a=0;a<aToBeSelected.length;++a) {\r
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
-               var index = this._indexOfSelectedFieldArray(toSelect);\r
-       \r
-               if (index != -1) {      \r
-                       this.selectedDates.splice(index,1);\r
-               }\r
+       if (this.cfg.getProperty("SHOW_WEEKDAYS")) {\r
+               html = this.buildWeekdays(html);\r
        }\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
-       } \r
+       html[html.length] = '</thead>';\r
 \r
-       this.onDeselect();\r
-       return this.getSelectedDates();\r
+       return html;\r
 };\r
 \r
 /**\r
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
-* a full render. The selected style is removed from the cell directly.\r
-* @param       {Integer}       cellIndex       The index of the cell to deselect in the current calendar. \r
-* @return                                                      Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-* @type Date[]\r
+* Renders the Calendar's weekday headers.\r
+* @method buildWeekdays\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.deselectCell = function(i) {\r
-       this.onBeforeDeselect();\r
-       this.cells = this.tbody.getElementsByTagName("TD");\r
-\r
-       var cell = this.cells[i];\r
-       var cellDate = this.cellDates[i];\r
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);\r
-\r
-       var dCellDate = this._toDate(cellDate);\r
-\r
-       var selectDate = cellDate.concat();\r
+YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {\r
 \r
-       if (cellDateIndex > -1) {\r
-               if (this.pageDate.getMonth() == dCellDate.getMonth() &&\r
-                       this.pageDate.getFullYear() == dCellDate.getFullYear()) {\r
-                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);\r
-               }\r
+       html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';\r
 \r
-               this.selectedDates.splice(cellDateIndex, 1);\r
+       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {\r
+               html[html.length] = '<th>&#160;</th>';\r
        }\r
 \r
+       for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {\r
+               html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';\r
+       }\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
+       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {\r
+               html[html.length] = '<th>&#160;</th>';\r
        }\r
 \r
-       this.onDeselect();\r
-       return this.getSelectedDates();\r
+       html[html.length] = '</tr>';\r
+\r
+       return html;\r
 };\r
 \r
 /**\r
-* Deselects all dates on the current calendar.\r
-* @return                              Array of JavaScript Date objects representing all individual dates that are currently selected.\r
-*                                              Assuming that this function executes properly, the return value should be an empty array.\r
-*                                              However, the empty array is returned for the sake of being able to check the selection status\r
-*                                              of the calendar.\r
-* @type Date[]\r
+* Renders the calendar body.\r
+* @method renderBody\r
+* @param {Date}        workingDate     The current working Date being used for the render process\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.deselectAll = function() {\r
-       this.onBeforeDeselect();\r
-       var count = this.selectedDates.length;\r
-       this.selectedDates.length = 0;\r
+YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {\r
 \r
-       if (this.parent) {\r
-               this.parent.sync(this);\r
+       var startDay = this.cfg.getProperty("START_WEEKDAY");\r
+\r
+       this.preMonthDays = workingDate.getDay();\r
+       if (startDay > 0) {\r
+               this.preMonthDays -= startDay;\r
        }\r
-       \r
-       if (count > 0) {\r
-               this.onDeselect();\r
+       if (this.preMonthDays < 0) {\r
+               this.preMonthDays += 7;\r
        }\r
 \r
-       return this.getSelectedDates();\r
-};\r
-/************* END SELECTION METHODS *************************************************************/\r
+       this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();\r
+       this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;\r
 \r
+       workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);\r
 \r
-/************* BEGIN TYPE CONVERSION METHODS ****************************************************/\r
+       var useDate,weekNum,weekClass;\r
+       useDate = this.cfg.getProperty("pagedate");\r
 \r
-/**\r
-* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure\r
-* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].\r
-* @private\r
-* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
-*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
-*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
-*                                                              This method can also take a JavaScript Date object or an array of Date objects. \r
-* @return                                              Array of date field arrays\r
-* @type Array[](Integer[])\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._toFieldArray = function(date) {\r
-       var returnDate = new Array();\r
+       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + '">';\r
 \r
-       if (date instanceof Date) {\r
-               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];\r
-       } else if (typeof date == 'string') {\r
-               returnDate = this._parseDates(date);\r
-       } else if (date instanceof Array) {\r
-               for (var i=0;i<date.length;++i) {\r
-                       var d = date[i];\r
-                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];\r
-               }\r
-       }\r
-       \r
-       return returnDate;\r
-};\r
+       var i = 0;\r
 \r
-/**\r
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
-* @private\r
-* @param       {Integer[]}             dateFieldArray  The date field array to convert to a JavaScript Date.\r
-* @return                                      JavaScript Date object representing the date field array\r
-* @type Date\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._toDate = function(dateFieldArray) {\r
-       if (dateFieldArray instanceof Date) {\r
-               return dateFieldArray;\r
-       } else {\r
-               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);\r
-       }\r
-};\r
-/************* END TYPE CONVERSION METHODS ******************************************************/\r
+       var tempDiv = document.createElement("div");\r
+       var cell = document.createElement("td");\r
+       tempDiv.appendChild(cell);\r
 \r
+       var jan1 = new Date(useDate.getFullYear(),0,1);\r
 \r
-/************* BEGIN UTILITY METHODS ****************************************************/\r
-/**\r
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
-* @private\r
-* @param       {Integer[]}     array1  The first date field array to compare\r
-* @param       {Integer[]}     array2  The first date field array to compare\r
-* @return                                              The boolean that represents the equality of the two arrays\r
-* @type Boolean\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual = function(array1, array2) {\r
-       var match = false;\r
+       var cal = this.parent || this;\r
 \r
-       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {\r
-               match=true;     \r
-       }\r
+       for (var r=0;r<6;r++) {\r
 \r
-       return match;\r
-};\r
+               weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);\r
 \r
-/**\r
-* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.\r
-* @private\r
-* @param       {Integer[]}             find    The date field array to search for\r
-* @return                                      The index of the date field array within the collection of selected dates.\r
-*                                                              -1 will be returned if the date is not found.\r
-* @type Integer\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray = function(find) {\r
-       var selected = -1;\r
+               weekClass = "w" + weekNum;\r
 \r
-       for (var s=0;s<this.selectedDates.length;++s) {\r
-               var sArray = this.selectedDates[s];\r
-               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {\r
-                       selected = s;\r
+               if (r !== 0 && this.isDateOOM(workingDate) && this.cfg.getProperty("HIDE_BLANK_WEEKS") === true) {\r
                        break;\r
-               }\r
-       }\r
+               } else {\r
 \r
-       return selected;\r
-};\r
+                       html[html.length] = '<tr class="' + weekClass + '">';\r
 \r
-/**\r
-* Determines whether a given date is OOM (out of month).\r
-* @param       {Date}  date    The JavaScript Date object for which to check the OOM status\r
-* @return      {Boolean}       true if the date is OOM\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.isDateOOM = function(date) {\r
-       var isOOM = false;\r
-       if (date.getMonth() != this.pageDate.getMonth()) {\r
-               isOOM = true;\r
-       }\r
-       return isOOM;\r
-};\r
+                       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) { html = this.renderRowHeader(weekNum, html); }\r
 \r
-/************* END UTILITY METHODS *******************************************************/\r
+                       for (var d=0;d<7;d++){ // Render actual days\r
 \r
-/************* BEGIN EVENT HANDLERS ******************************************************/\r
+                               var cellRenderers = [];\r
 \r
-/**\r
-* Event executed before a date is selected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onBeforeSelect = function() {\r
-       if (! this.Options.MULTI_SELECT) {\r
-               this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);\r
-               this.deselectAll();\r
-       }\r
-};\r
+                               this.clearElement(cell);\r
 \r
-/**\r
-* Event executed when a date is selected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onSelect = function() { };\r
+                               YAHOO.util.Dom.addClass(cell, "calcell");\r
 \r
-/**\r
-* Event executed before a date is deselected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onBeforeDeselect = function() { };\r
+                               cell.id = this.id + "_cell" + i;\r
 \r
-/**\r
-* Event executed when a date is deselected in the calendar widget.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onDeselect = function() { };\r
+                               cell.innerHTML = i;\r
 \r
-/**\r
-* Event executed when the user navigates to a different calendar page.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onChangePage = function() {\r
-               var me = this;\r
+                               var renderer = null;\r
 \r
-               this.renderHeader();\r
-               if (this.renderProcId) {\r
-                       clearTimeout(this.renderProcId);\r
-               }\r
-               this.renderProcId = setTimeout(function() {\r
-                                                                                       me.render();\r
-                                                                                       me.renderProcId = null;\r
-                                                                               }, 1);\r
-};\r
+                               if (workingDate.getFullYear()   == this.today.getFullYear() &&\r
+                                       workingDate.getMonth()          == this.today.getMonth() &&\r
+                                       workingDate.getDate()           == this.today.getDate()) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;\r
+                               }\r
 \r
-/**\r
-* Event executed when the calendar widget is rendered.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onRender = function() { };\r
+                               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates\r
 \r
-/**\r
-* Event executed when the calendar widget is reset to its original state.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onReset = function() { this.render(); };\r
+                               if (this.isDateOOM(workingDate)) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;\r
+                               } else {\r
 \r
-/**\r
-* Event executed when the calendar widget is completely cleared to the current month with no selections.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.onClear = function() { this.render(); };\r
+                                       YAHOO.util.Dom.addClass(cell, "wd" + workingDate.getDay());\r
+                                       YAHOO.util.Dom.addClass(cell, "d" + workingDate.getDate());\r
+\r
+                                       for (var s=0;s<this.renderStack.length;++s) {\r
+\r
+                                               var rArray = this.renderStack[s];\r
+                                               var type = rArray[0];\r
+\r
+                                               var month;\r
+                                               var day;\r
+                                               var year;\r
+\r
+                                               switch (type) {\r
+                                                       case YAHOO.widget.Calendar.DATE:\r
+                                                               month = rArray[1][1];\r
+                                                               day = rArray[1][2];\r
+                                                               year = rArray[1][0];\r
+\r
+                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {\r
+                                                                       renderer = rArray[2];\r
+                                                                       this.renderStack.splice(s,1);\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.MONTH_DAY:\r
+                                                               month = rArray[1][0];\r
+                                                               day = rArray[1][1];\r
+\r
+                                                               if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {\r
+                                                                       renderer = rArray[2];\r
+                                                                       this.renderStack.splice(s,1);\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.RANGE:\r
+                                                               var date1 = rArray[1][0];\r
+                                                               var date2 = rArray[1][1];\r
+\r
+                                                               var d1month = date1[1];\r
+                                                               var d1day = date1[2];\r
+                                                               var d1year = date1[0];\r
+\r
+                                                               var d1 = new Date(d1year, d1month-1, d1day);\r
+\r
+                                                               var d2month = date2[1];\r
+                                                               var d2day = date2[2];\r
+                                                               var d2year = date2[0];\r
+\r
+                                                               var d2 = new Date(d2year, d2month-1, d2day);\r
+\r
+                                                               if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {\r
+                                                                       renderer = rArray[2];\r
+\r
+                                                                       if (workingDate.getTime()==d2.getTime()) {\r
+                                                                               this.renderStack.splice(s,1);\r
+                                                                       }\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.WEEKDAY:\r
+\r
+                                                               var weekday = rArray[1][0];\r
+                                                               if (workingDate.getDay()+1 == weekday) {\r
+                                                                       renderer = rArray[2];\r
+                                                               }\r
+                                                               break;\r
+                                                       case YAHOO.widget.Calendar.MONTH:\r
+\r
+                                                               month = rArray[1][0];\r
+                                                               if (workingDate.getMonth()+1 == month) {\r
+                                                                       renderer = rArray[2];\r
+                                                               }\r
+                                                               break;\r
+                                               }\r
 \r
-/**\r
-* Validates the calendar widget. This method has no default implementation\r
-* and must be extended by subclassing the widget.\r
-* @return      Should return true if the widget validates, and false if\r
-* it doesn't.\r
-* @type Boolean\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.validate = function() { return true; };\r
+                                               if (renderer) {\r
+                                                       cellRenderers[cellRenderers.length]=renderer;\r
+                                               }\r
+                                       }\r
 \r
-/************* END EVENT HANDLERS *********************************************************/\r
+                               }\r
 \r
+                               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;\r
+                               }\r
 \r
-/************* BEGIN DATE PARSE METHODS ***************************************************/\r
+                               var mindate = this.cfg.getProperty("mindate");\r
+                               var maxdate = this.cfg.getProperty("maxdate");\r
 \r
+                               if (mindate) {\r
+                                       mindate = YAHOO.widget.DateMath.clearTime(mindate);\r
+                               }\r
+                               if (maxdate) {\r
+                                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);\r
+                               }\r
 \r
-/**\r
-* Converts a date string to a date field array\r
-* @private\r
-* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.\r
-* @return                              A date field array representing the string passed to the method\r
-* @type Array[](Integer[])\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype._parseDate = function(sDate) {\r
-       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);\r
-       var rArray;\r
+                               if (\r
+                                       (mindate && (workingDate.getTime() < mindate.getTime())) ||\r
+                                       (maxdate && (workingDate.getTime() > maxdate.getTime()))\r
+                               ) {\r
+                                       cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;\r
+                               } else {\r
+                                       cellRenderers[cellRenderers.length]=cal.styleCellDefault;\r
+                                       cellRenderers[cellRenderers.length]=cal.renderCellDefault;\r
+                               }\r
 \r
-       if (aDate.length == 2) {\r
-               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];\r
-               rArray.type = YAHOO.widget.Calendar_Core.MONTH_DAY;\r
-       } else {\r
-               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];\r
-               rArray.type = YAHOO.widget.Calendar_Core.DATE;\r
-       }\r
-       return rArray;\r
+\r
+\r
+                               for (var x=0;x<cellRenderers.length;++x) {\r
+                                       var ren = cellRenderers[x];\r
+                                       if (ren.call((this.parent || this),workingDate,cell) == YAHOO.widget.Calendar.STOP_RENDER) {\r
+                                               break;\r
+                                       }\r
+                               }\r
+\r
+                               workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);\r
+\r
+                               if (i >= 0 && i <= 6) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);\r
+                               }\r
+                               if ((i % 7) === 0) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);\r
+                               }\r
+                               if (((i+1) % 7) === 0) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);\r
+                               }\r
+\r
+                               var postDays = this.postMonthDays;\r
+                               if (postDays >= 7 && this.cfg.getProperty("HIDE_BLANK_WEEKS")) {\r
+                                       var blankWeeks = Math.floor(postDays/7);\r
+                                       for (var p=0;p<blankWeeks;++p) {\r
+                                               postDays -= 7;\r
+                                       }\r
+                               }\r
+\r
+                               if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {\r
+                                       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);\r
+                               }\r
+\r
+                               html[html.length] = tempDiv.innerHTML;\r
+\r
+                               i++;\r
+                       }\r
+\r
+                       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) { html = this.renderRowFooter(weekNum, html); }\r
+\r
+                       html[html.length] = '</tr>';\r
+               }\r
+       }\r
+\r
+       html[html.length] = '</tbody>';\r
+\r
+       return html;\r
 };\r
 \r
 /**\r
-* Converts a multi or single-date string to an array of date field arrays\r
-* @private\r
-* @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\r
-* @return                                                      An array of date field arrays\r
-* @type Array[](Integer[])\r
+* Renders the calendar footer. In the default implementation, there is\r
+* no footer.\r
+* @method renderFooter\r
+* @param {Array}       html    The current working HTML array\r
+* @return {Array} The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._parseDates = function(sDates) {\r
-       var aReturn = new Array();\r
+YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };\r
 \r
-       var aDates = sDates.split(this.Locale.DATE_DELIMITER);\r
-       \r
-       for (var d=0;d<aDates.length;++d) {\r
-               var sDate = aDates[d];\r
+/**\r
+* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute\r
+* when the method is called: renderHeader, renderBody, renderFooter.\r
+* Refer to the documentation for those methods for information on\r
+* individual render tasks.\r
+* @method render\r
+*/\r
+YAHOO.widget.Calendar.prototype.render = function() {\r
+       this.beforeRenderEvent.fire();\r
 \r
-               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {\r
-                       // This is a range\r
-                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);\r
+       // Find starting day of the current month\r
+       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));\r
 \r
-                       var dateStart = this._parseDate(aRange[0]);\r
-                       var dateEnd = this._parseDate(aRange[1]);\r
+       this.resetRenderers();\r
+       this.cellDates.length = 0;\r
 \r
-                       var fullRange = this._parseRange(dateStart, dateEnd);\r
-                       aReturn = aReturn.concat(fullRange);\r
-               } else {\r
-                       // This is not a range\r
-                       var aDate = this._parseDate(sDate);\r
-                       aReturn.push(aDate);\r
+       YAHOO.util.Event.purgeElement(this.oDomContainer, true);\r
+\r
+       var html = [];\r
+\r
+       html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';\r
+       html = this.renderHeader(html);\r
+       html = this.renderBody(workingDate, html);\r
+       html = this.renderFooter(html);\r
+       html[html.length] = '</table>';\r
+\r
+       this.oDomContainer.innerHTML = html.join("\n");\r
+\r
+       this.applyListeners();\r
+       this.cells = this.oDomContainer.getElementsByTagName("td");\r
+\r
+       this.cfg.refireEvent("title");\r
+       this.cfg.refireEvent("close");\r
+       this.cfg.refireEvent("iframe");\r
+\r
+       this.renderEvent.fire();\r
+};\r
+\r
+/**\r
+* Applies the Calendar's DOM listeners to applicable elements.\r
+* @method applyListeners\r
+*/\r
+YAHOO.widget.Calendar.prototype.applyListeners = function() {\r
+\r
+       var root = this.oDomContainer;\r
+       var cal = this.parent || this;\r
+\r
+       var linkLeft, linkRight;\r
+\r
+       linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, "a", root);\r
+       linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, "a", root);\r
+\r
+       if (linkLeft) {\r
+               this.linkLeft = linkLeft[0];\r
+               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", cal.previousMonth, cal, true);\r
+       }\r
+\r
+       if (linkRight) {\r
+               this.linkRight = linkRight[0];\r
+               YAHOO.util.Event.addListener(this.linkRight, "mousedown", cal.nextMonth, cal, true);\r
+       }\r
+\r
+       if (this.domEventMap) {\r
+               var el,elements;\r
+               for (var cls in this.domEventMap) {\r
+                       if (this.domEventMap.hasOwnProperty(cls)) {\r
+                               var items = this.domEventMap[cls];\r
+\r
+                               if (! (items instanceof Array)) {\r
+                                       items = [items];\r
+                               }\r
+\r
+                               for (var i=0;i<items.length;i++)        {\r
+                                       var item = items[i];\r
+                                       elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);\r
+\r
+                                       for (var c=0;c<elements.length;c++) {\r
+                                               el = elements[c];\r
+                                                YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );\r
+                                       }\r
+                               }\r
+                       }\r
                }\r
        }\r
-       return aReturn;\r
+\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);\r
+       YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);\r
 };\r
 \r
 /**\r
-* Converts a date range to the full list of included dates\r
-* @private\r
-* @param       {Integer[]}     startDate       Date field array representing the first date in the range\r
-* @param       {Integer[]}     endDate         Date field array representing the last date in the range\r
-* @return                                                      An array of date field arrays\r
-* @type Array[](Integer[])\r
+* Retrieves the Date object for the specified Calendar cell\r
+* @method getDateByCellId\r
+* @param {String}      id      The id of the cell\r
+* @return {Date} The Date object for the specified Calendar cell\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._parseRange = function(startDate, endDate) {\r
-       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);\r
-       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);\r
-       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);\r
+YAHOO.widget.Calendar.prototype.getDateByCellId = function(id) {\r
+       var date = this.getDateFieldsByCellId(id);\r
+       return new Date(date[0],date[1]-1,date[2]);\r
+};\r
 \r
-       var results = new Array();\r
-       results.push(startDate);\r
-       while (dCurrent.getTime() <= dEnd.getTime()) {\r
-               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);\r
-               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);\r
-       }\r
-       return results;\r
+/**\r
+* Retrieves the Date object for the specified Calendar cell\r
+* @method getDateFieldsByCellId\r
+* @param {String}      id      The id of the cell\r
+* @return {Array}      The array of Date fields for the specified Calendar cell\r
+*/\r
+YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {\r
+       id = id.toLowerCase().split("_cell")[1];\r
+       id = parseInt(id, 10);\r
+       return this.cellDates[id];\r
 };\r
 \r
-/************* END DATE PARSE METHODS *****************************************************/\r
+// BEGIN BUILT-IN TABLE CELL RENDERERS\r
 \r
-/************* BEGIN RENDERER METHODS *****************************************************/\r
+/**\r
+* Renders a cell that falls before the minimum date or after the maximum date.\r
+* widget class.\r
+* @method renderOutOfBoundsDate\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);\r
+       cell.innerHTML = workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
+};\r
 \r
 /**\r
-* Resets the render stack of the current calendar to its original pre-render value.\r
+* Renders the row header for a week.\r
+* @method renderRowHeader\r
+* @param {Number}      weekNum The week number of the current row\r
+* @param {Array}       cell    The current working HTML array\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.resetRenderers = function() {\r
-       this.renderStack = this._renderStack.concat();\r
+YAHOO.widget.Calendar.prototype.renderRowHeader = function(weekNum, html) {\r
+       html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';\r
+       return html;\r
 };\r
 \r
 /**\r
-* Clears the inner HTML, CSS class and style information from the specified cell.\r
-* @param       {HTMLTableCellElement}  The cell to clear\r
-*/ \r
-YAHOO.widget.Calendar_Core.prototype.clearElement = function(cell) {\r
-       cell.innerHTML = "&nbsp;";\r
-       cell.className="";\r
+* Renders the row footer for a week.\r
+* @method renderRowFooter\r
+* @param {Number}      weekNum The week number of the current row\r
+* @param {Array}       cell    The current working HTML array\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {\r
+       html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';\r
+       return html;\r
 };\r
 \r
 /**\r
-* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the conditions specified in the date string for this renderer.\r
-* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
-*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+* Renders a single standard calendar cell in the calendar widget table.\r
+* All logic for determining how a standard default cell will be rendered is\r
+* encapsulated in this method, and must be accounted for when extending the\r
+* widget class.\r
+* @method renderCellDefault\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.addRenderer = function(sDates, fnRender) {\r
-       var aDates = this._parseDates(sDates);\r
-       for (var i=0;i<aDates.length;++i) {\r
-               var aDate = aDates[i];\r
-       \r
-               if (aDate.length == 2) { // this is either a range or a month/day combo\r
-                       if (aDate[0] instanceof Array) { // this is a range\r
-                               this._addRenderer(YAHOO.widget.Calendar_Core.RANGE,aDate,fnRender);\r
-                       } else { // this is a month/day combo\r
-                               this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,aDate,fnRender);\r
-                       }\r
-               } else if (aDate.length == 3) {\r
-                       this._addRenderer(YAHOO.widget.Calendar_Core.DATE,aDate,fnRender);\r
-               }\r
-       }\r
+YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {\r
+       cell.innerHTML = '<a href="javascript:void(null);" >' + this.buildDayLabel(workingDate) + "</a>";\r
 };\r
 \r
 /**\r
-* The private method used for adding cell renderers to the local render stack.\r
-* This method is called by other methods that set the renderer type prior to the method call.\r
-* @private\r
-* @param       {String}        type            The type string that indicates the type of date renderer being added.\r
-*                                                                      Values are YAHOO.widget.Calendar_Core.DATE, YAHOO.widget.Calendar_Core.MONTH_DAY, YAHOO.widget.Calendar_Core.WEEKDAY,\r
-*                                                                      YAHOO.widget.Calendar_Core.RANGE, YAHOO.widget.Calendar_Core.MONTH\r
-* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based\r
-*                                                                      on the renderer type\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+* Styles a selectable cell.\r
+* @method styleCellDefault\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
 */\r
-YAHOO.widget.Calendar_Core.prototype._addRenderer = function(type, aDates, fnRender) {\r
-       var add = [type,aDates,fnRender];\r
-       this.renderStack.unshift(add);  \r
-       \r
-       this._renderStack = this.renderStack.concat();\r
+YAHOO.widget.Calendar.prototype.styleCellDefault = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);\r
+};\r
+\r
+\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight1 style\r
+* @method renderCellStyleHighlight1\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);\r
+};\r
+\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight2 style\r
+* @method renderCellStyleHighlight2\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);\r
+};\r
+\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight3 style\r
+* @method renderCellStyleHighlight3\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);\r
+};\r
+\r
+/**\r
+* Renders a single standard calendar cell using the CSS hightlight4 style\r
+* @method renderCellStyleHighlight4\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);\r
+};\r
+\r
+/**\r
+* Applies the default style used for rendering today's date to the current calendar cell\r
+* @method renderCellStyleToday\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleToday = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);\r
+};\r
+\r
+/**\r
+* Applies the default style used for rendering selected dates to the current calendar cell\r
+* @method renderCellStyleSelected\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellStyleSelected = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);\r
+};\r
+\r
+/**\r
+* Applies the default style used for rendering dates that are not a part of the current\r
+* month (preceding or trailing the cells for the current month)\r
+* @method renderCellNotThisMonth\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderCellNotThisMonth = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);\r
+       cell.innerHTML=workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
+};\r
+\r
+/**\r
+* Renders the current calendar cell as a non-selectable "black-out" date using the default\r
+* restricted style.\r
+* @method renderBodyCellRestricted\r
+* @param {Date}                                        workingDate             The current working Date object being used to generate the calendar\r
+* @param {HTMLTableCellElement}        cell                    The current working cell in the calendar\r
+* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering\r
+*                      should not be terminated\r
+*/\r
+YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate, cell) {\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);\r
+       YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);\r
+       cell.innerHTML=workingDate.getDate();\r
+       return YAHOO.widget.Calendar.STOP_RENDER;\r
+};\r
+\r
+// END BUILT-IN TABLE CELL RENDERERS\r
+\r
+// BEGIN MONTH NAVIGATION METHODS\r
+\r
+/**\r
+* Adds the designated number of months to the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method addMonths\r
+* @param {Number}      count   The number of months to add to the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.addMonths = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
+};\r
+\r
+/**\r
+* Subtracts the designated number of months from the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractMonths\r
+* @param {Number}      count   The number of months to subtract from the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
+};\r
+\r
+/**\r
+* Adds the designated number of years to the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method addYears\r
+* @param {Number}      count   The number of years to add to the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.addYears = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
+};\r
+\r
+/**\r
+* Subtcats the designated number of years from the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractYears\r
+* @param {Number}      count   The number of years to subtract from the current calendar\r
+*/\r
+YAHOO.widget.Calendar.prototype.subtractYears = function(count) {\r
+       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));\r
+       this.resetRenderers();\r
+       this.changePageEvent.fire();\r
 };\r
 \r
-/**\r
-* Adds a month to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the month passed to this method.\r
-* @param       {Integer}       month           The month (1-12) to associate with this renderer\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.addMonthRenderer = function(month, fnRender) {\r
-       this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[month],fnRender);\r
-};\r
+/**\r
+* Navigates to the next month page in the calendar widget.\r
+* @method nextMonth\r
+*/\r
+YAHOO.widget.Calendar.prototype.nextMonth = function() {\r
+       this.addMonths(1);\r
+};\r
+\r
+/**\r
+* Navigates to the previous month page in the calendar widget.\r
+* @method previousMonth\r
+*/\r
+YAHOO.widget.Calendar.prototype.previousMonth = function() {\r
+       this.subtractMonths(1);\r
+};\r
+\r
+/**\r
+* Navigates to the next year in the currently selected month in the calendar widget.\r
+* @method nextYear\r
+*/\r
+YAHOO.widget.Calendar.prototype.nextYear = function() {\r
+       this.addYears(1);\r
+};\r
+\r
+/**\r
+* Navigates to the previous year in the currently selected month in the calendar widget.\r
+* @method previousYear\r
+*/\r
+YAHOO.widget.Calendar.prototype.previousYear = function() {\r
+       this.subtractYears(1);\r
+};\r
+\r
+// END MONTH NAVIGATION METHODS\r
+\r
+// BEGIN SELECTION METHODS\r
+\r
+/**\r
+* Resets the calendar widget to the originally selected month and year, and\r
+* sets the calendar to the initial selection(s).\r
+* @method reset\r
+*/\r
+YAHOO.widget.Calendar.prototype.reset = function() {\r
+       this.cfg.resetProperty("selected");\r
+       this.cfg.resetProperty("pagedate");\r
+       this.resetEvent.fire();\r
+};\r
+\r
+/**\r
+* Clears the selected dates in the current calendar widget and sets the calendar\r
+* to the current month and year.\r
+* @method clear\r
+*/\r
+YAHOO.widget.Calendar.prototype.clear = function() {\r
+       this.cfg.setProperty("selected", []);\r
+       this.cfg.setProperty("pagedate", new Date(this.today.getTime()));\r
+       this.clearEvent.fire();\r
+};\r
+\r
+/**\r
+* Selects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once selection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method select\r
+* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.select = function(date) {\r
+       this.beforeSelectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+       var aToBeSelected = this._toFieldArray(date);\r
+\r
+       for (var a=0;a<aToBeSelected.length;++a) {\r
+               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
+               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?\r
+                       selected[selected.length]=toSelect;\r
+               }\r
+       }\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.selectEvent.fire(aToBeSelected);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
+* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is applied to the cell directly.\r
+* @method selectCell\r
+* @param       {Number}        cellIndex       The index of the cell to select in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {\r
+       this.beforeSelectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var cell = this.cells[cellIndex];\r
+       var cellDate = this.cellDates[cellIndex];\r
+\r
+       var dCellDate = this._toDate(cellDate);\r
+\r
+       var selectDate = cellDate.concat();\r
+\r
+       selected[selected.length] = selectDate;\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.renderCellStyleSelected(dCellDate,cell);\r
+\r
+       this.selectEvent.fire([selectDate]);\r
+\r
+       this.doCellMouseOut.call(cell, null, this);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once deselection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method deselect\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselect = function(date) {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var aToBeSelected = this._toFieldArray(date);\r
+\r
+       for (var a=0;a<aToBeSelected.length;++a) {\r
+               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select\r
+               var index = this._indexOfSelectedFieldArray(toSelect);\r
+\r
+               if (index != -1) {\r
+                       selected.splice(index,1);\r
+               }\r
+       }\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.deselectEvent.fire(aToBeSelected);\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
+* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is removed from the cell directly.\r
+* @method deselectCell\r
+* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselectCell = function(i) {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       var cell = this.cells[i];\r
+       var cellDate = this.cellDates[i];\r
+       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);\r
+\r
+       var dCellDate = this._toDate(cellDate);\r
+\r
+       var selectDate = cellDate.concat();\r
+\r
+       if (cellDateIndex > -1) {\r
+               if (this.cfg.getProperty("pagedate").getMonth() == dCellDate.getMonth() &&\r
+                       this.cfg.getProperty("pagedate").getFullYear() == dCellDate.getFullYear()) {\r
+                       YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);\r
+               }\r
+\r
+               selected.splice(cellDateIndex, 1);\r
+       }\r
+\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", selected);\r
+       } else {\r
+               this.cfg.setProperty("selected", selected);\r
+       }\r
+\r
+       this.deselectEvent.fire(selectDate);\r
+       return this.getSelectedDates();\r
+};\r
+\r
+/**\r
+* Deselects all dates on the current calendar.\r
+* @method deselectAll\r
+* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*                                              Assuming that this function executes properly, the return value should be an empty array.\r
+*                                              However, the empty array is returned for the sake of being able to check the selection status\r
+*                                              of the calendar.\r
+*/\r
+YAHOO.widget.Calendar.prototype.deselectAll = function() {\r
+       this.beforeDeselectEvent.fire();\r
+\r
+       var selected = this.cfg.getProperty("selected");\r
+       var count = selected.length;\r
+       var sel = selected.concat();\r
+\r
+       if (this.parent) {\r
+               this.parent.cfg.setProperty("selected", []);\r
+       } else {\r
+               this.cfg.setProperty("selected", []);\r
+       }\r
+\r
+       if (count > 0) {\r
+               this.deselectEvent.fire(sel);\r
+       }\r
+\r
+       return this.getSelectedDates();\r
+};\r
+\r
+// END SELECTION METHODS\r
+\r
+// BEGIN TYPE CONVERSION METHODS\r
+\r
+/**\r
+* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure\r
+* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].\r
+* @method _toFieldArray\r
+* @private\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return {Array[](Number[])}  Array of date field arrays\r
+*/\r
+YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {\r
+       var returnDate = [];\r
+\r
+       if (date instanceof Date) {\r
+               returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];\r
+       } else if (typeof date == 'string') {\r
+               returnDate = this._parseDates(date);\r
+       } else if (date instanceof Array) {\r
+               for (var i=0;i<date.length;++i) {\r
+                       var d = date[i];\r
+                       returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];\r
+               }\r
+       }\r
+\r
+       return returnDate;\r
+};\r
+\r
+/**\r
+* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
+* @method _toDate\r
+* @private\r
+* @param       {Number[]}              dateFieldArray  The date field array to convert to a JavaScript Date.\r
+* @return      {Date}  JavaScript Date object representing the date field array\r
+*/\r
+YAHOO.widget.Calendar.prototype._toDate = function(dateFieldArray) {\r
+       if (dateFieldArray instanceof Date) {\r
+               return dateFieldArray;\r
+       } else {\r
+               return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);\r
+       }\r
+};\r
+\r
+// END TYPE CONVERSION METHODS\r
+\r
+// BEGIN UTILITY METHODS\r
+\r
+/**\r
+* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.\r
+* @method _fieldArraysAreEqual\r
+* @private\r
+* @param       {Number[]}      array1  The first date field array to compare\r
+* @param       {Number[]}      array2  The first date field array to compare\r
+* @return      {Boolean}       The boolean that represents the equality of the two arrays\r
+*/\r
+YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2) {\r
+       var match = false;\r
+\r
+       if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {\r
+               match=true;\r
+       }\r
+\r
+       return match;\r
+};\r
+\r
+/**\r
+* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.\r
+* @method      _indexOfSelectedFieldArray\r
+* @private\r
+* @param       {Number[]}              find    The date field array to search for\r
+* @return      {Number}                        The index of the date field array within the collection of selected dates.\r
+*                                                              -1 will be returned if the date is not found.\r
+*/\r
+YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {\r
+       var selected = -1;\r
+       var seldates = this.cfg.getProperty("selected");\r
+\r
+       for (var s=0;s<seldates.length;++s) {\r
+               var sArray = seldates[s];\r
+               if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {\r
+                       selected = s;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return selected;\r
+};\r
+\r
+/**\r
+* Determines whether a given date is OOM (out of month).\r
+* @method      isDateOOM\r
+* @param       {Date}  date    The JavaScript Date object for which to check the OOM status\r
+* @return      {Boolean}       true if the date is OOM\r
+*/\r
+YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {\r
+       var isOOM = false;\r
+       if (date.getMonth() != this.cfg.getProperty("pagedate").getMonth()) {\r
+               isOOM = true;\r
+       }\r
+       return isOOM;\r
+};\r
+\r
+// END UTILITY METHODS\r
+\r
+// BEGIN EVENT HANDLERS\r
+\r
+/**\r
+* Event executed before a date is selected in the calendar widget.\r
+* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {\r
+       if (this.cfg.getProperty("MULTI_SELECT") === false) {\r
+               if (this.parent) {\r
+                       this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);\r
+                       this.parent.deselectAll();\r
+               } else {\r
+                       this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);\r
+                       this.deselectAll();\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* Event executed when a date is selected in the calendar widget.\r
+* @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] ]\r
+* @deprecated Event handlers for this event should be susbcribed to selectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onSelect = function(selected) { };\r
+\r
+/**\r
+* Event executed before a date is deselected in the calendar widget.\r
+* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onBeforeDeselect = function() { };\r
+\r
+/**\r
+* Event executed when a date is deselected in the calendar widget.\r
+* @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] ]\r
+* @deprecated Event handlers for this event should be susbcribed to deselectEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onDeselect = function(deselected) { };\r
+\r
+/**\r
+* Event executed when the user navigates to a different calendar page.\r
+* @deprecated Event handlers for this event should be susbcribed to changePageEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onChangePage = function() {\r
+       this.render();\r
+};\r
+\r
+/**\r
+* Event executed when the calendar widget is rendered.\r
+* @deprecated Event handlers for this event should be susbcribed to renderEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onRender = function() { };\r
+\r
+/**\r
+* Event executed when the calendar widget is reset to its original state.\r
+* @deprecated Event handlers for this event should be susbcribed to resetEvemt.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onReset = function() { this.render(); };\r
+\r
+/**\r
+* Event executed when the calendar widget is completely cleared to the current month with no selections.\r
+* @deprecated Event handlers for this event should be susbcribed to clearEvent.\r
+*/\r
+YAHOO.widget.Calendar.prototype.onClear = function() { this.render(); };\r
+\r
+/**\r
+* Validates the calendar widget. This method has no default implementation\r
+* and must be extended by subclassing the widget.\r
+* @return      Should return true if the widget validates, and false if\r
+* it doesn't.\r
+* @type Boolean\r
+*/\r
+YAHOO.widget.Calendar.prototype.validate = function() { return true; };\r
+\r
+// END EVENT HANDLERS\r
+\r
+// BEGIN DATE PARSE METHODS\r
+\r
+/**\r
+* Converts a date string to a date field array\r
+* @private\r
+* @param       {String}        sDate                   Date string. Valid formats are mm/dd and mm/dd/yyyy.\r
+* @return                              A date field array representing the string passed to the method\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseDate = function(sDate) {\r
+       var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);\r
+       var rArray;\r
+\r
+       if (aDate.length == 2) {\r
+               rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];\r
+               rArray.type = YAHOO.widget.Calendar.MONTH_DAY;\r
+       } else {\r
+               rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];\r
+               rArray.type = YAHOO.widget.Calendar.DATE;\r
+       }\r
+\r
+       for (var i=0;i<rArray.length;i++) {\r
+               rArray[i] = parseInt(rArray[i], 10);\r
+       }\r
+\r
+       return rArray;\r
+};\r
+\r
+/**\r
+* Converts a multi or single-date string to an array of date field arrays\r
+* @private\r
+* @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\r
+* @return                                                      An array of date field arrays\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseDates = function(sDates) {\r
+       var aReturn = [];\r
+\r
+       var aDates = sDates.split(this.Locale.DATE_DELIMITER);\r
+\r
+       for (var d=0;d<aDates.length;++d) {\r
+               var sDate = aDates[d];\r
+\r
+               if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {\r
+                       // This is a range\r
+                       var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);\r
+\r
+                       var dateStart = this._parseDate(aRange[0]);\r
+                       var dateEnd = this._parseDate(aRange[1]);\r
+\r
+                       var fullRange = this._parseRange(dateStart, dateEnd);\r
+                       aReturn = aReturn.concat(fullRange);\r
+               } else {\r
+                       // This is not a range\r
+                       var aDate = this._parseDate(sDate);\r
+                       aReturn.push(aDate);\r
+               }\r
+       }\r
+       return aReturn;\r
+};\r
+\r
+/**\r
+* Converts a date range to the full list of included dates\r
+* @private\r
+* @param       {Number[]}      startDate       Date field array representing the first date in the range\r
+* @param       {Number[]}      endDate         Date field array representing the last date in the range\r
+* @return                                                      An array of date field arrays\r
+* @type Array[](Number[])\r
+*/\r
+YAHOO.widget.Calendar.prototype._parseRange = function(startDate, endDate) {\r
+       var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);\r
+       var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);\r
+       var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);\r
+\r
+       var results = [];\r
+       results.push(startDate);\r
+       while (dCurrent.getTime() <= dEnd.getTime()) {\r
+               results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);\r
+               dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);\r
+       }\r
+       return results;\r
+};\r
+\r
+// END DATE PARSE METHODS\r
+\r
+// BEGIN RENDERER METHODS\r
+\r
+/**\r
+* Resets the render stack of the current calendar to its original pre-render value.\r
+*/\r
+YAHOO.widget.Calendar.prototype.resetRenderers = function() {\r
+       this.renderStack = this._renderStack.concat();\r
+};\r
+\r
+/**\r
+* Clears the inner HTML, CSS class and style information from the specified cell.\r
+* @method clearElement\r
+* @param       {HTMLTableCellElement}  The cell to clear\r
+*/\r
+YAHOO.widget.Calendar.prototype.clearElement = function(cell) {\r
+       cell.innerHTML = "&#160;";\r
+       cell.className="";\r
+};\r
+\r
+/**\r
+* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the conditions specified in the date string for this renderer.\r
+* @method addRenderer\r
+* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
+*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addRenderer = function(sDates, fnRender) {\r
+       var aDates = this._parseDates(sDates);\r
+       for (var i=0;i<aDates.length;++i) {\r
+               var aDate = aDates[i];\r
+\r
+               if (aDate.length == 2) { // this is either a range or a month/day combo\r
+                       if (aDate[0] instanceof Array) { // this is a range\r
+                               this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);\r
+                       } else { // this is a month/day combo\r
+                               this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);\r
+                       }\r
+               } else if (aDate.length == 3) {\r
+                       this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* The private method used for adding cell renderers to the local render stack.\r
+* This method is called by other methods that set the renderer type prior to the method call.\r
+* @method _addRenderer\r
+* @private\r
+* @param       {String}        type            The type string that indicates the type of date renderer being added.\r
+*                                                                      Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,\r
+*                                                                      YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH\r
+* @param       {Array}         aDates          An array of dates used to construct the renderer. The format varies based\r
+*                                                                      on the renderer type\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype._addRenderer = function(type, aDates, fnRender) {\r
+       var add = [type,aDates,fnRender];\r
+       this.renderStack.unshift(add);\r
+       this._renderStack = this.renderStack.concat();\r
+};\r
+\r
+/**\r
+* Adds a month to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the month passed to this method.\r
+* @method addMonthRenderer\r
+* @param       {Number}        month           The month (1-12) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addMonthRenderer = function(month, fnRender) {\r
+       this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);\r
+};\r
+\r
+/**\r
+* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the weekday passed to this method.\r
+* @method addWeekdayRenderer\r
+* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
+*/\r
+YAHOO.widget.Calendar.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
+       this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);\r
+};\r
+\r
+// END RENDERER METHODS\r
+\r
+// BEGIN CSS METHODS\r
+\r
+/**\r
+* Removes all styles from all body cells in the current calendar table.\r
+* @method clearAllBodyCellStyles\r
+* @param       {style}         The CSS class name to remove from all calendar body cells\r
+*/\r
+YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {\r
+       for (var c=0;c<this.cells.length;++c) {\r
+               YAHOO.util.Dom.removeClass(this.cells[c],style);\r
+       }\r
+};\r
+\r
+// END CSS METHODS\r
+\r
+// BEGIN GETTER/SETTER METHODS\r
+/**\r
+* Sets the calendar's month explicitly\r
+* @method setMonth\r
+* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)\r
+*/\r
+YAHOO.widget.Calendar.prototype.setMonth = function(month) {\r
+       var current = this.cfg.getProperty("pagedate");\r
+       current.setMonth(month);\r
+       this.cfg.setProperty("pagedate", current);\r
+};\r
+\r
+/**\r
+* Sets the calendar's year explicitly.\r
+* @method setYear\r
+* @param {Number}      year            The numeric 4-digit year\r
+*/\r
+YAHOO.widget.Calendar.prototype.setYear = function(year) {\r
+       var current = this.cfg.getProperty("pagedate");\r
+       current.setFullYear(year);\r
+       this.cfg.setProperty("pagedate", current);\r
+};\r
+\r
+/**\r
+* Gets the list of currently selected dates from the calendar.\r
+* @method getSelectedDates\r
+* @return {Date[]} An array of currently selected JavaScript Date objects.\r
+*/\r
+YAHOO.widget.Calendar.prototype.getSelectedDates = function() {\r
+       var returnDates = [];\r
+       var selected = this.cfg.getProperty("selected");\r
+\r
+       for (var d=0;d<selected.length;++d) {\r
+               var dateArray = selected[d];\r
+\r
+               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
+               returnDates.push(date);\r
+       }\r
+\r
+       returnDates.sort( function(a,b) { return a-b; } );\r
+       return returnDates;\r
+};\r
+\r
+/// END GETTER/SETTER METHODS ///\r
+\r
+/**\r
+* Hides the Calendar's outer container from view.\r
+* @method hide\r
+*/\r
+YAHOO.widget.Calendar.prototype.hide = function() {\r
+       this.oDomContainer.style.display = "none";\r
+};\r
+\r
+/**\r
+* Shows the Calendar's outer container.\r
+* @method show\r
+*/\r
+YAHOO.widget.Calendar.prototype.show = function() {\r
+       this.oDomContainer.style.display = "block";\r
+};\r
+\r
+/**\r
+* Returns a string representing the current browser.\r
+* @property browser\r
+* @type String\r
+*/\r
+YAHOO.widget.Calendar.prototype.browser = function() {\r
+                       var ua = navigator.userAgent.toLowerCase();\r
+                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)\r
+                                        return 'opera';\r
+                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7\r
+                                        return 'ie7';\r
+                                 } else if (ua.indexOf('msie') !=-1) { // IE\r
+                                        return 'ie';\r
+                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")\r
+                                        return 'safari';\r
+                                 } else if (ua.indexOf('gecko') != -1) { // Gecko\r
+                                        return 'gecko';\r
+                                 } else {\r
+                                        return false;\r
+                                 }\r
+                       }();\r
+/**\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     A string representation of the Calendar object.\r
+*/\r
+YAHOO.widget.Calendar.prototype.toString = function() {\r
+       return "Calendar " + this.id;\r
+};\r
+\r
+/**\r
+* @namespace YAHOO.widget\r
+* @class Calendar_Core\r
+* @extends YAHOO.widget.Calendar\r
+* @deprecated The old Calendar_Core class is no longer necessary.\r
+*/\r
+YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;\r
+\r
+YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;\r
+\r
+/**\r
+* YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates\r
+* the ability to have multi-page calendar views that share a single dataset and are\r
+* dependent on each other.\r
+*\r
+* The calendar group instance will refer to each of its elements using a 0-based index.\r
+* For example, to construct the placeholder for a calendar group widget with id "cal1" and\r
+* containerId of "cal1Container", the markup would be as follows:\r
+*      <xmp>\r
+*              <div id="cal1Container_0"></div>\r
+*              <div id="cal1Container_1"></div>\r
+*      </xmp>\r
+* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.\r
+* @namespace YAHOO.widget\r
+* @class CalendarGroup\r
+* @constructor\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.CalendarGroup = function(id, containerId, config) {\r
+       if (arguments.length > 0) {\r
+               this.init(id, containerId, config);\r
+       }\r
+};\r
+\r
+/**\r
+* Initializes the calendar group. All subclasses must call this method in order for the\r
+* group to be initialized properly.\r
+* @method init\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {\r
+       this.initEvents();\r
+       this.initStyles();\r
+\r
+       /**\r
+       * The collection of Calendar pages contained within the CalendarGroup\r
+       * @property pages\r
+       * @type YAHOO.widget.Calendar[]\r
+       */\r
+       this.pages = [];\r
+\r
+       /**\r
+       * The unique id associated with the CalendarGroup\r
+       * @property id\r
+       * @type String\r
+       */\r
+       this.id = id;\r
+\r
+       /**\r
+       * The unique id associated with the CalendarGroup container\r
+       * @property containerId\r
+       * @type String\r
+       */\r
+       this.containerId = containerId;\r
+\r
+       /**\r
+       * The outer containing element for the CalendarGroup\r
+       * @property oDomContainer\r
+       * @type HTMLElement\r
+       */\r
+       this.oDomContainer = document.getElementById(containerId);\r
+\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);\r
+       YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);\r
+\r
+       /**\r
+       * The Config object used to hold the configuration variables for the CalendarGroup\r
+       * @property cfg\r
+       * @type YAHOO.util.Config\r
+       */\r
+       this.cfg = new YAHOO.util.Config(this);\r
+\r
+       /**\r
+       * The local object which contains the CalendarGroup's options\r
+       * @property Options\r
+       * @type Object\r
+       */\r
+       this.Options = {};\r
+\r
+       /**\r
+       * The local object which contains the CalendarGroup's locale settings\r
+       * @property Locale\r
+       * @type Object\r
+       */\r
+       this.Locale = {};\r
+\r
+       this.setupConfig();\r
+\r
+       if (config) {\r
+               this.cfg.applyConfig(config, true);\r
+       }\r
+\r
+       this.cfg.fireQueue();\r
+\r
+       // OPERA HACK FOR MISWRAPPED FLOATS\r
+       if (this.browser == "opera"){\r
+               var fixWidth = function() {\r
+                       var startW = this.oDomContainer.offsetWidth;\r
+                       var w = 0;\r
+                       for (var p=0;p<this.pages.length;++p) {\r
+                               var cal = this.pages[p];\r
+                               w += cal.oDomContainer.offsetWidth;\r
+                       }\r
+                       if (w > 0) {\r
+                               this.oDomContainer.style.width = w + "px";\r
+                       }\r
+               };\r
+               this.renderEvent.subscribe(fixWidth,this,true);\r
+       }\r
+};\r
+\r
+\r
+YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {\r
+       /**\r
+       * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.\r
+       * @config pages\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("pages", { value:2, validator:this.cfg.checkNumber, handler:this.configPages } );\r
+\r
+       /**\r
+       * The month/year representing the current visible Calendar date (mm/yyyy)\r
+       * @config pagedate\r
+       * @type String\r
+       * @default today's date\r
+       */\r
+       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );\r
+\r
+       /**\r
+       * The date or range of dates representing the current Calendar selection\r
+       * @config selected\r
+       * @type String\r
+       * @default []\r
+       */\r
+       this.cfg.addProperty("selected", { value:[], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The title to display above the CalendarGroup's month header\r
+       * @config title\r
+       * @type String\r
+       * @default ""\r
+       */\r
+       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );\r
+\r
+       /**\r
+       * Whether or not a close button should be displayed for this CalendarGroup\r
+       * @config close\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("close", { value:false, handler:this.configClose } );\r
+\r
+       /**\r
+       * 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.\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("iframe", { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The minimum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config mindate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("mindate", { value:null, handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The maximum selectable date in the current Calendar (mm/dd/yyyy)\r
+       * @config maxdate\r
+       * @type String\r
+       * @default null\r
+       */\r
+       this.cfg.addProperty("maxdate", { value:null, handler:this.delegateConfig  } );\r
+\r
+       // Options properties\r
+\r
+       /**\r
+       * True if the Calendar should allow multiple selections. False by default.\r
+       * @config MULTI_SELECT\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The weekday the week begins on. Default is 0 (Sunday).\r
+       * @config START_WEEKDAY\r
+       * @type number\r
+       * @default 0\r
+       */\r
+       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );\r
+\r
+       /**\r
+       * True if the Calendar should show weekday labels. True by default.\r
+       * @config SHOW_WEEKDAYS\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row headers. False by default.\r
+       * @config SHOW_WEEK_HEADER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should show week row footers. False by default.\r
+       * @config SHOW_WEEK_FOOTER\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * True if the Calendar should suppress weeks that are not a part of the current month. False by default.\r
+       * @config HIDE_BLANK_WEEKS\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
+       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_LEFT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The image that should be used for the left navigation arrow.\r
+       * @config NAV_ARROW_RIGHT\r
+       * @type String\r
+       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"\r
+       */\r
+       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.delegateConfig } );\r
+\r
+       // Locale properties\r
+\r
+       /**\r
+       * The short month labels for the current locale.\r
+       * @config MONTHS_SHORT\r
+       * @type String[]\r
+       * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]\r
+       */\r
+       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The long month labels for the current locale.\r
+       * @config MONTHS_LONG\r
+       * @type String[]\r
+       * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"\r
+       */\r
+       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The 1-character weekday labels for the current locale.\r
+       * @config WEEKDAYS_1CHAR\r
+       * @type String[]\r
+       * @default ["S", "M", "T", "W", "T", "F", "S"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The short weekday labels for the current locale.\r
+       * @config WEEKDAYS_SHORT\r
+       * @type String[]\r
+       * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The medium weekday labels for the current locale.\r
+       * @config WEEKDAYS_MEDIUM\r
+       * @type String[]\r
+       * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The long weekday labels for the current locale.\r
+       * @config WEEKDAYS_LONG\r
+       * @type String[]\r
+       * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]\r
+       */\r
+       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The setting that determines which length of month labels should be used. Possible values are "short" and "long".\r
+       * @config LOCALE_MONTHS\r
+       * @type String\r
+       * @default "long"\r
+       */\r
+       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".\r
+       * @config LOCALE_WEEKDAYS\r
+       * @type String\r
+       * @default "short"\r
+       */\r
+       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit individual dates in a date string passed to various Calendar functions.\r
+       * @config DATE_DELIMITER\r
+       * @type String\r
+       * @default ","\r
+       */\r
+       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit date fields in a date string passed to various Calendar functions.\r
+       * @config DATE_FIELD_DELIMITER\r
+       * @type String\r
+       * @default "/"\r
+       */\r
+       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The value used to delimit date ranges in a date string passed to various Calendar functions.\r
+       * @config DATE_RANGE_DELIMITER\r
+       * @type String\r
+       * @default "-"\r
+       */\r
+       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.delegateConfig } );\r
+\r
+       /**\r
+       * The position of the month in a month/year date string\r
+       * @config MY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/year date string\r
+       * @config MY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day date string\r
+       * @config MD_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/year date string\r
+       * @config MD_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the month in a month/day/year date string\r
+       * @config MDY_MONTH_POSITION\r
+       * @type Number\r
+       * @default 1\r
+       */\r
+       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the day in a month/day/year date string\r
+       * @config MDY_DAY_POSITION\r
+       * @type Number\r
+       * @default 2\r
+       */\r
+       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The position of the year in a month/day/year date string\r
+       * @config MDY_YEAR_POSITION\r
+       * @type Number\r
+       * @default 3\r
+       */\r
+       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.delegateConfig, validator:this.cfg.checkNumber } );\r
+\r
+};\r
+\r
+/**\r
+* Initializes CalendarGroup's built-in CustomEvents\r
+* @method initEvents\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.initEvents = function() {\r
+       var me = this;\r
+\r
+       /**\r
+       * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents\r
+       * @method sub\r
+       * @private\r
+       * @param {Function} fn  The function to subscribe to this CustomEvent\r
+       * @param {Object}       obj     The CustomEvent's scope object\r
+       * @param {Boolean}      bOverride       Whether or not to apply scope correction\r
+       */\r
+       var sub = function(fn, obj, bOverride) {\r
+               for (var p=0;p<me.pages.length;++p) {\r
+                       var cal = me.pages[p];\r
+                       cal[this.type + "Event"].subscribe(fn, obj, bOverride);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents\r
+       * @method unsub\r
+       * @private\r
+       * @param {Function} fn  The function to subscribe to this CustomEvent\r
+       * @param {Object}       obj     The CustomEvent's scope object\r
+       */\r
+       var unsub = function(fn, obj) {\r
+               for (var p=0;p<me.pages.length;++p) {\r
+                       var cal = me.pages[p];\r
+                       cal[this.type + "Event"].unsubscribe(fn, obj);\r
+               }\r
+       };\r
+\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeSelectEvent\r
+       */\r
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");\r
+       this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
-* when a date cell matches the weekday passed to this method.\r
-* @param       {Integer}       weekay          The weekday (1-7) to associate with this renderer\r
-* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
-       this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[weekday],fnRender);\r
-};\r
-//// END RENDERER METHODS ////\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event selectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.selectEvent = new YAHOO.util.CustomEvent("select");\r
+       this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;\r
 \r
-//// BEGIN CSS METHODS ////\r
+       /**\r
+       * Fired before a selection is made\r
+       * @event beforeDeselectEvent\r
+       */\r
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");\r
+       this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Sets the specified array of CSS classes into the referenced element\r
-* @param       {HTMLElement}   element         The element to set the CSS classes into\r
-* @param       {String[]}              aStyles         An array of CSS class names\r
-*/\r
-YAHOO.widget.Calendar_Core.setCssClasses = function(element, aStyles) {\r
-       element.className = "";\r
-       var className = aStyles.join(" ");\r
-       element.className = className;\r
-};\r
+       /**\r
+       * Fired when a selection is made\r
+       * @event deselectEvent\r
+       * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].\r
+       */\r
+       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");\r
+       this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Removes all styles from all body cells in the current calendar table.\r
-* @param       {style}         The CSS class name to remove from all calendar body cells\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles = function(style) {\r
-       for (var c=0;c<this.cells.length;++c) {\r
-               YAHOO.util.Dom.removeClass(this.cells[c],style);\r
-       }\r
-};\r
+       /**\r
+       * Fired when the Calendar page is changed\r
+       * @event changePageEvent\r
+       */\r
+       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");\r
+       this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;\r
 \r
-//// END CSS METHODS ////\r
+       /**\r
+       * Fired before the Calendar is rendered\r
+       * @event beforeRenderEvent\r
+       */\r
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+       this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;\r
 \r
-//// BEGIN GETTER/SETTER METHODS ////\r
-/**\r
-* Sets the calendar's month explicitly.\r
-* @param {Integer}     month           The numeric month, from 1 (January) to 12 (December)\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setMonth = function(month) {\r
-       this.pageDate.setMonth(month);\r
-};\r
+       /**\r
+       * Fired when the Calendar is rendered\r
+       * @event renderEvent\r
+       */\r
+       this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+       this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;\r
+\r
+       /**\r
+       * Fired when the Calendar is reset\r
+       * @event resetEvent\r
+       */\r
+       this.resetEvent = new YAHOO.util.CustomEvent("reset");\r
+       this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;\r
+\r
+       /**\r
+       * Fired when the Calendar is cleared\r
+       * @event clearEvent\r
+       */\r
+       this.clearEvent = new YAHOO.util.CustomEvent("clear");\r
+       this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;\r
 \r
-/**\r
-* Sets the calendar's year explicitly.\r
-* @param {Integer}     year            The numeric 4-digit year\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.setYear = function(year) {\r
-       this.pageDate.setFullYear(year);\r
 };\r
 \r
 /**\r
-* Gets the list of currently selected dates from the calendar.\r
-* @return      An array of currently selected JavaScript Date objects.\r
-* @type Date[]\r
+* The default Config handler for the "pages" property\r
+* @method configPages\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
-YAHOO.widget.Calendar_Core.prototype.getSelectedDates = function() {\r
-       var returnDates = new Array();\r
-\r
-       for (var d=0;d<this.selectedDates.length;++d) {\r
-               var dateArray = this.selectedDates[d];\r
+YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {\r
+       var pageCount = args[0];\r
 \r
-               var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
-               returnDates.push(date);\r
-       }\r
+       for (var p=0;p<pageCount;++p) {\r
+               var calId = this.id + "_" + p;\r
+               var calContainerId = this.containerId + "_" + p;\r
 \r
-       returnDates.sort();\r
-       return returnDates;\r
-};\r
+               var childConfig = this.cfg.getConfig();\r
+               childConfig.close = false;\r
+               childConfig.title = false;\r
 \r
-/// END GETTER/SETTER METHODS ///\r
+               var cal = this.constructChild(calId, calContainerId, childConfig);\r
+               var caldate = cal.cfg.getProperty("pagedate");\r
+               caldate.setMonth(caldate.getMonth()+p);\r
+               cal.cfg.setProperty("pagedate", caldate);\r
 \r
-/**\r
-* Returns a string representing the current browser.\r
-* @type String\r
-*/\r
-YAHOO.widget.Calendar_Core._getBrowser = function() {\r
-  /**\r
-   * UserAgent\r
-   * @private\r
-   * @type String\r
-   */\r
-  var ua = navigator.userAgent.toLowerCase();\r
-  \r
-  if (ua.indexOf('opera')!=-1) // Opera (check first in case of spoof)\r
-        return 'opera';\r
-  else if (ua.indexOf('msie')!=-1) // IE\r
-        return 'ie';\r
-  else if (ua.indexOf('safari')!=-1) // Safari (check before Gecko because it includes "like Gecko")\r
-        return 'safari';\r
-  else if (ua.indexOf('gecko') != -1) // Gecko\r
-        return 'gecko';\r
- else\r
-  return false;\r
-}\r
+               YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);\r
+               YAHOO.util.Dom.addClass(cal.oDomContainer, "groupcal");\r
 \r
-/**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/\r
-YAHOO.widget.Calendar_Core.prototype.toString = function() {\r
-       return "Calendar_Core " + this.id;\r
-}\r
+               if (p===0) {\r
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, "first");\r
+               }\r
 \r
-YAHOO.widget.Cal_Core = YAHOO.widget.Calendar_Core;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+               if (p==(pageCount-1)) {\r
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, "last");\r
+               }\r
 \r
-/**\r
-* @class\r
-* Calendar is the default implementation of the YAHOO.widget.Calendar_Core base class.\r
-* This class is the UED-approved version of the calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for YAHOO.widget.Calendar_Core.\r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
-\r
-YAHOO.widget.Calendar.prototype = new YAHOO.widget.Calendar_Core();\r
-\r
-YAHOO.widget.Calendar.prototype.buildShell = function() {\r
-       this.border = document.createElement("DIV");\r
-       this.border.className =  this.Style.CSS_CONTAINER;\r
-       \r
-       this.table = document.createElement("TABLE");\r
-       this.table.cellSpacing = 0;     \r
-       \r
-       YAHOO.widget.Calendar_Core.setCssClasses(this.table, [this.Style.CSS_CALENDAR]);\r
-\r
-       this.border.id = this.id;\r
-       \r
-       this.buildShellHeader();\r
-       this.buildShellBody();\r
-       this.buildShellFooter();\r
-};\r
-\r
-YAHOO.widget.Calendar.prototype.renderShell = function() {\r
-       this.border.appendChild(this.table);\r
-       this.oDomContainer.appendChild(this.border);\r
-       this.shellRendered = true;\r
-};\r
-\r
-YAHOO.widget.Calendar.prototype.renderHeader = function() {\r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       if (this.linkLeft) {\r
-               YAHOO.util.Event.removeListener(this.linkLeft, "mousedown", this.previousMonth);\r
-       }\r
-       this.linkLeft = document.createElement("A");\r
-       this.linkLeft.innerHTML = "&nbsp;";\r
-       YAHOO.util.Event.addListener(this.linkLeft, "mousedown", this.previousMonth, this, true);\r
-       this.linkLeft.style.backgroundImage =  "url(" + this.Options.NAV_ARROW_LEFT + ")";\r
-       this.linkLeft.className = this.Style.CSS_NAV_LEFT;\r
-       \r
-       if (this.linkRight) {\r
-               YAHOO.util.Event.removeListener(this.linkRight, "mousedown", this.nextMonth);\r
-       }\r
-       this.linkRight = document.createElement("A");\r
-       this.linkRight.innerHTML = "&nbsp;";\r
-       YAHOO.util.Event.addListener(this.linkRight, "mousedown", this.nextMonth, this, true);\r
-       this.linkRight.style.backgroundImage = "url(" + this.Options.NAV_ARROW_RIGHT + ")";\r
-       this.linkRight.className = this.Style.CSS_NAV_RIGHT;\r
-       \r
-       headerContainer.appendChild(this.linkLeft);\r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       headerContainer.appendChild(this.linkRight);\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
-};\r
-\r
-YAHOO.widget.Cal = YAHOO.widget.Calendar;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+               cal.parent = this;\r
+               cal.index = p;\r
 \r
-/**\r
-* @class\r
-* <p>YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar_Core. This class facilitates\r
-* the ability to have multi-page calendar views that share a single dataset and are\r
-* dependent on each other.</p>\r
-* \r
-* <p>The calendar group instance will refer to each of its elements using a 0-based index.\r
-* For example, to construct the placeholder for a calendar group widget with id "cal1" and\r
-* containerId of "cal1Container", the markup would be as follows:\r
-*      <xmp>\r
-*              <div id="cal1Container_0"></div>\r
-*              <div id="cal1Container_1"></div>\r
-*      </xmp>\r
-* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.\r
-* </p>\r
-* @constructor\r
-* @param {Integer}             pageCount       The number of pages that this calendar should display.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}      containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.CalendarGroup = function(pageCount, id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0) {\r
-               this.init(pageCount, id, containerId, monthyear, selected);\r
+               this.pages[this.pages.length] = cal;\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Initializes the calendar group. All subclasses must call this method in order for the\r
-* group to be initialized properly.\r
-* @param {Integer}             pageCount       The number of pages that this calendar should display.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}              containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.CalendarGroup.prototype.init = function(pageCount, id, containerId, monthyear, selected) {\r
-       this.id = id;\r
-       this.selectedDates = new Array();\r
-       this.containerId = containerId;\r
-       \r
-       this.pageCount = pageCount;\r
+* The default Config handler for the "pagedate" property\r
+* @method configPageDate\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {\r
+       var val = args[0];\r
 \r
-       this.pages = new Array();\r
+       for (var p=0;p<this.pages.length;++p) {\r
+               var cal = this.pages[p];\r
+               cal.cfg.setProperty("pagedate", val);\r
+               var calDate = cal.cfg.getProperty("pagedate");\r
+               calDate.setMonth(calDate.getMonth()+p);\r
+       }\r
+};\r
 \r
-       for (var p=0;p<pageCount;++p) {\r
-               var cal = this.constructChild(id + "_" + p, this.containerId + "_" + p , monthyear, selected);\r
-                               \r
-               cal.parent = this;\r
-               \r
-               cal.index = p;\r
+/**\r
+* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children\r
+* @method delegateConfig\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj) {\r
+       var val = args[0];\r
+       var cal;\r
 \r
-               cal.pageDate.setMonth(cal.pageDate.getMonth()+p);\r
-               cal._pageDate = new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());\r
-               this.pages.push(cal);\r
+       for (var p=0;p<this.pages.length;p++) {\r
+               cal = this.pages[p];\r
+               cal.cfg.setProperty(type, val);\r
        }\r
-       \r
-       this.doNextMonth = function(e, calGroup) {\r
-               calGroup.nextMonth();\r
-       };\r
-       \r
-       this.doPreviousMonth = function(e, calGroup) {\r
-               calGroup.previousMonth();\r
-       };\r
 };\r
 \r
+\r
 /**\r
 * Adds a function to all child Calendars within this CalendarGroup.\r
+* @method setChildFunction\r
 * @param {String}              fnName          The name of the function\r
 * @param {Function}            fn                      The function to apply to each Calendar page object\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {\r
-       for (var p=0;p<this.pageCount;++p) {\r
+       var pageCount = this.cfg.getProperty("pages");\r
+\r
+       for (var p=0;p<pageCount;++p) {\r
                this.pages[p][fnName] = fn;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Calls a function within all child Calendars within this CalendarGroup.\r
+* @method callChildFunction\r
 * @param {String}              fnName          The name of the function\r
 * @param {Array}               args            The arguments to pass to the function\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {\r
-       for (var p=0;p<this.pageCount;++p) {\r
+       var pageCount = this.cfg.getProperty("pages");\r
+\r
+       for (var p=0;p<pageCount;++p) {\r
                var page = this.pages[p];\r
                if (page[fnName]) {\r
                        var fn = page[fnName];\r
                        fn.call(page, args);\r
                }\r
-       }       \r
-}\r
+       }\r
+};\r
 \r
 /**\r
 * Constructs a child calendar. This method can be overridden if a subclassed version of the default\r
 * calendar is to be used.\r
-* @param {String}              id                      The id of the element that will be inserted into the DOM.\r
-* @param {String}              containerId     The id of the container element that the calendar will be inserted into.\r
-* @param {String}              monthyear       The month/year string used to set the current calendar page\r
-* @param {String}              selected        A string of date values formatted using the date parser. The built-in\r
-                                                                       default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                                       MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                                       Any combination of these can be combined by delimiting the string with\r
-                                                                       commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-* @return                                                      The YAHOO.widget.Calendar_Core instance that is constructed\r
-* @type YAHOO.widget.Calendar_Core\r
+* @method constructChild\r
+* @param {String}      id                      The id of the table element that will represent the calendar widget\r
+* @param {String}      containerId     The id of the container div element that will wrap the calendar table\r
+* @param {Object}      config          The configuration object containing the Calendar's arguments\r
+* @return {YAHOO.widget.Calendar}      The YAHOO.widget.Calendar instance that is constructed\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,monthyear,selected) {\r
-       return new YAHOO.widget.Calendar_Core(id,containerId,monthyear,selected);\r
+YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,config) {\r
+       var container = document.getElementById(containerId);\r
+       if (! container) {\r
+               container = document.createElement("div");\r
+               container.id = containerId;\r
+               this.oDomContainer.appendChild(container);\r
+       }\r
+       return new YAHOO.widget.Calendar(id,containerId,config);\r
 };\r
 \r
 \r
 /**\r
 * Sets the calendar group's month explicitly. This month will be set into the first\r
+* @method setMonth\r
 * page of the multi-page calendar, and all other months will be iterated appropriately.\r
-* @param {Integer}     month           The numeric month, from 1 (January) to 12 (December)\r
+* @param {Number}      month           The numeric month, from 0 (January) to 11 (December)\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.setMonth(month+p);\r
        }\r
@@ -2347,90 +3853,114 @@ YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
 \r
 /**\r
 * Sets the calendar group's year explicitly. This year will be set into the first\r
+* @method setYear\r
 * page of the multi-page calendar, and all other months will be iterated appropriately.\r
-* @param {Integer}     year            The numeric 4-digit year\r
+* @param {Number}      year            The numeric 4-digit year\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               if ((cal.pageDate.getMonth()+1) == 1 && p>0)\r
-               {\r
+               var pageDate = cal.cfg.getProperty("pageDate");\r
+\r
+               if ((pageDate.getMonth()+1) == 1 && p>0) {\r
                        year+=1;\r
                }\r
                cal.setYear(year);\r
        }\r
 };\r
-\r
 /**\r
 * Calls the render function of all child calendars within the group.\r
+* @method render\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.render = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       this.renderHeader();\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.render();\r
        }\r
+       this.renderFooter();\r
 };\r
 \r
 /**\r
-* Calls the select function of all child calendars within the group.\r
+* Selects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once selection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method select\r
+* @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.select = function(date) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.select(date);\r
+               cal.select(date);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the selectCell function of all child calendars within the group.\r
+* Selects a date on the current calendar by referencing the index of the cell that should be selected.\r
+* This method is used to easily select a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is applied to the cell directly.\r
+* @method selectCell\r
+* @param       {Number}        cellIndex       The index of the cell to select in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.selectCell(cellIndex);\r
+               cal.selectCell(cellIndex);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselect function of all child calendars within the group.\r
+* Deselects a date or a collection of dates on the current calendar. This method, by default,\r
+* does not call the render method explicitly. Once deselection has completed, render must be\r
+* called for the changes to be reflected visually.\r
+* @method deselect\r
+* @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are\r
+*                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).\r
+*                                                              Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).\r
+*                                                              This method can also take a JavaScript Date object or an array of Date objects.\r
+* @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselect = function(date) {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.deselect(date);\r
+               cal.deselect(date);\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselectAll function of all child calendars within the group.\r
+* Deselects all dates on the current calendar.\r
+* @method deselectAll\r
+* @return {Date[]}             Array of JavaScript Date objects representing all individual dates that are currently selected.\r
+*                                              Assuming that this function executes properly, the return value should be an empty array.\r
+*                                              However, the empty array is returned for the sake of being able to check the selection status\r
+*                                              of the calendar.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {\r
-       var ret;\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
-               ret = cal.deselectAll();\r
+               cal.deselectAll();\r
        }\r
-       return ret;\r
+       return this.getSelectedDates();\r
 };\r
 \r
 /**\r
-* Calls the deselectAll function of all child calendars within the group.\r
+* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.\r
+* This method is used to easily deselect a single cell (usually with a mouse click) without having to do\r
+* a full render. The selected style is removed from the cell directly.\r
+* @method deselectCell\r
+* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar.\r
+* @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.deselectCell(cellIndex);\r
        }\r
@@ -2438,439 +3968,272 @@ YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
 };\r
 \r
 /**\r
-* Calls the reset function of all child calendars within the group.\r
+* Resets the calendar widget to the originally selected month and year, and\r
+* sets the calendar to the initial selection(s).\r
+* @method reset\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.reset = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.reset();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the clear function of all child calendars within the group.\r
+* Clears the selected dates in the current calendar widget and sets the calendar\r
+* to the current month and year.\r
+* @method clear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.clear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.clear();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the nextMonth function of all child calendars within the group.\r
+* Navigates to the next month page in the calendar widget.\r
+* @method nextMonth\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.nextMonth = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.nextMonth();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the previousMonth function of all child calendars within the group.\r
+* Navigates to the previous month page in the calendar widget.\r
+* @method previousMonth\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.previousMonth = function() {\r
-       for (var p=this.pages.length-1;p>=0;--p)\r
-       {\r
+       for (var p=this.pages.length-1;p>=0;--p) {\r
                var cal = this.pages[p];\r
                cal.previousMonth();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the nextYear function of all child calendars within the group.\r
+* Navigates to the next year in the currently selected month in the calendar widget.\r
+* @method nextYear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.nextYear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.nextYear();\r
        }\r
 };\r
 \r
 /**\r
-* Calls the previousYear function of all child calendars within the group.\r
+* Navigates to the previous year in the currently selected month in the calendar widget.\r
+* @method previousYear\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.previousYear = function() {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.previousYear();\r
        }\r
 };\r
 \r
-/**\r
-* Synchronizes the data values for all child calendars within the group. If the sync\r
-* method is called passing in the caller object, the values of all children will be set\r
-* to the values of the caller. If the argument is ommitted, the values from all children\r
-* will be combined into one distinct list and set into each child.\r
-* @param       {YAHOO.widget.Calendar_Core}    caller          The YAHOO.widget.Calendar_Core that is initiating the call to sync().\r
-* @return                                                              Array of selected dates, in JavaScript Date object form.\r
-* @type Date[]\r
-*/\r
-YAHOO.widget.CalendarGroup.prototype.sync = function(caller) {\r
-       var calendar;\r
-\r
-       if (caller)\r
-       {\r
-               this.selectedDates = caller.selectedDates.concat();\r
-       } else {\r
-               var hash = new Object();\r
-               var combinedDates = new Array();\r
-\r
-               for (var p=0;p<this.pages.length;++p)\r
-               {\r
-                       calendar = this.pages[p];\r
-\r
-                       var values = calendar.selectedDates;\r
-\r
-                       for (var v=0;v<values.length;++v)\r
-                       {\r
-                               var valueArray = values[v];\r
-                               hash[valueArray.toString()] = valueArray;\r
-                       }\r
-               }\r
-\r
-               for (var val in hash)\r
-               {\r
-                       combinedDates[combinedDates.length]=hash[val];\r
-               }\r
-               \r
-               this.selectedDates = combinedDates.concat();\r
-       }\r
-\r
-       // Set all the values into the children\r
-       for (p=0;p<this.pages.length;++p)\r
-       {\r
-               calendar = this.pages[p];\r
-               if (! calendar.Options.MULTI_SELECT) {\r
-                       calendar.clearAllBodyCellStyles(calendar.Config.Style.CSS_CELL_SELECTED);\r
-               }\r
-               calendar.selectedDates = this.selectedDates.concat();\r
-               \r
-       }\r
-       \r
-       return this.getSelectedDates();\r
-};\r
 \r
 /**\r
 * Gets the list of currently selected dates from the calendar.\r
 * @return                      An array of currently selected JavaScript Date objects.\r
 * @type Date[]\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { \r
-       var returnDates = new Array();\r
+YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() {\r
+       var returnDates = [];\r
+       var selected = this.cfg.getProperty("selected");\r
 \r
-       for (var d=0;d<this.selectedDates.length;++d)\r
-       {\r
-               var dateArray = this.selectedDates[d];\r
+       for (var d=0;d<selected.length;++d) {\r
+               var dateArray = selected[d];\r
 \r
                var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);\r
                returnDates.push(date);\r
        }\r
 \r
-       returnDates.sort();\r
+       returnDates.sort( function(a,b) { return a-b; } );\r
        return returnDates;\r
 };\r
 \r
 /**\r
-* Calls the addRenderer function of all child calendars within the group.\r
+* Adds a renderer to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the conditions specified in the date string for this renderer.\r
+* @method addRenderer\r
+* @param       {String}        sDates          A date string to associate with the specified renderer. Valid formats\r
+*                                                                      include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addRenderer = function(sDates, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addRenderer(sDates, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Calls the addMonthRenderer function of all child calendars within the group.\r
+* Adds a month to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the month passed to this method.\r
+* @method addMonthRenderer\r
+* @param       {Number}        month           The month (1-12) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addMonthRenderer(month, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Calls the addWeekdayRenderer function of all child calendars within the group.\r
+* Adds a weekday to the render stack. The function reference passed to this method will be executed\r
+* when a date cell matches the weekday passed to this method.\r
+* @method addWeekdayRenderer\r
+* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer\r
+* @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.\r
 */\r
 YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
+       for (var p=0;p<this.pages.length;++p) {\r
                var cal = this.pages[p];\r
                cal.addWeekdayRenderer(weekday, fnRender);\r
        }\r
 };\r
 \r
 /**\r
-* Sets an event handler universally across all child calendars within the group. For instance,\r
-* to set the onSelect handler for all child calendars to a function called fnSelect, the call would be:\r
-* <code>\r
-* calGroup.wireEvent("onSelect", fnSelect);\r
-* </code>\r
-* @param       {String}        eventName       The name of the event to handler to set within all child calendars.\r
-* @param       {Function}      fn                      The function to set into the specified event handler.\r
+* Renders the header for the CalendarGroup.\r
+* @method renderHeader\r
 */\r
-YAHOO.widget.CalendarGroup.prototype.wireEvent = function(eventName, fn) {\r
-       for (var p=0;p<this.pages.length;++p)\r
-       {\r
-               var cal = this.pages[p];\r
-               cal[eventName] = fn;\r
-       }\r
-};\r
+YAHOO.widget.CalendarGroup.prototype.renderHeader = function() {};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
-YAHOO.widget.CalendarGroup.prototype.toString = function() {\r
-       return "CalendarGroup " + this.id;\r
-}\r
-\r
-YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt \r
-**/\r
+* Renders a footer for the 2-up calendar container. By default, this method is\r
+* unimplemented.\r
+* @method renderFooter\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.renderFooter = function() {};\r
 \r
 /**\r
-* @class\r
-* Calendar2up_Cal is the default implementation of the Calendar_Core base class, when used\r
-* in a 2-up view. This class is the UED-approved version of the calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for Calendar_Core. This class\r
-* has some special attributes that only apply to calendars rendered within the calendar group implementation. \r
-* There should be no reason to instantiate this class directly.\r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
-*/\r
-YAHOO.widget.Calendar2up_Cal = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0)\r
-       {\r
-               this.init(id, containerId, monthyear, selected);\r
-       }\r
-}\r
-\r
-YAHOO.widget.Calendar2up_Cal.prototype = new YAHOO.widget.Calendar_Core();\r
-\r
-/**\r
-* Renders the header for each individual calendar in the 2-up view. More\r
-* specifically, this method handles the placement of left and right arrows for\r
-* navigating between calendar pages.\r
-*/\r
-YAHOO.widget.Calendar2up_Cal.prototype.renderHeader = function() {\r
-       this.headerCell.innerHTML = "";\r
-       \r
-       var headerContainer = document.createElement("DIV");\r
-       headerContainer.className = this.Style.CSS_HEADER;\r
-       \r
-       if (this.index == 0) {\r
-\r
-               if (this.linkLeft) {\r
-                       YAHOO.util.Event.removeListener(this.linkLeft, "mousedown", this.parent.doPreviousMonth);\r
-               }\r
-               this.linkLeft = document.createElement("A");\r
-               this.linkLeft.innerHTML = "&nbsp;";\r
-               this.linkLeft.style.backgroundImage =  "url(" + this.Options.NAV_ARROW_LEFT + ")";\r
-               this.linkLeft.className = this.Style.CSS_NAV_LEFT;\r
-               \r
-               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", this.parent.doPreviousMonth, this.parent);\r
-               headerContainer.appendChild(this.linkLeft);\r
-       }\r
-       \r
-       headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));\r
-       \r
-       if (this.index == 1) {\r
-\r
-               if (this.linkRight) {\r
-                       YAHOO.util.Event.removeListener(this.linkRight, "mousedown", this.parent.doNextMonth);\r
-               }\r
-               this.linkRight = document.createElement("A");\r
-               this.linkRight.innerHTML = "&nbsp;";\r
-               this.linkRight.style.backgroundImage = "url(" + this.Options.NAV_ARROW_RIGHT + ")";\r
-               this.linkRight.className = this.Style.CSS_NAV_RIGHT;\r
-\r
-               YAHOO.util.Event.addListener(this.linkRight, "mousedown", this.parent.doNextMonth, this.parent);\r
-               headerContainer.appendChild(this.linkRight);\r
-       }\r
-       \r
-       this.headerCell.appendChild(headerContainer);\r
+* Adds the designated number of months to the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method addMonths\r
+* @param {Number}      count   The number of months to add to the current calendar\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.addMonths = function(count) {\r
+       this.callChildFunction("addMonths", count);\r
 };\r
 \r
 \r
-\r
-\r
 /**\r
-* @class\r
-* Calendar2up is the default implementation of the CalendarGroup base class, when used\r
-* in a 2-up view. This class is the UED-approved version of the 2-up calendar selector widget. For all documentation\r
-* on the implemented methods listed here, see the documentation for CalendarGroup. \r
-* @constructor\r
-* @param {String}      id                      The id of the table element that will represent the calendar widget\r
-* @param {String}      containerId     The id of the container element that will contain the calendar table\r
-* @param {String}      monthyear       The month/year string used to set the current calendar page\r
-* @param {String}      selected        A string of date values formatted using the date parser. The built-in\r
-                                                               default date format is MM/DD/YYYY. Ranges are defined using\r
-                                                               MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD.\r
-                                                               Any combination of these can be combined by delimiting the string with\r
-                                                               commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"\r
+* Subtracts the designated number of months from the current calendar month, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractMonths\r
+* @param {Number}      count   The number of months to subtract from the current calendar\r
 */\r
-YAHOO.widget.Calendar2up = function(id, containerId, monthyear, selected) {\r
-       if (arguments.length > 0)\r
-       {       \r
-               this.buildWrapper(containerId);\r
-               this.init(2, id, containerId, monthyear, selected);\r
-       }\r
-}\r
+YAHOO.widget.CalendarGroup.prototype.subtractMonths = function(count) {\r
+       this.callChildFunction("subtractMonths", count);\r
+};\r
 \r
-YAHOO.widget.Calendar2up.prototype = new YAHOO.widget.CalendarGroup();\r
+/**\r
+* Adds the designated number of years to the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method addYears\r
+* @param {Number}      count   The number of years to add to the current calendar\r
+*/\r
+YAHOO.widget.CalendarGroup.prototype.addYears = function(count) {\r
+       this.callChildFunction("addYears", count);\r
+};\r
 \r
 /**\r
-* CSS class representing the wrapper for the 2-up calendar\r
-* @type string\r
+* Subtcats the designated number of years from the current calendar, and sets the current\r
+* calendar page date to the new month.\r
+* @method subtractYears\r
+* @param {Number}      count   The number of years to subtract from the current calendar\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPWRAPPER = "yui-cal2upwrapper";\r
+YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {\r
+       this.callChildFunction("subtractYears", count);\r
+};\r
 \r
 /**\r
 * CSS class representing the container for the calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_CONTAINER\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_CONTAINER = "yui-calcontainer";\r
+YAHOO.widget.CalendarGroup.CSS_CONTAINER = "yui-calcontainer";\r
 \r
 /**\r
-* CSS class representing the container for the 2-up calendar\r
-* @type string\r
+* CSS class representing the container for the calendar\r
+* @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPCONTAINER = "cal2up";\r
+YAHOO.widget.CalendarGroup.CSS_MULTI_UP = "multi";\r
 \r
 /**\r
 * CSS class representing the title for the 2-up calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPTITLE = "title";\r
+YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";\r
 \r
 /**\r
 * CSS class representing the close icon for the 2-up calendar\r
-* @type string\r
+* @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.Calendar2up.CSS_2UPCLOSE = "close-icon";\r
+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";\r
+\r
+YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",\r
+                                                                                                                                "buildMonthLabel",\r
+                                                                                                                                "renderOutOfBoundsDate",\r
+                                                                                                                                "renderRowHeader",\r
+                                                                                                                                "renderRowFooter",\r
+                                                                                                                                "renderCellDefault",\r
+                                                                                                                                "styleCellDefault",\r
+                                                                                                                                "renderCellStyleHighlight1",\r
+                                                                                                                                "renderCellStyleHighlight2",\r
+                                                                                                                                "renderCellStyleHighlight3",\r
+                                                                                                                                "renderCellStyleHighlight4",\r
+                                                                                                                                "renderCellStyleToday",\r
+                                                                                                                                "renderCellStyleSelected",\r
+                                                                                                                                "renderCellNotThisMonth",\r
+                                                                                                                                "renderBodyCellRestricted",\r
+                                                                                                                                "initStyles",\r
+                                                                                                                                "configTitle",\r
+                                                                                                                                "configClose",\r
+                                                                                                                                "hide",\r
+                                                                                                                                "show",\r
+                                                                                                                                "browser");\r
 \r
 /**\r
-* Implementation of CalendarGroup.constructChild that ensures that child calendars of \r
-* Calendar2up will be of type Calendar2up_Cal.\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     A string representation of the CalendarGroup object.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.constructChild = function(id,containerId,monthyear,selected) {\r
-       var cal = new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);\r
-       return cal;\r
+YAHOO.widget.CalendarGroup.prototype.toString = function() {\r
+       return "CalendarGroup " + this.id;\r
 };\r
 \r
-/**\r
-* Builds the wrapper container for the 2-up calendar.\r
-* @param {String} containerId  The id of the outer container element.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.buildWrapper = function(containerId) {\r
-       var outerContainer = document.getElementById(containerId);\r
-       \r
-       outerContainer.className = YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;\r
-       \r
-       var innerContainer = document.createElement("DIV");\r
-       innerContainer.className = YAHOO.widget.Calendar2up.CSS_CONTAINER;\r
-       innerContainer.id = containerId + "_inner";\r
-       \r
-       var cal1Container = document.createElement("DIV");\r
-       cal1Container.id = containerId + "_0";\r
-       cal1Container.className = YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;\r
-       cal1Container.style.marginRight = "10px";\r
-       \r
-       var cal2Container = document.createElement("DIV");\r
-       cal2Container.id = containerId + "_1"; \r
-       cal2Container.className = YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;\r
-       \r
-       outerContainer.appendChild(innerContainer);\r
-       innerContainer.appendChild(cal1Container);\r
-       innerContainer.appendChild(cal2Container);\r
-       \r
-       this.innerContainer = innerContainer;\r
-       this.outerContainer = outerContainer;\r
-}\r
+YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;\r
 \r
 /**\r
-* Renders the 2-up calendar.\r
+* @class YAHOO.widget.Calendar2up\r
+* @extends YAHOO.widget.CalendarGroup\r
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.render = function() {\r
-       this.renderHeader();\r
-       YAHOO.widget.CalendarGroup.prototype.render.call(this);\r
-       this.renderFooter();\r
+YAHOO.widget.Calendar2up = function(id, containerId, config) {\r
+       this.init(id, containerId, config);\r
 };\r
 \r
-/**\r
-* Renders the header located at the top of the container for the 2-up calendar.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.renderHeader = function() {\r
-       if (! this.title) {\r
-               this.title = "";\r
-       }\r
-       if (! this.titleDiv)\r
-       {\r
-               this.titleDiv = document.createElement("DIV");\r
-               if (this.title == "")\r
-               {\r
-                       this.titleDiv.style.display="none";\r
-               }\r
-       }\r
-\r
-       this.titleDiv.className = YAHOO.widget.Calendar2up.CSS_2UPTITLE;\r
-       this.titleDiv.innerHTML = this.title;\r
-\r
-       if (this.outerContainer.style.position == "absolute")\r
-       {\r
-               var linkClose = document.createElement("A");\r
-               linkClose.href = "javascript:void(null)";\r
-               YAHOO.util.Event.addListener(linkClose, "click", this.hide, this);\r
-\r
-               var imgClose = document.createElement("IMG");\r
-               imgClose.src = YAHOO.widget.Calendar_Core.IMG_ROOT + "us/my/bn/x_d.gif";\r
-               imgClose.className = YAHOO.widget.Calendar2up.CSS_2UPCLOSE;\r
-\r
-               linkClose.appendChild(imgClose);\r
-\r
-               this.linkClose = linkClose;\r
-\r
-               this.titleDiv.appendChild(linkClose);\r
-       }\r
-\r
-       this.innerContainer.insertBefore(this.titleDiv, this.innerContainer.firstChild);\r
-}\r
-\r
-/**\r
-* Hides the 2-up calendar's outer container from view.\r
-*/\r
-YAHOO.widget.Calendar2up.prototype.hide = function(e, cal) {\r
-       if (! cal)\r
-       {\r
-               cal = this;\r
-       }\r
-       cal.outerContainer.style.display = "none";\r
-}\r
+YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);\r
 \r
 /**\r
-* Renders a footer for the 2-up calendar container. By default, this method is\r
-* unimplemented.\r
+* @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.\r
 */\r
-YAHOO.widget.Calendar2up.prototype.renderFooter = function() {}\r
-\r
 YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
\ No newline at end of file
index 362eb86b26f94f7ba0a6ad45e461fecce3fa40c6..d7cbd801f6a00a63f108186a929758ec12059cc7 100755 (executable)
@@ -1,10 +1,70 @@
 Connection Manager Release Notes\r
 \r
+*** version 0.12.0 ***\r
+\r
+* When uploading files via setForm() and asyncRequest includes a POST data\r
+argument, appendPostData() will create hidden input fields for each postData\r
+label/value and append each field to the form object.\r
+\r
+* setForm() returns the assembled label/value string of the parsed HTML form\r
+fields.\r
+\r
+* NOTE: Opera 9.02 does not allow for more than 12 concurrent Connection Manager\r
+objects.\r
+\r
+The following example creates 12 requests in a loop:\r
+for(var n=0; n<=12; i++){\r
+  conn[n] = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);\r
+}\r
+\r
+If n > 13, Opera 9.02 will crash.  Connection manager objects count n must be <=\r
+12 at all times.  This condition was not present in Opera version 9.01.\r
+\r
+This condition does not apply to other A-Grade browsers (\r
+http://developer.yahoo.com/yui/articles/gbs/gbs_browser-chart.html)\r
+\r
+*** version 0.11.3 ***\r
+\r
+* YUI Event dependency for file uploading is now optional.\r
+\r
+* uploadFile() now sets unique IDs for each file upload transaction to prevent\r
+iframe collisions with parallel uploads.\r
+\r
+* The callback object now has property responseXML to provide support for file\r
+upload transactions that return an XML document.\r
+\r
+* setForm() will verify if a select option value attribute is present and use\r
+its value, including empty string, before using the text node value.\r
+\r
+* Modified polling mechanism in handleReadyState() and\r
+handleTransactionResponse() to prevent infinite polling if JavaScript errors\r
+occur in the user-defined callback.\r
+\r
+* createFrame() will now accept a boolean argument of true to set the frame\r
+source to "javascript:false" to prevent IE from throwing security warnings in an\r
+HTTPS environment.\r
+\r
+* setHeader() now enumerates through the _http_header object using\r
+hasOwnProperty() to prevent collisions with members added to Object via\r
+prototype.\r
+\r
+* If using setForm() and asyncRequest includes a POST data argument, the data\r
+will be concatenated to the HTML form POST message.\r
+\r
+*** version 0.11.2 ***\r
+\r
+* No revisions.\r
+\r
+*** version 0.11.1 ***\r
+\r
+* uploadFile() now verifies the existence of callback.upload before invoking\r
+callback, with or without object scope.\r
+\r
 *** version 0.11.0 ***\r
 \r
-* Each transactions can be defined with a timeout threshold, in milliseconds,\r
+* Each transaction can be defined with a timeout threshold, in milliseconds,\r
 through the callback object.  If the threshold is reached, and the transaction\r
-hasn't completed, the transaction will call abort().\r
+hasn't yet completed, the transaction will call abort().\r
 \r
 * abort() will now accept a callback object as the second argument.  The\r
 failure callback will receive a response object to indicate the transaction was\r
@@ -78,3 +138,14 @@ and returns false if the connection object is no longer available.
 \r
 \r
 \r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
index c6d5f00a226faa73002db32b76e5fcaafa4419fa..887e2bba46e44274baf1ff1ff35892a73748e52d 100755 (executable)
-/*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 0.11.0
-*/
-
-/**
- * The Connection Manager provides a simplified interface to the XMLHttpRequest
- * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
- * interactive states and server response, returning the results to a pre-defined
- * callback you create.
- * @ class
- */
-YAHOO.util.Connect =
-{
-/**
-   * Array of MSFT ActiveX ids for XMLHttpRequest.
-   * @private
-   * @type array
-   */
-       _msxml_progid:[
-                       'MSXML2.XMLHTTP.3.0',
-                       'MSXML2.XMLHTTP',
-                       'Microsoft.XMLHTTP'
-                       ],
-
-  /**
-   * Object literal of HTTP header(s)
-   * @private
-   * @type object
-   */
-       _http_header:{},
-
-  /**
-   * Determines if HTTP headers are set.
-   * @private
-   * @type boolean
-   */
-       _has_http_headers:false,
-
- /**
-  * Property that that determines if a default header of
-  * Content-Type of 'application/x-www-form-urlencoded'
-  * will be added to any client HTTP headers sent.
-  * @private
-  * @type boolean
-  */
-    _default_post_header:true,
-
- /**
-  * Property modified by setForm() to determine if the data
-  * should be submitted as an HTML form.
-  * @private
-  * @type boolean
-  */
-    _isFormSubmit:false,
-
- /**
-  * Property modified by setForm() to determine if a file(s)
-  * upload is expected.
-  * @private
-  * @type boolean
-  */
-    _isFileUpload:false,
-
- /**
-  * Property modified by setForm() to set a reference to the HTML
-  * form node if the desired action is file upload.
-  * @private
-  * @type object
-  */
-    _formNode:null,
-
- /**
-  * Property modified by setForm() to set the HTML form data
-  * for each transaction.
-  * @private
-  * @type string
-  */
-    _sFormData:null,
-
- /**
-  * Collection of polling references to the polling mechanism in handleReadyState.
-  * @private
-  * @type string
-  */
-    _poll:[],
-
- /**
-  * Queue of timeout references for each transaction with a defined timeout value.
-  * @private
-  * @type string
-  */
-    _timeOut:[],
-
-  /**
-   * The polling frequency, in milliseconds, for HandleReadyState.
-   * when attempting to determine a transaction's XHR readyState.
-   * The default is 50 milliseconds.
-   * @private
-   * @type int
-   */
-     _polling_interval:50,
-
-  /**
-   * A transaction counter that increments the transaction id for each transaction.
-   * @private
-   * @type int
-   */
-     _transaction_id:0,
-
-  /**
-   * Member to add an ActiveX id to the existing xml_progid array.
-   * In the event(unlikely) a new ActiveX id is introduced, it can be added
-   * without internal code modifications.
-   * @public
-   * @param string id The ActiveX id to be added to initialize the XHR object.
-   * @return void
-   */
-       setProgId:function(id)
-       {
-               this._msxml_progid.unshift(id);
-               YAHOO.log('ActiveX Program Id  ' + id + ' added to _msxml_progid.', 'info', 'Connection');
-       },
-
-  /**
-   * Member to enable or disable the default POST header.
-   * @public
-   * @param boolean b Use default header - true or false .
-   * @return void
-   */
-       setDefaultPostHeader:function(b)
-       {
-               YAHOO.log('Default POST header set to  ' + b, 'info', 'Connection');
-               this._default_post_header = b;
-       },
-
-  /**
-   * Member to modify the default polling interval.
-   * @public
-   * @param {int} i The polling interval in milliseconds.
-   * @return void
-   */
-       setPollingInterval:function(i)
-       {
-               if(typeof i == 'number' && isFinite(i)){
-                               this._polling_interval = i;
-                               YAHOO.log('Default polling interval set to  ' + i, 'info', 'Connection');
-               }
-       },
-
-  /**
-   * Instantiates a XMLHttpRequest object and returns an object with two properties:
-   * the XMLHttpRequest instance and the transaction id.
-   * @private
-   * @param {int} transactionId Property containing the transaction id for this transaction.
-   * @return connection object
-   */
-       createXhrObject:function(transactionId)
-       {
-               var obj,http;
-               try
-               {
-                       // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
-                       http = new XMLHttpRequest();
-                       //  Object literal with http and tId properties
-                       obj = { conn:http, tId:transactionId };
-                       YAHOO.log('XHR object created for transaction  ' + transactionId, 'info', 'Connection');
-               }
-               catch(e)
-               {
-                       for(var i=0; i<this._msxml_progid.length; ++i){
-                               try
-                               {
-                                       // Instantiates XMLHttpRequest for IE and assign to http.
-                                       http = new ActiveXObject(this._msxml_progid[i]);
-                                       //  Object literal with http and tId properties
-                                       obj = { conn:http, tId:transactionId };
-                                       YAHOO.log('ActiveX XHR object created for transaction  ' + transactionId, 'info', 'Connection');
-                                       break;
-                               }
-                               catch(e){}
-                       }
-               }
-               finally
-               {
-                       return obj;
-               }
-       },
-
-  /**
-   * This method is called by asyncRequest to create a
-   * valid connection object for the transaction.  It also passes a
-   * transaction id and increments the transaction id counter.
-   * @private
-   * @return object
-   */
-       getConnectionObject:function()
-       {
-               var o;
-               var tId = this._transaction_id;
-
-               try
-               {
-                       o = this.createXhrObject(tId);
-                       if(o){
-                               this._transaction_id++;
-                       }
-               }
-               catch(e){}
-               finally
-               {
-                       return o;
-               }
-       },
-
-  /**
-   * Method for initiating an asynchronous request via the XHR object.
-   * @public
-   * @param {string} method HTTP transaction method
-   * @param {string} uri Fully qualified path of resource
-   * @param callback User-defined callback function or object
-   * @param {string} postData POST body
-   * @return {object} Returns the connection object
-   */
-       asyncRequest:function(method, uri, callback, postData)
-       {
-               var o = this.getConnectionObject();
-
-               if(!o){
-                       YAHOO.log('Unable to create connection object.', 'error', 'Connection');
-                       return null;
-               }
-               else{
-                       if(this._isFormSubmit){
-                               if(this._isFileUpload){
-                                       this.uploadFile(o.tId, callback, uri);
-                                       this.releaseObject(o);
-                                       return;
-                               }
-
-                               //If the specified HTTP method is GET, setForm() will return an
-                               //encoded string that is concatenated to the uri to
-                               //create a querystring.
-                               if(method == 'GET'){
-                                       uri += "?" +  this._sFormData;
-                               }
-                               else if(method == 'POST'){
-                                       postData =  this._sFormData;
-                               }
-                               this._sFormData = '';
-                       }
-
-                       o.conn.open(method, uri, true);
-
-                       if(this._isFormSubmit || (postData && this._default_post_header)){
-                               this.initHeader('Content-Type','application/x-www-form-urlencoded');
-                               YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');
-                               if(this._isFormSubmit){
-                                       this._isFormSubmit = false;
-                               }
-                       }
-
-                       //Verify whether the transaction has any user-defined HTTP headers
-                       //and set them.
-                       if(this._has_http_headers){
-                               this.setHeader(o);
-                       }
-
-                       this.handleReadyState(o, callback);
-                       postData?o.conn.send(postData):o.conn.send(null);
-
-                       return o;
-               }
-       },
-
-  /**
-   * This method serves as a timer that polls the XHR object's readyState
-   * property during a transaction, instead of binding a callback to the
-   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
-   * will process the response, and the timer will be cleared.
-   *
-   * @private
-   * @param {object} o The connection object
-   * @param callback User-defined callback object
-   * @return void
-   */
-    handleReadyState:function(o, callback)
-    {
-        var timeOut = callback.timeout;
-        var oConn = this;
-
-        try
-        {
-            if(timeOut !== undefined){
-               this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
-            }
-            this._poll[o.tId] = window.setInterval(
-                function(){
-                                       if(o.conn && o.conn.readyState == 4){
-                                               window.clearInterval(oConn._poll[o.tId]);
-                                               oConn._poll.splice(o.tId);
-                                               if(timeOut){
-                                                       oConn._timeOut.splice(o.tId);
-                                               }
-
-                                               oConn.handleTransactionResponse(o, callback);
-                    }
-                }
-            ,this._polling_interval);
-        }
-        catch(e)
-        {
-            window.clearInterval(oConn._poll[o.tId]);
-            oConn._poll.splice(o.tId);
-                       if(timeOut){
-                               oConn._timeOut.splice(o.tId);
-                       }
-
-            oConn.handleTransactionResponse(o, callback);
-        }
-    },
-
-  /**
-   * This method attempts to interpret the server response and
-   * determine whether the transaction was successful, or if an error or
-   * exception was encountered.
-   *
-   * @private
-   * @param {object} o The connection object
-   * @param {object} callback - User-defined callback object
-   * @param {boolean} determines if the transaction was aborted.
-   * @return void
-   */
-    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.', 'warn', 'Connection');
-                       return;
-               }
-
-               var httpStatus, responseObject;
-
-               try
-               {
-                       if(o.conn.status !== undefined && o.conn.status != 0){
-                               httpStatus = o.conn.status;
-                       }
-                       else{
-                               httpStatus = 13030;
-                       }
-               }
-               catch(e){
-                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                       // when the o object's status and statusText properties are
-                       // unavailable, and a query attempt throws an exception.
-                       httpStatus = 13030;
-               }
-
-               if(httpStatus >= 200 && httpStatus < 300){
-                       responseObject = this.createResponseObject(o, callback.argument);
-                       if(callback.success){
-                               if(!callback.scope){
-                                       callback.success(responseObject);
-                                       YAHOO.log('Success callback. HTTP code is ' + httpStatus, 'info', 'Connection');
-                               }
-                               else{
-                                       // If a scope property is defined, the callback will be fired from
-                                       // the context of the object.
-                                       callback.success.apply(callback.scope, [responseObject]);
-                                       YAHOO.log('Success callback with scope. HTTP code is ' + httpStatus, 'info', 'Connection');
-                               }
-                       }
-               }
-               else{
-                       switch(httpStatus){
-                               // The following case labels are wininet.dll error codes that may be encountered.
-                               // Server timeout
-                               case 12002:
-                               // 12029 to 12031 correspond to dropped connections.
-                               case 12029:
-                               case 12030:
-                               case 12031:
-                               // Connection closed by server.
-                               case 12152:
-                               // See above comments for variable status.
-                               case 13030:
-                                       responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
-                                       if(callback.failure){
-                                               if(!callback.scope){
-                                                       callback.failure(responseObject);
-                                                       YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
-                                               }
-                                               else{
-                                                       callback.failure.apply(callback.scope,[responseObject]);
-                                                       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){
-                                               if(!callback.scope){
-                                                       callback.failure(responseObject);
-                                                       YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');
-                                               }
-                                               else{
-                                                       callback.failure.apply(callback.scope,[responseObject]);
-                                                       YAHOO.log('Failure callback with scope. HTTP status code is ' + httpStatus, 'warn', 'Connection');
-                                               }
-                                       }
-                       }
-               }
-
-               this.releaseObject(o);
-    },
-
-  /**
-   * This method evaluates the server response, creates and returns the results via
-   * its properties.  Success and failure cases will differ in the response
-   * object's property values.
-   * @private
-   * @param {object} o The connection object
-   * @param {} callbackArg User-defined argument or arguments to be passed to the callback
-   * @return object
-   */
-    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+1);
-                               }
-                       }
-               }
-               catch(e){}
-
-               obj.tId = o.tId;
-               obj.status = o.conn.status;
-               obj.statusText = 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;
-    },
-
-  /**
-   * If a transaction cannot be completed due to dropped or closed connections,
-   * there may be not be enough information to build a full response object.
-   * The failure callback will be fired and this specific condition can be identified
-   * by a status property value of 0.
-   *
-   * If an abort was successful, the status property will report a value of -1.
-   *
-   * @private
-   * @param {int} tId Transaction Id
-   * @param callbackArg The user-defined arguments
-   * @param isAbort Determines if the exception is an abort.
-   * @return object
-   */
-    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;
-    },
-
-  /**
-   * Public method that stores the custom HTTP headers for each transaction.
-   * @public
-   * @param {string} label The HTTP header label
-   * @param {string} value The HTTP header value
-   * @return void
-   */
-       initHeader:function(label,value)
-       {
-               if(this._http_header[label] === undefined){
-                       this._http_header[label] = value;
-               }
-               else{
-                       this._http_header[label] =  value + "," + this._http_header[label];
-               }
-
-               this._has_http_headers = true;
-       },
-
-  /**
-   * Accessor that sets the HTTP headers for each transaction.
-   * @private
-   * @param {object} o The connection object for the transaction.
-   * @return void
-   */
-       setHeader:function(o)
-       {
-               for(var prop in this._http_header){
-                       if(this._http_header.propertyIsEnumerable){
-                               o.conn.setRequestHeader(prop, this._http_header[prop]);
-                               YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_header[prop], 'info', 'Connection');
-                       }
-               }
-               delete this._http_header;
-
-               this._http_header = {};
-               this._has_http_headers = false;
-       },
-
-  /**
-   * This method assembles the form label and value pairs and
-   * constructs an encoded string.
-   * asyncRequest() will automatically initialize the
-   * transaction with a HTTP header Content-Type of
-   * application/x-www-form-urlencoded.
-   * @public
-   * @param {string || object} form id or name attribute, or form object.
-   * @param {string} optional boolean to indicate SSL environment.
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return void
-   */
-       setForm:function(formId, isUpload, secureUri)
-       {
-               this._sFormData = '';
-               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.
-                       var oForm = (document.getElementById(formId) || document.forms[formId]);
-               }
-               else if(typeof formId == 'object'){
-                       var oForm = formId;
-               }
-               else{
-                       YAHOO.log('Unable to create form object ' + formId, 'warn', 'Connection');
-                       return;
-               }
-
-               // If the isUpload argument is true, setForm will call createFrame to initialize
-               // an iframe as the form target.
-               //
-               // The argument secureURI is also required by IE in SSL environments
-               // where the secureURI string is a fully qualified HTTP path, used to set the source
-               // of the iframe, to a stub resource in the same domain.
-               if(isUpload){
-                       (typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
-                       this._isFormSubmit = true;
-                       this._isFileUpload = true;
-                       this._formNode = oForm;
-
-                       return;
-               }
-
-               var oElement, oName, oValue, oDisabled;
-               var hasSubmit = false;
-
-               // Iterate over the form elements collection to construct the
-               // label-value pairs.
-               for (var i=0; i<oForm.elements.length; i++){
-                       oDisabled = oForm.elements[i].disabled;
-
-                       // If the name attribute is not populated, the form field's
-                       // value will not be submitted.
-                       oElement = oForm.elements[i];
-                       oName = oForm.elements[i].name;
-                       oValue = oForm.elements[i].value;
-
-                       // Do not submit fields that are disabled or
-                       // do not have a name attribute value.
-                       if(!oDisabled && oName !== undefined)
-                       {
-                               switch (oElement.type)
-                               {
-                                       case 'select-one':
-                                       case 'select-multiple':
-                                               for(var j=0; j<oElement.options.length; j++){
-                                                       if(oElement.options[j].selected){
-                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(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':
-                                               // stub case as XMLHttpRequest will only send the file path as a string.
-                                       case undefined:
-                                               // stub case for fieldset element which returns undefined.
-                                       case 'reset':
-                                               // stub case for input type reset button.
-                                       case 'button':
-                                               // stub case for input type button elements.
-                                               break;
-                                       case 'submit':
-                                               if(hasSubmit == false){
-                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                                       hasSubmit = true;
-                                               }
-                                               break;
-                                       default:
-                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                               break;
-                               }
-                       }
-               }
-
-               this._isFormSubmit = true;
-               this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
-
-               YAHOO.log('Form initialized for transaction. POST message is: ' + this._sFormData, 'info', 'Connection');
-       },
-
-  /**
-   * Creates an iframe to be used for form file uploads.  It is remove from the
-   * document upon completion of the upload transaction.
-   *
-   * @private
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return void
-   */
-       createFrame:function(secureUri){
-
-               // IE does not allow the setting of id and name attributes as DOM
-               // properties.  A different iframe creation pattern is required for IE.
-               if(window.ActiveXObject){
-                       var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
-                       if(secureUri){
-                               // IE will throw a security exception in an SSL environment if the
-                               // iframe source isn't set to a valid resource.
-                               io.src = secureUri;
-                       }
-               }
-               else{
-                       var io = document.createElement('IFRAME');
-                       io.id = 'ioFrame';
-                       io.name = 'ioFrame';
-               }
-
-               io.style.position = 'absolute';
-               io.style.top = '-1000px';
-               io.style.left = '-1000px';
-
-               document.body.appendChild(io);
-       },
-
-  /**
-   * Uploads HTML form, including files/attachments,  targeting the
-   * iframe created in createFrame.
-   *
-   * @private
-   * @param {int} id The transaction id.
-   * @param {object} callback - User-defined callback object.
-   * @param {string} uri Fully qualified path of resource.
-   * @return void
-   */
-       uploadFile:function(id, callback, uri){
-               // Initialize the HTML form properties in case they are
-               // not defined in the HTML form.
-               this._formNode.action = uri;
-               this._formNode.enctype = 'multipart/form-data';
-               this._formNode.method = 'POST';
-               this._formNode.target = 'ioFrame';
-               this._formNode.submit();
-
-               // Reset form status properties.
-               this._formNode = null;
-               this._isFileUpload = false;
-               this._isFormSubmit = false;
-
-               // Create the upload callback handler that fires when the iframe
-               // receives the load event.  Subsequently, the event handler is detached
-               // and the iframe removed from the document.
-
-               var uploadCallback = function()
-               {
-                       var oResponse =
-                       {
-                               tId: id,
-                               responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
-                               argument: callback.argument
-                       }
-
-                       if(callback.upload && !callback.scope){
-                               callback.upload(oResponse);
-                               YAHOO.log('Upload callback.', 'info', 'Connection');
-                       }
-                       else{
-                               callback.upload.apply(callback.scope, [oResponse]);
-                               YAHOO.log('Upload callback with object scope.', 'info', 'Connection');
-                       }
-
-                       YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
-                       window.ioFrame.location.replace('#');
-                       setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
-               };
-
-               // Bind the onload handler to the iframe to detect the file upload response.
-               YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
-       },
-
-  /**
-   * Public method to terminate a transaction, if it has not reached readyState 4.
-   * @public
-   * @param {object} o The connection object returned by asyncRequest.
-   * @param {object} callback  User-defined callback object.
-   * @param {string} isTimeout boolean to indicate if abort was a timeout.
-   * @return void
-   */
-       abort:function(o, callback, isTimeout)
-       {
-               if(this.isCallInProgress(o)){
-                       window.clearInterval(this._poll[o.tId]);
-                       this._poll.splice(o.tId);
-                       if(isTimeout){
-                               this._timeOut.splice(o.tId);
-                       }
-                       o.conn.abort();
-
-                       this.handleTransactionResponse(o, callback, true);
-                       YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
-
-                       return true;
-               }
-               else{
-                       YAHOO.log('Transaction ' + o.tId + ' abort failed.', 'warn', 'Connection');
-
-                       return false;
-               }
-       },
-
-  /**
-   * Public method to check if the transaction is still being processed.
-   * @public
-   * @param {object} o The connection object returned by asyncRequest
-   * @return boolean
-   */
-       isCallInProgress:function(o)
-       {
-               // if the XHR object assigned to the transaction has not been dereferenced,
-               // then check its readyState status.  Otherwise, return false.
-               if(o.conn){
-                       return o.conn.readyState != 4 && o.conn.readyState != 0;
-               }
-               else{
-                       //The XHR object has been destroyed.
-                       return false;
-               }
-       },
-
-  /**
-   * Dereference the XHR instance and the connection object after the transaction is completed.
-   * @private
-   * @param {object} o The connection object
-   * @return void
-   */
-       releaseObject:function(o)
-       {
-               //dereference the XHR instance.
-               o.conn = null;
-
-               YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
-
-               //dereference the connection object.
-               o = null;
-       }
-};
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+\r
+/**\r
+ * @description\r
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest\r
+ * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the\r
+ * interactive states and server response, returning the results to a pre-defined\r
+ * callback you create.\r
+ *\r
+ * @namespace YAHOO.util\r
+ * @module Connection\r
+ * @Class Connect\r
+ */\r
+YAHOO.util.Connect =\r
+{\r
+  /**\r
+   * @description Array of MSFT ActiveX ids for XMLHttpRequest.\r
+   * @property _msxml_progid\r
+   * @private\r
+   * @static\r
+   * @type array\r
+   */\r
+       _msxml_progid:[\r
+               'MSXML2.XMLHTTP.3.0',\r
+               'MSXML2.XMLHTTP',\r
+               'Microsoft.XMLHTTP'\r
+               ],\r
+\r
+  /**\r
+   * @description Object literal of HTTP header(s)\r
+   * @property _http_header\r
+   * @private\r
+   * @static\r
+   * @type object\r
+   */\r
+       _http_header:{},\r
+\r
+  /**\r
+   * @description Determines if HTTP headers are set.\r
+   * @property _has_http_headers\r
+   * @private\r
+   * @static\r
+   * @type boolean\r
+   */\r
+       _has_http_headers:false,\r
+\r
+ /**\r
+  * @description Determines if a default header of\r
+  * Content-Type of 'application/x-www-form-urlencoded'\r
+  * will be added to any client HTTP headers sent for POST\r
+  * transactions.\r
+  * @property _use_default_post_header\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _use_default_post_header:true,\r
+\r
+ /**\r
+  * @description Determines if a default header of\r
+  * Content-Type of 'application/x-www-form-urlencoded'\r
+  * will be added to any client HTTP headers sent for POST\r
+  * transactions.\r
+  * @property _default_post_header\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _default_post_header:'application/x-www-form-urlencoded',\r
+\r
+ /**\r
+  * @description Property modified by setForm() to determine if the data\r
+  * should be submitted as an HTML form.\r
+  * @property _isFormSubmit\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _isFormSubmit:false,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to determine if a file(s)\r
+  * upload is expected.\r
+  * @property _isFileUpload\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _isFileUpload:false,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to set a reference to the HTML\r
+  * form node if the desired action is file upload.\r
+  * @property _formNode\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _formNode:null,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to set the HTML form data\r
+  * for each transaction.\r
+  * @property _sFormData\r
+  * @private\r
+  * @static\r
+  * @type string\r
+  */\r
+    _sFormData:null,\r
+\r
+ /**\r
+  * @description Collection of polling references to the polling mechanism in handleReadyState.\r
+  * @property _poll\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _poll:{},\r
+\r
+ /**\r
+  * @description Queue of timeout values for each transaction callback with a defined timeout value.\r
+  * @property _timeOut\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _timeOut:{},\r
+\r
+  /**\r
+   * @description The polling frequency, in milliseconds, for HandleReadyState.\r
+   * when attempting to determine a transaction's XHR readyState.\r
+   * The default is 50 milliseconds.\r
+   * @property _polling_interval\r
+   * @private\r
+   * @static\r
+   * @type int\r
+   */\r
+     _polling_interval:50,\r
+\r
+  /**\r
+   * @description A transaction counter that increments the transaction id for each transaction.\r
+   * @property _transaction_id\r
+   * @private\r
+   * @static\r
+   * @type int\r
+   */\r
+     _transaction_id:0,\r
+\r
+  /**\r
+   * @description Member to add an ActiveX id to the existing xml_progid array.\r
+   * In the event(unlikely) a new ActiveX id is introduced, it can be added\r
+   * without internal code modifications.\r
+   * @method setProgId\r
+   * @public\r
+   * @static\r
+   * @param {string} id The ActiveX id to be added to initialize the XHR object.\r
+   * @return void\r
+   */\r
+       setProgId:function(id)\r
+       {\r
+               this._msxml_progid.unshift(id);\r
+               YAHOO.log('ActiveX Program Id  ' + id + ' added to _msxml_progid.', 'info', 'Connection');\r
+       },\r
+\r
+  /**\r
+   * @description Member to enable or disable the default POST header.\r
+   * @method setDefaultPostHeader\r
+   * @public\r
+   * @static\r
+   * @param {boolean} b Set and use default header - true or false .\r
+   * @return void\r
+   */\r
+       setDefaultPostHeader:function(b)\r
+       {\r
+               this._use_default_post_header = b;\r
+               YAHOO.log('Use default POST header set to  ' + b, 'info', 'Connection');\r
+       },\r
+\r
+  /**\r
+   * @description Member to modify the default polling interval.\r
+   * @method setPollingInterval\r
+   * @public\r
+   * @static\r
+   * @param {int} i The polling interval in milliseconds.\r
+   * @return void\r
+   */\r
+       setPollingInterval:function(i)\r
+       {\r
+               if(typeof i == 'number' && isFinite(i)){\r
+                       this._polling_interval = i;\r
+                       YAHOO.log('Default polling interval set to ' + i +'ms', 'info', 'Connection');\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Instantiates a XMLHttpRequest object and returns an object with two properties:\r
+   * the XMLHttpRequest instance and the transaction id.\r
+   * @method createXhrObject\r
+   * @private\r
+   * @static\r
+   * @param {int} transactionId Property containing the transaction id for this transaction.\r
+   * @return object\r
+   */\r
+       createXhrObject:function(transactionId)\r
+       {\r
+               var obj,http;\r
+               try\r
+               {\r
+                       // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.\r
+                       http = new XMLHttpRequest();\r
+                       //  Object literal with http and tId properties\r
+                       obj = { conn:http, tId:transactionId };\r
+                       YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');\r
+               }\r
+               catch(e)\r
+               {\r
+                       for(var i=0; i<this._msxml_progid.length; ++i){\r
+                               try\r
+                               {\r
+                                       // Instantiates XMLHttpRequest for IE and assign to http.\r
+                                       http = new ActiveXObject(this._msxml_progid[i]);\r
+                                       //  Object literal with conn and tId properties\r
+                                       obj = { conn:http, tId:transactionId };\r
+                                       YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');\r
+                                       break;\r
+                               }\r
+                               catch(e){}\r
+                       }\r
+               }\r
+               finally\r
+               {\r
+                       return obj;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description This method is called by asyncRequest to create a\r
+   * valid connection object for the transaction.  It also passes a\r
+   * transaction id and increments the transaction id counter.\r
+   * @method getConnectionObject\r
+   * @private\r
+   * @static\r
+   * @return {object}\r
+   */\r
+       getConnectionObject:function()\r
+       {\r
+               var o;\r
+               var tId = this._transaction_id;\r
+\r
+               try\r
+               {\r
+                       o = this.createXhrObject(tId);\r
+                       if(o){\r
+                               this._transaction_id++;\r
+                       }\r
+               }\r
+               catch(e){}\r
+               finally\r
+               {\r
+                       return o;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Method for initiating an asynchronous request via the XHR object.\r
+   * @method asyncRequest\r
+   * @public\r
+   * @static\r
+   * @param {string} method HTTP transaction method\r
+   * @param {string} uri Fully qualified path of resource\r
+   * @param {callback} callback User-defined callback function or object\r
+   * @param {string} postData POST body\r
+   * @return {object} Returns the connection object\r
+   */\r
+       asyncRequest:function(method, uri, callback, postData)\r
+       {\r
+               var o = this.getConnectionObject();\r
+\r
+               if(!o){\r
+                       YAHOO.log('Unable to create connection object.', 'error', 'Connection');\r
+                       return null;\r
+               }\r
+               else{\r
+                       if(this._isFormSubmit){\r
+                               if(this._isFileUpload){\r
+                                       this.uploadFile(o.tId, callback, uri, postData);\r
+                                       this.releaseObject(o);\r
+\r
+                                       return;\r
+                               }\r
+\r
+                               //If the specified HTTP method is GET, setForm() will return an\r
+                               //encoded string that is concatenated to the uri to\r
+                               //create a querystring.\r
+                               if(method == 'GET'){\r
+                                       if(this._sFormData.length != 0){\r
+                                               // If the URI already contains a querystring, append an ampersand\r
+                                               // and then concatenate _sFormData to the URI.\r
+                                               uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;\r
+                                       }\r
+                                       else{\r
+                                               uri += "?" + this._sFormData;\r
+                                       }\r
+                               }\r
+                               else if(method == 'POST'){\r
+                                       //If POST data exist in addition to the HTML form data,\r
+                                       //it will be concatenated to the form data.\r
+                                       postData = postData?this._sFormData + "&" + postData:this._sFormData;\r
+                               }\r
+                       }\r
+\r
+                       o.conn.open(method, uri, true);\r
+\r
+                       if(this._isFormSubmit || (postData && this._use_default_post_header)){\r
+                               this.initHeader('Content-Type', this._default_post_header);\r
+                               YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');\r
+                       }\r
+                       else if(this._isFormSubmit){\r
+                               this.resetFormState();\r
+                       }\r
+\r
+                       if(this._has_http_headers){\r
+                               this.setHeader(o);\r
+                       }\r
+\r
+                       this.handleReadyState(o, callback);\r
+                       o.conn.send(postData || null);\r
+\r
+                       return o;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description This method serves as a timer that polls the XHR object's readyState\r
+   * property during a transaction, instead of binding a callback to the\r
+   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse\r
+   * will process the response, and the timer will be cleared.\r
+   * @method handleReadyState\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {callback} callback The user-defined callback object\r
+   * @return {void}\r
+   */\r
+    handleReadyState:function(o, callback)\r
+    {\r
+               var oConn = this;\r
+\r
+               if(callback && callback.timeout){\r
+                       this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);\r
+               }\r
+\r
+               this._poll[o.tId] = window.setInterval(\r
+                       function(){\r
+                               if(o.conn && o.conn.readyState == 4){\r
+                                       window.clearInterval(oConn._poll[o.tId]);\r
+                                       delete oConn._poll[o.tId];\r
+\r
+                                       if(callback && callback.timeout){\r
+                                               delete oConn._timeOut[o.tId];\r
+                                       }\r
+\r
+                                       oConn.handleTransactionResponse(o, callback);\r
+                               }\r
+                       }\r
+               ,this._polling_interval);\r
+    },\r
+\r
+  /**\r
+   * @description This method attempts to interpret the server response and\r
+   * determine whether the transaction was successful, or if an error or\r
+   * exception was encountered.\r
+   * @method handleTransactionResponse\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {object} callback The sser-defined callback object\r
+   * @param {boolean} isAbort Determines if the transaction was aborted.\r
+   * @return {void}\r
+   */\r
+    handleTransactionResponse:function(o, callback, isAbort)\r
+    {\r
+               // If no valid callback is provided, then do not process any callback handling.\r
+               if(!callback){\r
+                       this.releaseObject(o);\r
+                       YAHOO.log('No callback object to process. Transaction complete.', 'warn', 'Connection');\r
+                       return;\r
+               }\r
+\r
+               var httpStatus, responseObject;\r
+\r
+               try\r
+               {\r
+                       if(o.conn.status !== undefined && o.conn.status != 0){\r
+                               httpStatus = o.conn.status;\r
+                       }\r
+                       else{\r
+                               httpStatus = 13030;\r
+                       }\r
+               }\r
+               catch(e){\r
+                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --\r
+                       // when the o object's status and statusText properties are\r
+                       // unavailable, and a query attempt throws an exception.\r
+                       httpStatus = 13030;\r
+               }\r
+\r
+               if(httpStatus >= 200 && httpStatus < 300){\r
+                       responseObject = this.createResponseObject(o, callback.argument);\r
+                       if(callback.success){\r
+                               if(!callback.scope){\r
+                                       callback.success(responseObject);\r
+                                       YAHOO.log('Success callback. HTTP code is ' + httpStatus, 'info', 'Connection');\r
+                               }\r
+                               else{\r
+                                       // If a scope property is defined, the callback will be fired from\r
+                                       // the context of the object.\r
+                                       callback.success.apply(callback.scope, [responseObject]);\r
+                                       YAHOO.log('Success callback with scope. HTTP code is ' + httpStatus, 'info', 'Connection');\r
+                               }\r
+                       }\r
+               }\r
+               else{\r
+                       switch(httpStatus){\r
+                               // The following cases are wininet.dll error codes that may be encountered.\r
+                               case 12002: // Server timeout\r
+                               case 12029: // 12029 to 12031 correspond to dropped connections.\r
+                               case 12030:\r
+                               case 12031:\r
+                               case 12152: // Connection closed by server.\r
+                               case 13030: // See above comments for variable status.\r
+                                       responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));\r
+                                       if(callback.failure){\r
+                                               if(!callback.scope){\r
+                                                       callback.failure(responseObject);\r
+                                                       YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');\r
+                                               }\r
+                                               else{\r
+                                                       callback.failure.apply(callback.scope, [responseObject]);\r
+                                                       YAHOO.log('Failure callback with scope. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');\r
+                                               }\r
+                                       }\r
+                                       break;\r
+                               default:\r
+                                       responseObject = this.createResponseObject(o, callback.argument);\r
+                                       if(callback.failure){\r
+                                               if(!callback.scope){\r
+                                                       callback.failure(responseObject);\r
+                                                       YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');\r
+                                               }\r
+                                               else{\r
+                                                       callback.failure.apply(callback.scope, [responseObject]);\r
+                                                       YAHOO.log('Failure callback with scope. HTTP status code is ' + httpStatus, 'warn', 'Connection');\r
+                                               }\r
+                                       }\r
+                       }\r
+               }\r
+\r
+               this.releaseObject(o);\r
+               responseObject = null;\r
+    },\r
+\r
+  /**\r
+   * @description This method evaluates the server response, creates and returns the results via\r
+   * its properties.  Success and failure cases will differ in the response\r
+   * object's property values.\r
+   * @method createResponseObject\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback\r
+   * @return {object}\r
+   */\r
+    createResponseObject:function(o, callbackArg)\r
+    {\r
+               var obj = {};\r
+               var headerObj = {};\r
+\r
+               try\r
+               {\r
+                       var headerStr = o.conn.getAllResponseHeaders();\r
+                       var header = headerStr.split('\n');\r
+                       for(var i=0; i<header.length; i++){\r
+                               var delimitPos = header[i].indexOf(':');\r
+                               if(delimitPos != -1){\r
+                                       headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);\r
+                               }\r
+                       }\r
+               }\r
+               catch(e){}\r
+\r
+               obj.tId = o.tId;\r
+               obj.status = o.conn.status;\r
+               obj.statusText = o.conn.statusText;\r
+               obj.getResponseHeader = headerObj;\r
+               obj.getAllResponseHeaders = headerStr;\r
+               obj.responseText = o.conn.responseText;\r
+               obj.responseXML = o.conn.responseXML;\r
+\r
+               if(typeof callbackArg !== undefined){\r
+                       obj.argument = callbackArg;\r
+               }\r
+\r
+               return obj;\r
+    },\r
+\r
+  /**\r
+   * @description If a transaction cannot be completed due to dropped or closed connections,\r
+   * there may be not be enough information to build a full response object.\r
+   * The failure callback will be fired and this specific condition can be identified\r
+   * by a status property value of 0.\r
+   *\r
+   * If an abort was successful, the status property will report a value of -1.\r
+   *\r
+   * @method createExceptionObject\r
+   * @private\r
+   * @static\r
+   * @param {int} tId The Transaction Id\r
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback\r
+   * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort\r
+   * @return {object}\r
+   */\r
+    createExceptionObject:function(tId, callbackArg, isAbort)\r
+    {\r
+               var COMM_CODE = 0;\r
+               var COMM_ERROR = 'communication failure';\r
+               var ABORT_CODE = -1;\r
+               var ABORT_ERROR = 'transaction aborted';\r
+\r
+               var obj = {};\r
+\r
+               obj.tId = tId;\r
+               if(isAbort){\r
+                       obj.status = ABORT_CODE;\r
+                       obj.statusText = ABORT_ERROR;\r
+               }\r
+               else{\r
+                       obj.status = COMM_CODE;\r
+                       obj.statusText = COMM_ERROR;\r
+               }\r
+\r
+               if(callbackArg){\r
+                       obj.argument = callbackArg;\r
+               }\r
+\r
+               return obj;\r
+    },\r
+\r
+  /**\r
+   * @description Public method that stores the custom HTTP headers for each transaction.\r
+   * @method initHeader\r
+   * @public\r
+   * @static\r
+   * @param {string} label The HTTP header label\r
+   * @param {string} value The HTTP header value\r
+   * @return {void}\r
+   */\r
+       initHeader:function(label,value)\r
+       {\r
+               if(this._http_header[label] === undefined){\r
+                       this._http_header[label] = value;\r
+               }\r
+               else{\r
+                       // Concatenate multiple values, comma-delimited,\r
+                       // for the same header label,\r
+                       this._http_header[label] =  value + "," + this._http_header[label];\r
+               }\r
+\r
+               this._has_http_headers = true;\r
+       },\r
+\r
+  /**\r
+   * @description Accessor that sets the HTTP headers for each transaction.\r
+   * @method setHeader\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object for the transaction.\r
+   * @return {void}\r
+   */\r
+       setHeader:function(o)\r
+       {\r
+               for(var prop in this._http_header){\r
+                       if(this._http_header.hasOwnProperty(prop)){\r
+                               o.conn.setRequestHeader(prop, this._http_header[prop]);\r
+                               YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_header[prop], 'info', 'Connection');\r
+                       }\r
+               }\r
+               delete this._http_header;\r
+\r
+               this._http_header = {};\r
+               this._has_http_headers = false;\r
+       },\r
+\r
+  /**\r
+   * @description This method assembles the form label and value pairs and\r
+   * constructs an encoded string.\r
+   * asyncRequest() will automatically initialize the\r
+   * transaction with a HTTP header Content-Type of\r
+   * application/x-www-form-urlencoded.\r
+   * @method setForm\r
+   * @public\r
+   * @static\r
+   * @param {string || object} form id or name attribute, or form object.\r
+   * @param {string} optional boolean to indicate SSL environment.\r
+   * @param {string || boolean} optional qualified path of iframe resource for SSL in IE.\r
+   * @return {string} string of the HTML form field name and value pairs..\r
+   */\r
+       setForm:function(formId, isUpload, secureUri)\r
+       {\r
+               if(typeof formId == 'string'){\r
+                       // Determine if the argument is a form id or a form name.\r
+                       // Note form name usage is deprecated by supported\r
+                       // here for legacy reasons.\r
+                       var oForm = (document.getElementById(formId) || document.forms[formId]);\r
+               }\r
+               else if(typeof formId == 'object'){\r
+                       // Treat argument as an HTML form object.\r
+                       var oForm = formId;\r
+               }\r
+               else{\r
+                       YAHOO.log('Unable to create form object ' + formId, 'warn', 'Connection');\r
+                       return;\r
+               }\r
+\r
+               // If the isUpload argument is true, setForm will call createFrame to initialize\r
+               // an iframe as the form target.\r
+               //\r
+               // The argument secureURI is also required by IE in SSL environments\r
+               // where the secureURI string is a fully qualified HTTP path, used to set the source\r
+               // of the iframe, to a stub resource in the same domain.\r
+               if(isUpload){\r
+\r
+                       // Create iframe in preparation for file upload.\r
+                       this.createFrame(secureUri?secureUri:null);\r
+\r
+                       // Set form reference and file upload properties to true.\r
+                       this._isFormSubmit = true;\r
+                       this._isFileUpload = true;\r
+                       this._formNode = oForm;\r
+\r
+                       return;\r
+               }\r
+\r
+               var oElement, oName, oValue, oDisabled;\r
+               var hasSubmit = false;\r
+\r
+               // Iterate over the form elements collection to construct the\r
+               // label-value pairs.\r
+               for (var i=0; i<oForm.elements.length; i++){\r
+                       oElement = oForm.elements[i];\r
+                       oDisabled = oForm.elements[i].disabled;\r
+                       oName = oForm.elements[i].name;\r
+                       oValue = oForm.elements[i].value;\r
+\r
+                       // Do not submit fields that are disabled or\r
+                       // do not have a name attribute value.\r
+                       if(!oDisabled && oName)\r
+                       {\r
+                               switch (oElement.type)\r
+                               {\r
+                                       case 'select-one':\r
+                                       case 'select-multiple':\r
+                                               for(var j=0; j<oElement.options.length; j++){\r
+                                                       if(oElement.options[j].selected){\r
+                                                               if(window.ActiveXObject){\r
+                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';\r
+                                                               }\r
+                                                               else{\r
+                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';\r
+                                                               }\r
+\r
+                                                       }\r
+                                               }\r
+                                               break;\r
+                                       case 'radio':\r
+                                       case 'checkbox':\r
+                                               if(oElement.checked){\r
+                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                               }\r
+                                               break;\r
+                                       case 'file':\r
+                                               // stub case as XMLHttpRequest will only send the file path as a string.\r
+                                       case undefined:\r
+                                               // stub case for fieldset element which returns undefined.\r
+                                       case 'reset':\r
+                                               // stub case for input type reset button.\r
+                                       case 'button':\r
+                                               // stub case for input type button elements.\r
+                                               break;\r
+                                       case 'submit':\r
+                                               if(hasSubmit == false){\r
+                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                                       hasSubmit = true;\r
+                                               }\r
+                                               break;\r
+                                       default:\r
+                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                               break;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               this._isFormSubmit = true;\r
+               this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);\r
+\r
+               YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');\r
+\r
+               return this._sFormData;\r
+       },\r
+\r
+  /**\r
+   * @description Resets HTML form properties when an HTML form or HTML form\r
+   * with file upload transaction is sent.\r
+   * @method resetFormState\r
+   * @private\r
+   * @static\r
+   * @param {boolean} isUpload Indicates if file upload properties should be reset.\r
+   * @return {void}\r
+   */\r
+       resetFormState:function(isUpload){\r
+               this._isFormSubmit = false;\r
+               this._sFormData = null;\r
+               if(isUpload){\r
+                       this._isFileUpload = false;\r
+                       this._formNode = null;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Creates an iframe to be used for form file uploads.  It is remove from the\r
+   * document upon completion of the upload transaction.\r
+   * @method createFrame\r
+   * @private\r
+   * @static\r
+   * @param {string} optional qualified path of iframe resource for SSL in IE.\r
+   * @return {void}\r
+   */\r
+       createFrame:function(secureUri){\r
+\r
+               // IE does not allow the setting of id and name attributes as object\r
+               // properties via createElement().  A different iframe creation\r
+               // pattern is required for IE.\r
+               var frameId = 'yuiIO' + this._transaction_id;\r
+               if(window.ActiveXObject){\r
+                       var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');\r
+\r
+                       // IE will throw a security exception in an SSL environment if the\r
+                       // iframe source is undefined.\r
+                       if(typeof secureUri == 'boolean'){\r
+                               io.src = 'javascript:false';\r
+                       }\r
+                       else if(typeof secureURI == 'string'){\r
+                               // Deprecated\r
+                               io.src = secureUri;\r
+                       }\r
+               }\r
+               else{\r
+                       var io = document.createElement('iframe');\r
+                       io.id = frameId;\r
+                       io.name = frameId;\r
+               }\r
+\r
+               io.style.position = 'absolute';\r
+               io.style.top = '-1000px';\r
+               io.style.left = '-1000px';\r
+\r
+               document.body.appendChild(io);\r
+               YAHOO.log('File upload iframe created. Id is:' + frameId, 'info', 'Connection');\r
+       },\r
+\r
+  /**\r
+   * @description Parses the POST data and creates hidden form elements\r
+   * for each key-value, and appends them to the HTML form object.\r
+   * @method appendPostData\r
+   * @private\r
+   * @static\r
+   * @param {string} postData The HTTP POST data\r
+   * @return {array} formElements Collection of hidden fields.\r
+   */\r
+       appendPostData:function(postData)\r
+       {\r
+               var formElements = new Array();\r
+               var postMessage = postData.split('&');\r
+               for(var i=0; i < postMessage.length; i++){\r
+                       var delimitPos = postMessage[i].indexOf('=');\r
+                       if(delimitPos != -1){\r
+                               formElements[i] = document.createElement('input');\r
+                               formElements[i].type = 'hidden';\r
+                               formElements[i].name = postMessage[i].substring(0,delimitPos);\r
+                               formElements[i].value = postMessage[i].substring(delimitPos+1);\r
+                               this._formNode.appendChild(formElements[i]);\r
+                       }\r
+               }\r
+\r
+               return formElements;\r
+       },\r
+\r
+  /**\r
+   * @description Uploads HTML form, including files/attachments, to the\r
+   * iframe created in createFrame.\r
+   * @method uploadFile\r
+   * @private\r
+   * @static\r
+   * @param {int} id The transaction id.\r
+   * @param {object} callback - User-defined callback object.\r
+   * @param {string} uri Fully qualified path of resource.\r
+   * @return {void}\r
+   */\r
+       uploadFile:function(id, callback, uri, postData){\r
+\r
+               // Each iframe has an id prefix of "yuiIO" followed\r
+               // by the unique transaction id.\r
+               var frameId = 'yuiIO' + id;\r
+               var io = document.getElementById(frameId);\r
+\r
+               // Initialize the HTML form properties in case they are\r
+               // not defined in the HTML form.\r
+               this._formNode.action = uri;\r
+               this._formNode.method = 'POST';\r
+               this._formNode.target = frameId;\r
+\r
+               if(this._formNode.encoding){\r
+                       // IE does not respect property enctype for HTML forms.\r
+                       // Instead use property encoding.\r
+                       this._formNode.encoding = 'multipart/form-data';\r
+               }\r
+               else{\r
+                       this._formNode.enctype = 'multipart/form-data';\r
+               }\r
+\r
+\r
+               if(postData){\r
+                       var oElements = this.appendPostData(postData);\r
+               }\r
+\r
+               this._formNode.submit();\r
+\r
+               if(oElements && oElements.length > 0){\r
+                       for(var i=0; i < oElements.length; i++){\r
+                               this._formNode.removeChild(oElements[i]);\r
+                       }\r
+               }\r
+\r
+               // Reset HTML form status properties.\r
+               this.resetFormState();\r
+\r
+               // Create the upload callback handler that fires when the iframe\r
+               // receives the load event.  Subsequently, the event handler is detached\r
+               // and the iframe removed from the document.\r
+\r
+               var uploadCallback = function()\r
+               {\r
+                       var obj = {};\r
+                       obj.tId = id;\r
+                       obj.argument = callback.argument;\r
+\r
+                       try\r
+                       {\r
+                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;\r
+                               obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;\r
+                       }\r
+                       catch(e){}\r
+\r
+                       if(callback.upload){\r
+                               if(!callback.scope){\r
+                                       callback.upload(obj);\r
+                                       YAHOO.log('Upload callback.', 'info', 'Connection');\r
+                               }\r
+                               else{\r
+                                       callback.upload.apply(callback.scope, [obj]);\r
+                                       YAHOO.log('Upload callback with scope.', 'info', 'Connection');\r
+                               }\r
+                       }\r
+\r
+                       if(YAHOO.util.Event){\r
+                               YAHOO.util.Event.removeListener(io, "load", uploadCallback);\r
+                       }\r
+                       else if(window.detachEvent){\r
+                               io.detachEvent('onload', uploadCallback);\r
+                       }\r
+                       else{\r
+                               io.removeEventListener('load', uploadCallback, false);\r
+                       }\r
+                       setTimeout(\r
+                               function(){\r
+                                       document.body.removeChild(io);\r
+                                       YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');\r
+                               }, 100);\r
+               };\r
+\r
+\r
+               // Bind the onload handler to the iframe to detect the file upload response.\r
+               if(YAHOO.util.Event){\r
+                       YAHOO.util.Event.addListener(io, "load", uploadCallback);\r
+               }\r
+               else if(window.attachEvent){\r
+                       io.attachEvent('onload', uploadCallback);\r
+               }\r
+               else{\r
+                       io.addEventListener('load', uploadCallback, false);\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Method to terminate a transaction, if it has not reached readyState 4.\r
+   * @method abort\r
+   * @public\r
+   * @static\r
+   * @param {object} o The connection object returned by asyncRequest.\r
+   * @param {object} callback  User-defined callback object.\r
+   * @param {string} isTimeout boolean to indicate if abort was a timeout.\r
+   * @return {boolean}\r
+   */\r
+       abort:function(o, callback, isTimeout)\r
+       {\r
+               if(this.isCallInProgress(o)){\r
+                       o.conn.abort();\r
+                       window.clearInterval(this._poll[o.tId]);\r
+                       delete this._poll[o.tId];\r
+                       if(isTimeout){\r
+                               delete this._timeOut[o.tId];\r
+                       }\r
+\r
+                       this.handleTransactionResponse(o, callback, true);\r
+                       YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');\r
+\r
+                       return true;\r
+               }\r
+               else{\r
+                       YAHOO.log('Transaction ' + o.tId + ' abort call failed.', 'warn', 'Connection');\r
+                       return false;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * Public method to check if the transaction is still being processed.\r
+   *\r
+   * @method isCallInProgress\r
+   * @public\r
+   * @static\r
+   * @param {object} o The connection object returned by asyncRequest\r
+   * @return {boolean}\r
+   */\r
+       isCallInProgress:function(o)\r
+       {\r
+               // if the XHR object assigned to the transaction has not been dereferenced,\r
+               // then check its readyState status.  Otherwise, return false.\r
+               if(o.conn){\r
+                       return o.conn.readyState != 4 && o.conn.readyState != 0;\r
+               }\r
+               else{\r
+                       //The XHR object has been destroyed.\r
+                       return false;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.\r
+   * @method releaseObject\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @return {void}\r
+   */\r
+       releaseObject:function(o)\r
+       {\r
+               //dereference the XHR instance.\r
+               o.conn = null;\r
+               YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');\r
+               //dereference the connection object.\r
+               o = null;\r
+       }\r
+};
\ No newline at end of file
index af812ec89264cf5872cf9230be9314f09cbe0e34..95d39ac8b3d33229bf9b0912645c9f6c15fbb5c7 100755 (executable)
@@ -1,12 +1,7 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_default_post_header:true,_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:[],_timeOut:[],_polling_interval:50,_transaction_id:0,setProgId:function(id)\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)\r
 {this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)\r
-{this._default_post_header=b;},setPollingInterval:function(i)\r
+{this._use_default_post_header=b;},setPollingInterval:function(i)\r
 {if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)\r
 {var obj,http;try\r
 {http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}\r
@@ -22,34 +17,34 @@ catch(e){}
 finally\r
 {return o;}},asyncRequest:function(method,uri,callback,postData)\r
 {var o=this.getConnectionObject();if(!o){return null;}\r
-else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri);this.releaseObject(o);return;}\r
-if(method=='GET'){uri+="?"+this._sFormData;}\r
-else if(method=='POST'){postData=this._sFormData;}\r
-this._sFormData='';}\r
-o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._default_post_header)){this.initHeader('Content-Type','application/x-www-form-urlencoded');if(this._isFormSubmit){this._isFormSubmit=false;}}\r
+else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}\r
+if(method=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}\r
+else{uri+="?"+this._sFormData;}}\r
+else if(method=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}\r
+o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}\r
 if(this._has_http_headers){this.setHeader(o);}\r
-this.handleReadyState(o,callback);postData?o.conn.send(postData):o.conn.send(null);return o;}},handleReadyState:function(o,callback)\r
-{var timeOut=callback.timeout;var oConn=this;try\r
-{if(timeOut!==undefined){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true)},timeOut);}\r
-this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}\r
-oConn.handleTransactionResponse(o,callback);}},this._polling_interval);}\r
-catch(e)\r
-{window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}\r
-oConn.handleTransactionResponse(o,callback);}},handleTransactionResponse:function(o,callback,isAbort)\r
+this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)\r
+{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}\r
+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){delete oConn._timeOut[o.tId];}\r
+oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)\r
 {if(!callback){this.releaseObject(o);return;}\r
 var httpStatus,responseObject;try\r
 {if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}\r
 else{httpStatus=13030;}}\r
 catch(e){httpStatus=13030;}\r
-if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}\r
+if(httpStatus>=200&&httpStatus<300){try\r
+{responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}\r
 else{callback.success.apply(callback.scope,[responseObject]);}}}\r
-else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,isAbort);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}\r
+catch(e){}}\r
+else{try\r
+{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);}\r
 else{callback.failure.apply(callback.scope,[responseObject]);}}\r
 break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}\r
 else{callback.failure.apply(callback.scope,[responseObject]);}}}}\r
-this.releaseObject(o);},createResponseObject:function(o,callbackArg)\r
+catch(e){}}\r
+this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)\r
 {var obj={};var headerObj={};try\r
-{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+1);}}}\r
+{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);}}}\r
 catch(e){}\r
 obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=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;}\r
 return obj;},createExceptionObject:function(tId,callbackArg,isAbort)\r
@@ -60,28 +55,45 @@ return obj;},initHeader:function(label,value)
 {if(this._http_header[label]===undefined){this._http_header[label]=value;}\r
 else{this._http_header[label]=value+","+this._http_header[label];}\r
 this._has_http_headers=true;},setHeader:function(o)\r
-{for(var prop in this._http_header){if(this._http_header.propertyIsEnumerable){o.conn.setRequestHeader(prop,this._http_header[prop]);}}\r
+{for(var prop in this._http_header){if(this._http_header.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this._http_header[prop]);}}\r
 delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)\r
-{this._sFormData='';if(typeof formId=='string'){var oForm=(document.getElementById(formId)||document.forms[formId]);}\r
-else if(typeof formId=='object'){var oForm=formId;}\r
+{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}\r
+else if(typeof formId=='object'){oForm=formId;}\r
 else{return;}\r
-if(isUpload){(typeof secureUri=='string')?this.createFrame(secureUri):this.createFrame();this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}\r
-var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)\r
+if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}\r
+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)\r
 {switch(oElement.type)\r
-{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';}}\r
+{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)+'&';}\r
+else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}\r
 break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}\r
 break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}\r
 break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}\r
-this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);},createFrame:function(secureUri){if(window.ActiveXObject){var io=document.createElement('<IFRAME name="ioFrame" id="ioFrame">');if(secureUri){io.src=secureUri;}}\r
-else{var io=document.createElement('IFRAME');io.id='ioFrame';io.name='ioFrame';}\r
-io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},uploadFile:function(id,callback,uri){this._formNode.action=uri;this._formNode.enctype='multipart/form-data';this._formNode.method='POST';this._formNode.target='ioFrame';this._formNode.submit();this._formNode=null;this._isFileUpload=false;this._isFormSubmit=false;var uploadCallback=function()\r
-{var oResponse={tId:id,responseText:document.getElementById("ioFrame").contentWindow.document.body.innerHTML,argument:callback.argument}\r
-if(callback.upload&&!callback.scope){callback.upload(oResponse);}\r
-else{callback.upload.apply(callback.scope,[oResponse]);}\r
-YAHOO.util.Event.removeListener("ioFrame","load",uploadCallback);window.ioFrame.location.replace('#');setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);};YAHOO.util.Event.addListener("ioFrame","load",uploadCallback);},abort:function(o,callback,isTimeout)\r
-{if(this.isCallInProgress(o)){window.clearInterval(this._poll[o.tId]);this._poll.splice(o.tId);if(isTimeout){this._timeOut.splice(o.tId);}\r
-o.conn.abort();this.handleTransactionResponse(o,callback,true);return true;}\r
+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;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}\r
+else if(typeof secureURI=='string'){io.src=secureUri;}}\r
+else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}\r
+io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)\r
+{var formElements=new Array();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]);}}\r
+return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding='multipart/form-data';}\r
+else{this._formNode.enctype='multipart/form-data';}\r
+if(postData){var oElements=this.appendPostData(postData);}\r
+this._formNode.submit();if(oElements&&oElements.length>0){try\r
+{for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}\r
+catch(e){}}\r
+this.resetFormState();var uploadCallback=function()\r
+{var obj={};obj.tId=id;obj.argument=callback.argument;try\r
+{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}\r
+catch(e){}\r
+if(callback.upload){if(!callback.scope){callback.upload(obj);}\r
+else{callback.upload.apply(callback.scope,[obj]);}}\r
+if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}\r
+else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}\r
+else{io.removeEventListener('load',uploadCallback,false);}\r
+setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}\r
+else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}\r
+else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)\r
+{if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){delete this._timeOut[o.tId];}\r
+this.handleTransactionResponse(o,callback,true);return true;}\r
 else{return false;}},isCallInProgress:function(o)\r
 {if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}\r
 else{return false;}},releaseObject:function(o)\r
-{o.conn=null;o=null;}};\r
+{o.conn=null;o=null;}};
\ No newline at end of file
index 670a10600d60fcd5f9f543805cb63caf0d9301a4..58f6d0f12147f8c63bd62abff47d140fbcb5350f 100755 (executable)
-/*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 0.11.0
-*/
-
-/**
- * The Connection Manager provides a simplified interface to the XMLHttpRequest
- * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
- * interactive states and server response, returning the results to a pre-defined
- * callback you create.
- * @ class
- */
-YAHOO.util.Connect =
-{
-/**
-   * Array of MSFT ActiveX ids for XMLHttpRequest.
-   * @private
-   * @type array
-   */
-       _msxml_progid:[
-                       'MSXML2.XMLHTTP.3.0',
-                       'MSXML2.XMLHTTP',
-                       'Microsoft.XMLHTTP'
-                       ],
-
-  /**
-   * Object literal of HTTP header(s)
-   * @private
-   * @type object
-   */
-       _http_header:{},
-
-  /**
-   * Determines if HTTP headers are set.
-   * @private
-   * @type boolean
-   */
-       _has_http_headers:false,
-
- /**
-  * Determines if a default header of
-  * Content-Type of 'application/x-www-form-urlencoded'
-  * will be added to any client HTTP headers sent for POST
-  * transactions.
-  * @private
-  * @type boolean
-  */
-    _default_post_header:true,
-
- /**
-  * Property modified by setForm() to determine if the data
-  * should be submitted as an HTML form.
-  * @private
-  * @type boolean
-  */
-    _isFormSubmit:false,
-
- /**
-  * Property modified by setForm() to determine if a file(s)
-  * upload is expected.
-  * @private
-  * @type boolean
-  */
-    _isFileUpload:false,
-
- /**
-  * Property modified by setForm() to set a reference to the HTML
-  * form node if the desired action is file upload.
-  * @private
-  * @type object
-  */
-    _formNode:null,
-
- /**
-  * Property modified by setForm() to set the HTML form data
-  * for each transaction.
-  * @private
-  * @type string
-  */
-    _sFormData:null,
-
- /**
-  * Collection of polling references to the polling mechanism in handleReadyState.
-  * @private
-  * @type string
-  */
-    _poll:[],
-
- /**
-  * Queue of timeout values for each transaction callback with a defined timeout value.
-  * @private
-  * @type string
-  */
-    _timeOut:[],
-
-  /**
-   * The polling frequency, in milliseconds, for HandleReadyState.
-   * when attempting to determine a transaction's XHR readyState.
-   * The default is 50 milliseconds.
-   * @private
-   * @type int
-   */
-     _polling_interval:50,
-
-  /**
-   * A transaction counter that increments the transaction id for each transaction.
-   * @private
-   * @type int
-   */
-     _transaction_id:0,
-
-  /**
-   * Member to add an ActiveX id to the existing xml_progid array.
-   * In the event(unlikely) a new ActiveX id is introduced, it can be added
-   * without internal code modifications.
-   * @public
-   * @param string id The ActiveX id to be added to initialize the XHR object.
-   * @return void
-   */
-       setProgId:function(id)
-       {
-               this._msxml_progid.unshift(id);
-       },
-
-  /**
-   * Member to enable or disable the default POST header.
-   * @public
-   * @param boolean b Set and use default header - true or false .
-   * @return void
-   */
-       setDefaultPostHeader:function(b)
-       {
-               this._default_post_header = b;
-       },
-
-  /**
-   * Member to modify the default polling interval.
-   * @public
-   * @param {int} i The polling interval in milliseconds.
-   * @return void
-   */
-       setPollingInterval:function(i)
-       {
-               if(typeof i == 'number' && isFinite(i)){
-                               this._polling_interval = i;
-               }
-       },
-
-  /**
-   * Instantiates a XMLHttpRequest object and returns an object with two properties:
-   * the XMLHttpRequest instance and the transaction id.
-   * @private
-   * @param {int} transactionId Property containing the transaction id for this transaction.
-   * @return connection object
-   */
-       createXhrObject:function(transactionId)
-       {
-               var obj,http;
-               try
-               {
-                       // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
-                       http = new XMLHttpRequest();
-                       //  Object literal with http and tId properties
-                       obj = { conn:http, tId:transactionId };
-               }
-               catch(e)
-               {
-                       for(var i=0; i<this._msxml_progid.length; ++i){
-                               try
-                               {
-                                       // Instantiates XMLHttpRequest for IE and assign to http.
-                                       http = new ActiveXObject(this._msxml_progid[i]);
-                                       //  Object literal with http and tId properties
-                                       obj = { conn:http, tId:transactionId };
-                                       break;
-                               }
-                               catch(e){}
-                       }
-               }
-               finally
-               {
-                       return obj;
-               }
-       },
-
-  /**
-   * This method is called by asyncRequest to create a
-   * valid connection object for the transaction.  It also passes a
-   * transaction id and increments the transaction id counter.
-   * @private
-   * @return object
-   */
-       getConnectionObject:function()
-       {
-               var o;
-               var tId = this._transaction_id;
-
-               try
-               {
-                       o = this.createXhrObject(tId);
-                       if(o){
-                               this._transaction_id++;
-                       }
-               }
-               catch(e){}
-               finally
-               {
-                       return o;
-               }
-       },
-
-  /**
-   * Method for initiating an asynchronous request via the XHR object.
-   * @public
-   * @param {string} method HTTP transaction method
-   * @param {string} uri Fully qualified path of resource
-   * @param callback User-defined callback function or object
-   * @param {string} postData POST body
-   * @return {object} Returns the connection object
-   */
-       asyncRequest:function(method, uri, callback, postData)
-       {
-               var o = this.getConnectionObject();
-
-               if(!o){
-                       return null;
-               }
-               else{
-                       if(this._isFormSubmit){
-                               if(this._isFileUpload){
-                                       this.uploadFile(o.tId, callback, uri);
-                                       this.releaseObject(o);
-                                       return;
-                               }
-
-                               //If the specified HTTP method is GET, setForm() will return an
-                               //encoded string that is concatenated to the uri to
-                               //create a querystring.
-                               if(method == 'GET'){
-                                       uri += "?" +  this._sFormData;
-                               }
-                               else if(method == 'POST'){
-                                       postData =  this._sFormData;
-                               }
-                               this._sFormData = '';
-                       }
-
-                       o.conn.open(method, uri, true);
-
-                       if(this._isFormSubmit || (postData && this._default_post_header)){
-                               this.initHeader('Content-Type','application/x-www-form-urlencoded');
-                               if(this._isFormSubmit){
-                                       this._isFormSubmit = false;
-                               }
-                       }
-
-                       //Verify whether the transaction has any user-defined HTTP headers
-                       //and set them.
-                       if(this._has_http_headers){
-                               this.setHeader(o);
-                       }
-
-                       this.handleReadyState(o, callback);
-                       postData?o.conn.send(postData):o.conn.send(null);
-
-                       return o;
-               }
-       },
-
-  /**
-   * This method serves as a timer that polls the XHR object's readyState
-   * property during a transaction, instead of binding a callback to the
-   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse
-   * will process the response, and the timer will be cleared.
-   *
-   * @private
-   * @param {object} o The connection object
-   * @param callback User-defined callback object
-   * @return void
-   */
-    handleReadyState:function(o, callback)
-    {
-        var timeOut = callback.timeout;
-        var oConn = this;
-
-        try
-        {
-            if(timeOut !== undefined){
-               this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
-            }
-            this._poll[o.tId] = window.setInterval(
-                function(){
-                                       if(o.conn && o.conn.readyState == 4){
-                                               window.clearInterval(oConn._poll[o.tId]);
-                                               oConn._poll.splice(o.tId);
-                                               if(timeOut){
-                                                       oConn._timeOut.splice(o.tId);
-                                               }
-
-                                               oConn.handleTransactionResponse(o, callback);
-                    }
-                }
-            ,this._polling_interval);
-        }
-        catch(e)
-        {
-            window.clearInterval(oConn._poll[o.tId]);
-            oConn._poll.splice(o.tId);
-                       if(timeOut){
-                               oConn._timeOut.splice(o.tId);
-                       }
-
-            oConn.handleTransactionResponse(o, callback);
-        }
-    },
-
-  /**
-   * This method attempts to interpret the server response and
-   * determine whether the transaction was successful, or if an error or
-   * exception was encountered.
-   *
-   * @private
-   * @param {object} o The connection object
-   * @param {object} callback - User-defined callback object
-   * @param {boolean} determines if the transaction was aborted.
-   * @return void
-   */
-    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;
-
-               try
-               {
-                       if(o.conn.status !== undefined && o.conn.status != 0){
-                               httpStatus = o.conn.status;
-                       }
-                       else{
-                               httpStatus = 13030;
-                       }
-               }
-               catch(e){
-                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                       // when the o object's status and statusText properties are
-                       // unavailable, and a query attempt throws an exception.
-                       httpStatus = 13030;
-               }
-
-               if(httpStatus >= 200 && httpStatus < 300){
-                       responseObject = this.createResponseObject(o, callback.argument);
-                       if(callback.success){
-                               if(!callback.scope){
-                                       callback.success(responseObject);
-                               }
-                               else{
-                                       // If a scope property is defined, the callback will be fired from
-                                       // the context of the object.
-                                       callback.success.apply(callback.scope, [responseObject]);
-                               }
-                       }
-               }
-               else{
-                       switch(httpStatus){
-                               // The following case labels are wininet.dll error codes that may be encountered.
-                               // Server timeout
-                               case 12002:
-                               // 12029 to 12031 correspond to dropped connections.
-                               case 12029:
-                               case 12030:
-                               case 12031:
-                               // Connection closed by server.
-                               case 12152:
-                               // See above comments for variable status.
-                               case 13030:
-                                       responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
-                                       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.releaseObject(o);
-    },
-
-  /**
-   * This method evaluates the server response, creates and returns the results via
-   * its properties.  Success and failure cases will differ in the response
-   * object's property values.
-   * @private
-   * @param {object} o The connection object
-   * @param {} callbackArg User-defined argument or arguments to be passed to the callback
-   * @return object
-   */
-    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+1);
-                               }
-                       }
-               }
-               catch(e){}
-
-               obj.tId = o.tId;
-               obj.status = o.conn.status;
-               obj.statusText = 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;
-    },
-
-  /**
-   * If a transaction cannot be completed due to dropped or closed connections,
-   * there may be not be enough information to build a full response object.
-   * The failure callback will be fired and this specific condition can be identified
-   * by a status property value of 0.
-   *
-   * If an abort was successful, the status property will report a value of -1.
-   *
-   * @private
-   * @param {int} tId Transaction Id
-   * @param callbackArg The user-defined arguments
-   * @param isAbort Determines if the exception is an abort.
-   * @return object
-   */
-    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;
-    },
-
-  /**
-   * Public method that stores the custom HTTP headers for each transaction.
-   * @public
-   * @param {string} label The HTTP header label
-   * @param {string} value The HTTP header value
-   * @return void
-   */
-       initHeader:function(label,value)
-       {
-               if(this._http_header[label] === undefined){
-                       this._http_header[label] = value;
-               }
-               else{
-                       this._http_header[label] =  value + "," + this._http_header[label];
-               }
-
-               this._has_http_headers = true;
-       },
-
-  /**
-   * Accessor that sets the HTTP headers for each transaction.
-   * @private
-   * @param {object} o The connection object for the transaction.
-   * @return void
-   */
-       setHeader:function(o)
-       {
-               for(var prop in this._http_header){
-                       if(this._http_header.propertyIsEnumerable){
-                               o.conn.setRequestHeader(prop, this._http_header[prop]);
-                       }
-               }
-               delete this._http_header;
-
-               this._http_header = {};
-               this._has_http_headers = false;
-       },
-
-  /**
-   * This method assembles the form label and value pairs and
-   * constructs an encoded string.
-   * asyncRequest() will automatically initialize the
-   * transaction with a HTTP header Content-Type of
-   * application/x-www-form-urlencoded.
-   * @public
-   * @param {string || object} form id or name attribute, or form object.
-   * @param {string} optional boolean to indicate SSL environment.
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return void
-   */
-       setForm:function(formId, isUpload, secureUri)
-       {
-               this._sFormData = '';
-               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.
-                       var oForm = (document.getElementById(formId) || document.forms[formId]);
-               }
-               else if(typeof formId == 'object'){
-                       var oForm = formId;
-               }
-               else{
-                       return;
-               }
-
-               // If the isUpload argument is true, setForm will call createFrame to initialize
-               // an iframe as the form target.
-               //
-               // The argument secureURI is also required by IE in SSL environments
-               // where the secureURI string is a fully qualified HTTP path, used to set the source
-               // of the iframe, to a stub resource in the same domain.
-               if(isUpload){
-                       (typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
-                       this._isFormSubmit = true;
-                       this._isFileUpload = true;
-                       this._formNode = oForm;
-
-                       return;
-               }
-
-               var oElement, oName, oValue, oDisabled;
-               var hasSubmit = false;
-
-               // Iterate over the form elements collection to construct the
-               // label-value pairs.
-               for (var i=0; i<oForm.elements.length; i++){
-                       oDisabled = oForm.elements[i].disabled;
-
-                       // If the name attribute is not populated, the form field's
-                       // value will not be submitted.
-                       oElement = oForm.elements[i];
-                       oName = oForm.elements[i].name;
-                       oValue = oForm.elements[i].value;
-
-                       // Do not submit fields that are disabled or
-                       // do not have a name attribute 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){
-                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(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':
-                                               // stub case as XMLHttpRequest will only send the file path as a string.
-                                       case undefined:
-                                               // stub case for fieldset element which returns undefined.
-                                       case 'reset':
-                                               // stub case for input type reset button.
-                                       case 'button':
-                                               // stub case for input type button elements.
-                                               break;
-                                       case 'submit':
-                                               if(hasSubmit == false){
-                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                                       hasSubmit = true;
-                                               }
-                                               break;
-                                       default:
-                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                               break;
-                               }
-                       }
-               }
-
-               this._isFormSubmit = true;
-               this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
-       },
-
-  /**
-   * Creates an iframe to be used for form file uploads.  It is remove from the
-   * document upon completion of the upload transaction.
-   *
-   * @private
-   * @param {string} optional qualified path of iframe resource for SSL in IE.
-   * @return void
-   */
-       createFrame:function(secureUri){
-
-               // IE does not allow the setting of id and name attributes as DOM
-               // properties.  A different iframe creation pattern is required for IE.
-               if(window.ActiveXObject){
-                       var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
-                       if(secureUri){
-                               // IE will throw a security exception in an SSL environment if the
-                               // iframe source isn't set to a valid resource.
-                               io.src = secureUri;
-                       }
-               }
-               else{
-                       var io = document.createElement('IFRAME');
-                       io.id = 'ioFrame';
-                       io.name = 'ioFrame';
-               }
-
-               io.style.position = 'absolute';
-               io.style.top = '-1000px';
-               io.style.left = '-1000px';
-
-               document.body.appendChild(io);
-       },
-
-  /**
-   * Uploads HTML form, including files/attachments,  targeting the
-   * iframe created in createFrame.
-   *
-   * @private
-   * @param {int} id The transaction id.
-   * @param {object} callback - User-defined callback object.
-   * @param {string} uri Fully qualified path of resource.
-   * @return void
-   */
-       uploadFile:function(id, callback, uri){
-               // Initialize the HTML form properties in case they are
-               // not defined in the HTML form.
-               this._formNode.action = uri;
-               this._formNode.enctype = 'multipart/form-data';
-               this._formNode.method = 'POST';
-               this._formNode.target = 'ioFrame';
-               this._formNode.submit();
-
-               // Reset form status properties.
-               this._formNode = null;
-               this._isFileUpload = false;
-               this._isFormSubmit = false;
-
-               // Create the upload callback handler that fires when the iframe
-               // receives the load event.  Subsequently, the event handler is detached
-               // and the iframe removed from the document.
-
-               var uploadCallback = function()
-               {
-                       var oResponse =
-                       {
-                               tId: id,
-                               responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
-                               argument: callback.argument
-                       }
-
-                       if(callback.upload && !callback.scope){
-                               callback.upload(oResponse);
-                       }
-                       else{
-                               callback.upload.apply(callback.scope, [oResponse]);
-                       }
-
-                       YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
-                       window.ioFrame.location.replace('#');
-                       setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
-               };
-
-               // Bind the onload handler to the iframe to detect the file upload response.
-               YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
-       },
-
-  /**
-   * Public method to terminate a transaction, if it has not reached readyState 4.
-   * @public
-   * @param {object} o The connection object returned by asyncRequest.
-   * @param {object} callback  User-defined callback object.
-   * @param {string} isTimeout boolean to indicate if abort was a timeout.
-   * @return void
-   */
-       abort:function(o, callback, isTimeout)
-       {
-               if(this.isCallInProgress(o)){
-                       window.clearInterval(this._poll[o.tId]);
-                       this._poll.splice(o.tId);
-                       if(isTimeout){
-                               this._timeOut.splice(o.tId);
-                       }
-                       o.conn.abort();
-                       this.handleTransactionResponse(o, callback, true);
-
-                       return true;
-               }
-               else{
-                       return false;
-               }
-       },
-
-  /**
-   * Public method to check if the transaction is still being processed.
-   * @public
-   * @param {object} o The connection object returned by asyncRequest
-   * @return boolean
-   */
-       isCallInProgress:function(o)
-       {
-               // if the XHR object assigned to the transaction has not been dereferenced,
-               // then check its readyState status.  Otherwise, return false.
-               if(o.conn){
-                       return o.conn.readyState != 4 && o.conn.readyState != 0;
-               }
-               else{
-                       //The XHR object has been destroyed.
-                       return false;
-               }
-       },
-
-  /**
-   * Dereference the XHR instance and the connection object after the transaction is completed.
-   * @private
-   * @param {object} o The connection object
-   * @return void
-   */
-       releaseObject:function(o)
-       {
-               //dereference the XHR instance.
-               o.conn = null;
-               //dereference the connection object.
-               o = null;
-       }
-};
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+\r
+/**\r
+ * @description\r
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest\r
+ * object.  It handles cross-browser instantiantion of XMLHttpRequest, negotiates the\r
+ * interactive states and server response, returning the results to a pre-defined\r
+ * callback you create.\r
+ *\r
+ * @namespace YAHOO.util\r
+ * @module Connection\r
+ * @Class Connect\r
+ */\r
+YAHOO.util.Connect =\r
+{\r
+  /**\r
+   * @description Array of MSFT ActiveX ids for XMLHttpRequest.\r
+   * @property _msxml_progid\r
+   * @private\r
+   * @static\r
+   * @type array\r
+   */\r
+       _msxml_progid:[\r
+               'MSXML2.XMLHTTP.3.0',\r
+               'MSXML2.XMLHTTP',\r
+               'Microsoft.XMLHTTP'\r
+               ],\r
+\r
+  /**\r
+   * @description Object literal of HTTP header(s)\r
+   * @property _http_header\r
+   * @private\r
+   * @static\r
+   * @type object\r
+   */\r
+       _http_header:{},\r
+\r
+  /**\r
+   * @description Determines if HTTP headers are set.\r
+   * @property _has_http_headers\r
+   * @private\r
+   * @static\r
+   * @type boolean\r
+   */\r
+       _has_http_headers:false,\r
+\r
+ /**\r
+  * @description Determines if a default header of\r
+  * Content-Type of 'application/x-www-form-urlencoded'\r
+  * will be added to any client HTTP headers sent for POST\r
+  * transactions.\r
+  * @property _use_default_post_header\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _use_default_post_header:true,\r
+\r
+ /**\r
+  * @description Determines if a default header of\r
+  * Content-Type of 'application/x-www-form-urlencoded'\r
+  * will be added to any client HTTP headers sent for POST\r
+  * transactions.\r
+  * @property _default_post_header\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _default_post_header:'application/x-www-form-urlencoded',\r
+\r
+ /**\r
+  * @description Property modified by setForm() to determine if the data\r
+  * should be submitted as an HTML form.\r
+  * @property _isFormSubmit\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _isFormSubmit:false,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to determine if a file(s)\r
+  * upload is expected.\r
+  * @property _isFileUpload\r
+  * @private\r
+  * @static\r
+  * @type boolean\r
+  */\r
+    _isFileUpload:false,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to set a reference to the HTML\r
+  * form node if the desired action is file upload.\r
+  * @property _formNode\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _formNode:null,\r
+\r
+ /**\r
+  * @description Property modified by setForm() to set the HTML form data\r
+  * for each transaction.\r
+  * @property _sFormData\r
+  * @private\r
+  * @static\r
+  * @type string\r
+  */\r
+    _sFormData:null,\r
+\r
+ /**\r
+  * @description Collection of polling references to the polling mechanism in handleReadyState.\r
+  * @property _poll\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _poll:{},\r
+\r
+ /**\r
+  * @description Queue of timeout values for each transaction callback with a defined timeout value.\r
+  * @property _timeOut\r
+  * @private\r
+  * @static\r
+  * @type object\r
+  */\r
+    _timeOut:{},\r
+\r
+  /**\r
+   * @description The polling frequency, in milliseconds, for HandleReadyState.\r
+   * when attempting to determine a transaction's XHR readyState.\r
+   * The default is 50 milliseconds.\r
+   * @property _polling_interval\r
+   * @private\r
+   * @static\r
+   * @type int\r
+   */\r
+     _polling_interval:50,\r
+\r
+  /**\r
+   * @description A transaction counter that increments the transaction id for each transaction.\r
+   * @property _transaction_id\r
+   * @private\r
+   * @static\r
+   * @type int\r
+   */\r
+     _transaction_id:0,\r
+\r
+  /**\r
+   * @description Member to add an ActiveX id to the existing xml_progid array.\r
+   * In the event(unlikely) a new ActiveX id is introduced, it can be added\r
+   * without internal code modifications.\r
+   * @method setProgId\r
+   * @public\r
+   * @static\r
+   * @param {string} id The ActiveX id to be added to initialize the XHR object.\r
+   * @return void\r
+   */\r
+       setProgId:function(id)\r
+       {\r
+               this._msxml_progid.unshift(id);\r
+       },\r
+\r
+  /**\r
+   * @description Member to enable or disable the default POST header.\r
+   * @method setDefaultPostHeader\r
+   * @public\r
+   * @static\r
+   * @param {boolean} b Set and use default header - true or false .\r
+   * @return void\r
+   */\r
+       setDefaultPostHeader:function(b)\r
+       {\r
+               this._use_default_post_header = b;\r
+       },\r
+\r
+  /**\r
+   * @description Member to modify the default polling interval.\r
+   * @method setPollingInterval\r
+   * @public\r
+   * @static\r
+   * @param {int} i The polling interval in milliseconds.\r
+   * @return void\r
+   */\r
+       setPollingInterval:function(i)\r
+       {\r
+               if(typeof i == 'number' && isFinite(i)){\r
+                       this._polling_interval = i;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Instantiates a XMLHttpRequest object and returns an object with two properties:\r
+   * the XMLHttpRequest instance and the transaction id.\r
+   * @method createXhrObject\r
+   * @private\r
+   * @static\r
+   * @param {int} transactionId Property containing the transaction id for this transaction.\r
+   * @return object\r
+   */\r
+       createXhrObject:function(transactionId)\r
+       {\r
+               var obj,http;\r
+               try\r
+               {\r
+                       // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.\r
+                       http = new XMLHttpRequest();\r
+                       //  Object literal with http and tId properties\r
+                       obj = { conn:http, tId:transactionId };\r
+               }\r
+               catch(e)\r
+               {\r
+                       for(var i=0; i<this._msxml_progid.length; ++i){\r
+                               try\r
+                               {\r
+                                       // Instantiates XMLHttpRequest for IE and assign to http.\r
+                                       http = new ActiveXObject(this._msxml_progid[i]);\r
+                                       //  Object literal with conn and tId properties\r
+                                       obj = { conn:http, tId:transactionId };\r
+                                       break;\r
+                               }\r
+                               catch(e){}\r
+                       }\r
+               }\r
+               finally\r
+               {\r
+                       return obj;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description This method is called by asyncRequest to create a\r
+   * valid connection object for the transaction.  It also passes a\r
+   * transaction id and increments the transaction id counter.\r
+   * @method getConnectionObject\r
+   * @private\r
+   * @static\r
+   * @return {object}\r
+   */\r
+       getConnectionObject:function()\r
+       {\r
+               var o;\r
+               var tId = this._transaction_id;\r
+\r
+               try\r
+               {\r
+                       o = this.createXhrObject(tId);\r
+                       if(o){\r
+                               this._transaction_id++;\r
+                       }\r
+               }\r
+               catch(e){}\r
+               finally\r
+               {\r
+                       return o;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Method for initiating an asynchronous request via the XHR object.\r
+   * @method asyncRequest\r
+   * @public\r
+   * @static\r
+   * @param {string} method HTTP transaction method\r
+   * @param {string} uri Fully qualified path of resource\r
+   * @param {callback} callback User-defined callback function or object\r
+   * @param {string} postData POST body\r
+   * @return {object} Returns the connection object\r
+   */\r
+       asyncRequest:function(method, uri, callback, postData)\r
+       {\r
+               var o = this.getConnectionObject();\r
+\r
+               if(!o){\r
+                       return null;\r
+               }\r
+               else{\r
+                       if(this._isFormSubmit){\r
+                               if(this._isFileUpload){\r
+                                       this.uploadFile(o.tId, callback, uri, postData);\r
+                                       this.releaseObject(o);\r
+\r
+                                       return;\r
+                               }\r
+\r
+                               //If the specified HTTP method is GET, setForm() will return an\r
+                               //encoded string that is concatenated to the uri to\r
+                               //create a querystring.\r
+                               if(method == 'GET'){\r
+                                       if(this._sFormData.length != 0){\r
+                                               // If the URI already contains a querystring, append an ampersand\r
+                                               // and then concatenate _sFormData to the URI.\r
+                                               uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;\r
+                                       }\r
+                                       else{\r
+                                               uri += "?" + this._sFormData;\r
+                                       }\r
+                               }\r
+                               else if(method == 'POST'){\r
+                                       //If POST data exist in addition to the HTML form data,\r
+                                       //it will be concatenated to the form data.\r
+                                       postData = postData?this._sFormData + "&" + postData:this._sFormData;\r
+                               }\r
+                       }\r
+\r
+                       o.conn.open(method, uri, true);\r
+\r
+                       if(this._isFormSubmit || (postData && this._use_default_post_header)){\r
+                               this.initHeader('Content-Type', this._default_post_header);\r
+                               if(this._isFormSubmit){\r
+                                       this.resetFormState();\r
+                               }\r
+                       }\r
+\r
+                       if(this._has_http_headers){\r
+                               this.setHeader(o);\r
+                       }\r
+\r
+                       this.handleReadyState(o, callback);\r
+                       o.conn.send(postData || null);\r
+\r
+                       return o;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description This method serves as a timer that polls the XHR object's readyState\r
+   * property during a transaction, instead of binding a callback to the\r
+   * onreadystatechange event.  Upon readyState 4, handleTransactionResponse\r
+   * will process the response, and the timer will be cleared.\r
+   * @method handleReadyState\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {callback} callback The user-defined callback object\r
+   * @return {void}\r
+   */\r
+    handleReadyState:function(o, callback)\r
+    {\r
+               var oConn = this;\r
+\r
+               if(callback && callback.timeout){\r
+                       this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);\r
+               }\r
+\r
+               this._poll[o.tId] = window.setInterval(\r
+                       function(){\r
+                               if(o.conn && o.conn.readyState == 4){\r
+                                       window.clearInterval(oConn._poll[o.tId]);\r
+                                       delete oConn._poll[o.tId];\r
+\r
+                                       if(callback && callback.timeout){\r
+                                               delete oConn._timeOut[o.tId];\r
+                                       }\r
+\r
+                                       oConn.handleTransactionResponse(o, callback);\r
+                               }\r
+                       }\r
+               ,this._polling_interval);\r
+    },\r
+\r
+  /**\r
+   * @description This method attempts to interpret the server response and\r
+   * determine whether the transaction was successful, or if an error or\r
+   * exception was encountered.\r
+   * @method handleTransactionResponse\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {object} callback The sser-defined callback object\r
+   * @param {boolean} isAbort Determines if the transaction was aborted.\r
+   * @return {void}\r
+   */\r
+    handleTransactionResponse:function(o, callback, isAbort)\r
+    {\r
+               // If no valid callback is provided, then do not process any callback handling.\r
+               if(!callback){\r
+                       this.releaseObject(o);\r
+                       return;\r
+               }\r
+\r
+               var httpStatus, responseObject;\r
+\r
+               try\r
+               {\r
+                       if(o.conn.status !== undefined && o.conn.status != 0){\r
+                               httpStatus = o.conn.status;\r
+                       }\r
+                       else{\r
+                               httpStatus = 13030;\r
+                       }\r
+               }\r
+               catch(e){\r
+                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --\r
+                       // when the o object's status and statusText properties are\r
+                       // unavailable, and a query attempt throws an exception.\r
+                       httpStatus = 13030;\r
+               }\r
+\r
+               if(httpStatus >= 200 && httpStatus < 300){\r
+                       try\r
+                       {\r
+                               responseObject = this.createResponseObject(o, callback.argument);\r
+                               if(callback.success){\r
+                                       if(!callback.scope){\r
+                                               callback.success(responseObject);\r
+                                       }\r
+                                       else{\r
+                                               // If a scope property is defined, the callback will be fired from\r
+                                               // the context of the object.\r
+                                               callback.success.apply(callback.scope, [responseObject]);\r
+                                       }\r
+                               }\r
+                       }\r
+                       catch(e){}\r
+               }\r
+               else{\r
+                       try\r
+                       {\r
+                               switch(httpStatus){\r
+                                       // The following cases are wininet.dll error codes that may be encountered.\r
+                                       case 12002: // Server timeout\r
+                                       case 12029: // 12029 to 12031 correspond to dropped connections.\r
+                                       case 12030:\r
+                                       case 12031:\r
+                                       case 12152: // Connection closed by server.\r
+                                       case 13030: // See above comments for variable status.\r
+                                               responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));\r
+                                               if(callback.failure){\r
+                                                       if(!callback.scope){\r
+                                                               callback.failure(responseObject);\r
+                                                       }\r
+                                                       else{\r
+                                                               callback.failure.apply(callback.scope, [responseObject]);\r
+                                                       }\r
+                                               }\r
+                                               break;\r
+                                       default:\r
+                                               responseObject = this.createResponseObject(o, callback.argument);\r
+                                               if(callback.failure){\r
+                                                       if(!callback.scope){\r
+                                                               callback.failure(responseObject);\r
+                                                       }\r
+                                                       else{\r
+                                                               callback.failure.apply(callback.scope, [responseObject]);\r
+                                                       }\r
+                                               }\r
+                               }\r
+                       }\r
+                       catch(e){}\r
+               }\r
+\r
+               this.releaseObject(o);\r
+               responseObject = null;\r
+    },\r
+\r
+  /**\r
+   * @description This method evaluates the server response, creates and returns the results via\r
+   * its properties.  Success and failure cases will differ in the response\r
+   * object's property values.\r
+   * @method createResponseObject\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback\r
+   * @return {object}\r
+   */\r
+    createResponseObject:function(o, callbackArg)\r
+    {\r
+               var obj = {};\r
+               var headerObj = {};\r
+\r
+               try\r
+               {\r
+                       var headerStr = o.conn.getAllResponseHeaders();\r
+                       var header = headerStr.split('\n');\r
+                       for(var i=0; i<header.length; i++){\r
+                               var delimitPos = header[i].indexOf(':');\r
+                               if(delimitPos != -1){\r
+                                       headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);\r
+                               }\r
+                       }\r
+               }\r
+               catch(e){}\r
+\r
+               obj.tId = o.tId;\r
+               obj.status = o.conn.status;\r
+               obj.statusText = o.conn.statusText;\r
+               obj.getResponseHeader = headerObj;\r
+               obj.getAllResponseHeaders = headerStr;\r
+               obj.responseText = o.conn.responseText;\r
+               obj.responseXML = o.conn.responseXML;\r
+\r
+               if(typeof callbackArg !== undefined){\r
+                       obj.argument = callbackArg;\r
+               }\r
+\r
+               return obj;\r
+    },\r
+\r
+  /**\r
+   * @description If a transaction cannot be completed due to dropped or closed connections,\r
+   * there may be not be enough information to build a full response object.\r
+   * The failure callback will be fired and this specific condition can be identified\r
+   * by a status property value of 0.\r
+   *\r
+   * If an abort was successful, the status property will report a value of -1.\r
+   *\r
+   * @method createExceptionObject\r
+   * @private\r
+   * @static\r
+   * @param {int} tId The Transaction Id\r
+   * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback\r
+   * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort\r
+   * @return {object}\r
+   */\r
+    createExceptionObject:function(tId, callbackArg, isAbort)\r
+    {\r
+               var COMM_CODE = 0;\r
+               var COMM_ERROR = 'communication failure';\r
+               var ABORT_CODE = -1;\r
+               var ABORT_ERROR = 'transaction aborted';\r
+\r
+               var obj = {};\r
+\r
+               obj.tId = tId;\r
+               if(isAbort){\r
+                       obj.status = ABORT_CODE;\r
+                       obj.statusText = ABORT_ERROR;\r
+               }\r
+               else{\r
+                       obj.status = COMM_CODE;\r
+                       obj.statusText = COMM_ERROR;\r
+               }\r
+\r
+               if(callbackArg){\r
+                       obj.argument = callbackArg;\r
+               }\r
+\r
+               return obj;\r
+    },\r
+\r
+  /**\r
+   * @description Public method that stores the custom HTTP headers for each transaction.\r
+   * @method initHeader\r
+   * @public\r
+   * @static\r
+   * @param {string} label The HTTP header label\r
+   * @param {string} value The HTTP header value\r
+   * @return {void}\r
+   */\r
+       initHeader:function(label,value)\r
+       {\r
+               if(this._http_header[label] === undefined){\r
+                       this._http_header[label] = value;\r
+               }\r
+               else{\r
+                       // Concatenate multiple values, comma-delimited,\r
+                       // for the same header label,\r
+                       this._http_header[label] =  value + "," + this._http_header[label];\r
+               }\r
+\r
+               this._has_http_headers = true;\r
+       },\r
+\r
+  /**\r
+   * @description Accessor that sets the HTTP headers for each transaction.\r
+   * @method setHeader\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object for the transaction.\r
+   * @return {void}\r
+   */\r
+       setHeader:function(o)\r
+       {\r
+               for(var prop in this._http_header){\r
+                       if(this._http_header.hasOwnProperty(prop)){\r
+                               o.conn.setRequestHeader(prop, this._http_header[prop]);\r
+                       }\r
+               }\r
+               delete this._http_header;\r
+\r
+               this._http_header = {};\r
+               this._has_http_headers = false;\r
+       },\r
+\r
+  /**\r
+   * @description This method assembles the form label and value pairs and\r
+   * constructs an encoded string.\r
+   * asyncRequest() will automatically initialize the\r
+   * transaction with a HTTP header Content-Type of\r
+   * application/x-www-form-urlencoded.\r
+   * @method setForm\r
+   * @public\r
+   * @static\r
+   * @param {string || object} form id or name attribute, or form object.\r
+   * @param {string} optional boolean to indicate SSL environment.\r
+   * @param {string || boolean} optional qualified path of iframe resource for SSL in IE.\r
+   * @return {string} string of the HTML form field name and value pairs..\r
+   */\r
+       setForm:function(formId, isUpload, secureUri)\r
+       {\r
+               this.resetFormState();\r
+               var oForm;\r
+               if(typeof formId == 'string'){\r
+                       // Determine if the argument is a form id or a form name.\r
+                       // Note form name usage is deprecated by supported\r
+                       // here for legacy reasons.\r
+                       oForm = (document.getElementById(formId) || document.forms[formId]);\r
+               }\r
+               else if(typeof formId == 'object'){\r
+                       // Treat argument as an HTML form object.\r
+                       oForm = formId;\r
+               }\r
+               else{\r
+                       return;\r
+               }\r
+\r
+               // If the isUpload argument is true, setForm will call createFrame to initialize\r
+               // an iframe as the form target.\r
+               //\r
+               // The argument secureURI is also required by IE in SSL environments\r
+               // where the secureURI string is a fully qualified HTTP path, used to set the source\r
+               // of the iframe, to a stub resource in the same domain.\r
+               if(isUpload){\r
+\r
+                       // Create iframe in preparation for file upload.\r
+                       this.createFrame(secureUri?secureUri:null);\r
+\r
+                       // Set form reference and file upload properties to true.\r
+                       this._isFormSubmit = true;\r
+                       this._isFileUpload = true;\r
+                       this._formNode = oForm;\r
+\r
+                       return;\r
+               }\r
+\r
+               var oElement, oName, oValue, oDisabled;\r
+               var hasSubmit = false;\r
+\r
+               // Iterate over the form elements collection to construct the\r
+               // label-value pairs.\r
+               for (var i=0; i<oForm.elements.length; i++){\r
+                       oElement = oForm.elements[i];\r
+                       oDisabled = oForm.elements[i].disabled;\r
+                       oName = oForm.elements[i].name;\r
+                       oValue = oForm.elements[i].value;\r
+\r
+                       // Do not submit fields that are disabled or\r
+                       // do not have a name attribute value.\r
+                       if(!oDisabled && oName)\r
+                       {\r
+                               switch (oElement.type)\r
+                               {\r
+                                       case 'select-one':\r
+                                       case 'select-multiple':\r
+                                               for(var j=0; j<oElement.options.length; j++){\r
+                                                       if(oElement.options[j].selected){\r
+                                                               if(window.ActiveXObject){\r
+                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';\r
+                                                               }\r
+                                                               else{\r
+                                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';\r
+                                                               }\r
+\r
+                                                       }\r
+                                               }\r
+                                               break;\r
+                                       case 'radio':\r
+                                       case 'checkbox':\r
+                                               if(oElement.checked){\r
+                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                               }\r
+                                               break;\r
+                                       case 'file':\r
+                                               // stub case as XMLHttpRequest will only send the file path as a string.\r
+                                       case undefined:\r
+                                               // stub case for fieldset element which returns undefined.\r
+                                       case 'reset':\r
+                                               // stub case for input type reset button.\r
+                                       case 'button':\r
+                                               // stub case for input type button elements.\r
+                                               break;\r
+                                       case 'submit':\r
+                                               if(hasSubmit == false){\r
+                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                                       hasSubmit = true;\r
+                                               }\r
+                                               break;\r
+                                       default:\r
+                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';\r
+                                               break;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               this._isFormSubmit = true;\r
+               this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);\r
+\r
+               return this._sFormData;\r
+       },\r
+\r
+  /**\r
+   * @description Resets HTML form properties when an HTML form or HTML form\r
+   * with file upload transaction is sent.\r
+   * @method resetFormState\r
+   * @private\r
+   * @static\r
+   * @return {void}\r
+   */\r
+       resetFormState:function(){\r
+               this._isFormSubmit = false;\r
+               this._isFileUpload = false;\r
+               this._formNode = null;\r
+               this._sFormData = "";\r
+       },\r
+\r
+  /**\r
+   * @description Creates an iframe to be used for form file uploads.  It is remove from the\r
+   * document upon completion of the upload transaction.\r
+   * @method createFrame\r
+   * @private\r
+   * @static\r
+   * @param {string} secureUri Optional qualified path of iframe resource for SSL in IE.\r
+   * @return {void}\r
+   */\r
+       createFrame:function(secureUri){\r
+\r
+               // IE does not allow the setting of id and name attributes as object\r
+               // properties via createElement().  A different iframe creation\r
+               // pattern is required for IE.\r
+               var frameId = 'yuiIO' + this._transaction_id;\r
+               if(window.ActiveXObject){\r
+                       var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');\r
+\r
+                       // IE will throw a security exception in an SSL environment if the\r
+                       // iframe source is undefined.\r
+                       if(typeof secureUri == 'boolean'){\r
+                               io.src = 'javascript:false';\r
+                       }\r
+                       else if(typeof secureURI == 'string'){\r
+                               // Deprecated\r
+                               io.src = secureUri;\r
+                       }\r
+               }\r
+               else{\r
+                       var io = document.createElement('iframe');\r
+                       io.id = frameId;\r
+                       io.name = frameId;\r
+               }\r
+\r
+               io.style.position = 'absolute';\r
+               io.style.top = '-1000px';\r
+               io.style.left = '-1000px';\r
+\r
+               document.body.appendChild(io);\r
+       },\r
+\r
+  /**\r
+   * @description Parses the POST data and creates hidden form elements\r
+   * for each key-value, and appends them to the HTML form object.\r
+   * @method appendPostData\r
+   * @private\r
+   * @static\r
+   * @param {string} postData The HTTP POST data\r
+   * @return {array} formElements Collection of hidden fields.\r
+   */\r
+       appendPostData:function(postData)\r
+       {\r
+               var formElements = new Array();\r
+               var postMessage = postData.split('&');\r
+               for(var i=0; i < postMessage.length; i++){\r
+                       var delimitPos = postMessage[i].indexOf('=');\r
+                       if(delimitPos != -1){\r
+                               formElements[i] = document.createElement('input');\r
+                               formElements[i].type = 'hidden';\r
+                               formElements[i].name = postMessage[i].substring(0,delimitPos);\r
+                               formElements[i].value = postMessage[i].substring(delimitPos+1);\r
+                               this._formNode.appendChild(formElements[i]);\r
+                       }\r
+               }\r
+\r
+               return formElements;\r
+       },\r
+\r
+  /**\r
+   * @description Uploads HTML form, including files/attachments, to the\r
+   * iframe created in createFrame.\r
+   * @method uploadFile\r
+   * @private\r
+   * @static\r
+   * @param {int} id The transaction id.\r
+   * @param {object} callback - User-defined callback object.\r
+   * @param {string} uri Fully qualified path of resource.\r
+   * @return {void}\r
+   */\r
+       uploadFile:function(id, callback, uri, postData){\r
+\r
+               // Each iframe has an id prefix of "yuiIO" followed\r
+               // by the unique transaction id.\r
+               var frameId = 'yuiIO' + id;\r
+               var io = document.getElementById(frameId);\r
+\r
+               // Initialize the HTML form properties in case they are\r
+               // not defined in the HTML form.\r
+               this._formNode.action = uri;\r
+               this._formNode.method = 'POST';\r
+               this._formNode.target = frameId;\r
+\r
+               if(this._formNode.encoding){\r
+                       // IE does not respect property enctype for HTML forms.\r
+                       // Instead use property encoding.\r
+                       this._formNode.encoding = 'multipart/form-data';\r
+               }\r
+               else{\r
+                       this._formNode.enctype = 'multipart/form-data';\r
+               }\r
+\r
+               if(postData){\r
+                       var oElements = this.appendPostData(postData);\r
+               }\r
+\r
+               this._formNode.submit();\r
+\r
+               if(oElements && oElements.length > 0){\r
+                       try\r
+                       {\r
+                               for(var i=0; i < oElements.length; i++){\r
+                                       this._formNode.removeChild(oElements[i]);\r
+                               }\r
+                       }\r
+                       catch(e){}\r
+               }\r
+\r
+               // Reset HTML form status properties.\r
+               this.resetFormState();\r
+\r
+               // Create the upload callback handler that fires when the iframe\r
+               // receives the load event.  Subsequently, the event handler is detached\r
+               // and the iframe removed from the document.\r
+\r
+               var uploadCallback = function()\r
+               {\r
+                       var obj = {};\r
+                       obj.tId = id;\r
+                       obj.argument = callback.argument;\r
+\r
+                       try\r
+                       {\r
+                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;\r
+                               obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;\r
+                       }\r
+                       catch(e){}\r
+\r
+                       if(callback.upload){\r
+                               if(!callback.scope){\r
+                                       callback.upload(obj);\r
+                               }\r
+                               else{\r
+                                       callback.upload.apply(callback.scope, [obj]);\r
+                               }\r
+                       }\r
+\r
+                       if(YAHOO.util.Event){\r
+                               YAHOO.util.Event.removeListener(io, "load", uploadCallback);\r
+                       }\r
+                       else if(window.detachEvent){\r
+                               io.detachEvent('onload', uploadCallback);\r
+                       }\r
+                       else{\r
+                               io.removeEventListener('load', uploadCallback, false);\r
+                       }\r
+                       setTimeout(function(){ document.body.removeChild(io); }, 100);\r
+               };\r
+\r
+\r
+               // Bind the onload handler to the iframe to detect the file upload response.\r
+               if(YAHOO.util.Event){\r
+                       YAHOO.util.Event.addListener(io, "load", uploadCallback);\r
+               }\r
+               else if(window.attachEvent){\r
+                       io.attachEvent('onload', uploadCallback);\r
+               }\r
+               else{\r
+                       io.addEventListener('load', uploadCallback, false);\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Method to terminate a transaction, if it has not reached readyState 4.\r
+   * @method abort\r
+   * @public\r
+   * @static\r
+   * @param {object} o The connection object returned by asyncRequest.\r
+   * @param {object} callback  User-defined callback object.\r
+   * @param {string} isTimeout boolean to indicate if abort was a timeout.\r
+   * @return {boolean}\r
+   */\r
+       abort:function(o, callback, isTimeout)\r
+       {\r
+               if(this.isCallInProgress(o)){\r
+                       o.conn.abort();\r
+                       window.clearInterval(this._poll[o.tId]);\r
+                       delete this._poll[o.tId];\r
+                       if(isTimeout){\r
+                               delete this._timeOut[o.tId];\r
+                       }\r
+\r
+                       this.handleTransactionResponse(o, callback, true);\r
+\r
+                       return true;\r
+               }\r
+               else{\r
+                       return false;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * Public method to check if the transaction is still being processed.\r
+   *\r
+   * @method isCallInProgress\r
+   * @public\r
+   * @static\r
+   * @param {object} o The connection object returned by asyncRequest\r
+   * @return {boolean}\r
+   */\r
+       isCallInProgress:function(o)\r
+       {\r
+               // if the XHR object assigned to the transaction has not been dereferenced,\r
+               // then check its readyState status.  Otherwise, return false.\r
+               if(o.conn){\r
+                       return o.conn.readyState != 4 && o.conn.readyState != 0;\r
+               }\r
+               else{\r
+                       //The XHR object has been destroyed.\r
+                       return false;\r
+               }\r
+       },\r
+\r
+  /**\r
+   * @description Dereference the XHR instance and the connection object after the transaction is completed.\r
+   * @method releaseObject\r
+   * @private\r
+   * @static\r
+   * @param {object} o The connection object\r
+   * @return {void}\r
+   */\r
+       releaseObject:function(o)\r
+       {\r
+               //dereference the XHR instance.\r
+               o.conn = null;\r
+               //dereference the connection object.\r
+               o = null;\r
+       }\r
+};
\ No newline at end of file
index 59e45cb6b0b34b0ae2c8e7df9f3ad9ef8d8de122..702f45344b2e7cf3dc856bc6615a0e0b98ad3e34 100755 (executable)
 Container Release Notes\r
 \r
+*** version 0.12.0 ***\r
+\r
+       All Classes\r
+          - New documentation format implemented, and removed unnecessary\r
+          prototype null references previously used for generating\r
+          documentation\r
+          - Modified the\r
+\r
+       Config\r
+          - Added 'undefined' check when reading initial properties for\r
+          .reset()\r
+          - Fixed Firefox warning on .resetProperty()\r
+          - Fixed issue preventing resetProperty() from resetting values\r
+          correctly\r
+\r
+       Module\r
+          - Removed unused "childNodesInDom" property\r
+\r
+       Overlay\r
+          - Converted center() to use Dom utility\r
+          - Fixed configVisible() to properly detect actual visible/hidden\r
+          status in Internet Explorer, which reports "inherit" for all elements\r
+          by default.\r
+          - Updated onDomResize to properly reapply "context" property\r
+          - Unified scroll/resize handlers so that they fire properly (when the\r
+          event has completed) as opposed to constantly (as seen in Mozilla-\r
+          based browsers)\r
+\r
+       Panel\r
+          - Modified modality mask to show before Panel is shown (prior to any\r
+          animation)\r
+          - Modified buildWrapper to eliminate cloning of the initial markup\r
+          module, which fixes issues with select options not maintaining their\r
+          default selections in IE\r
+          - Modality mask is now z-indexed properly so that the mask z-index is\r
+          always one less than the Panel z-index\r
+\r
+       Dialog\r
+          - Fixed Connection to get "action" attribute using getAttribute, to\r
+          allow for form fields named "action"\r
+          - Added support for "GET" by retrieving the form "method" rather than\r
+          always defaulting to "POST"\r
+\r
+       KeyListener\r
+          - Fixed to work properly with Safari 2.0 by matching against keyCode\r
+          or charCode\r
+\r
+*** version 0.11.4 ***\r
+\r
+       - Panel: Modality mask is now properly removed from DOM on Panel\r
+       destroy.\r
+\r
+*** version 0.11.3 ***\r
+\r
+       - Module: Fixed SSL warning issue in IE\r
+       - Overlay: Fixed memory leak related to iframe shim in IE\r
+       - Panel: No focusable elements under the mask can now be tabbed to\r
+       - Panel: Set Panel container overflow to hidden to fix scrolling issue\r
+       in Opera 9\r
+\r
+*** version 0.11.2 ***\r
+\r
+       - All: JsLint optimization\r
+       - Overlay: Fixed SSL issues with monitorresize property\r
+       - OverlayManager: Fixed z-index incrementing issues\r
+       - Dialog: Form elements called "name" will now function properly\r
+       - Dialog: Removed unnecessary scope:this reference\r
+\r
+*** version 0.11.1 ***\r
+\r
+       - Tooltip: Removed incorrect logger statement\r
+       - Dialog: Corrected logic that was causing browser lockup in IE for\r
+       SimpleDialog\r
+       - Dialog: Fixed "firstButtom" typo\r
+\r
 *** version 0.11.0 ***\r
 \r
        - toString function added to all classes for easy logging\r
-       - YAHOO.extend is now being used for inheritance on all container classes\r
+       - YAHOO.extend is now being used for inheritance on all container\r
+       classes\r
        - Module: monitorresize feature now works on all browsers\r
        - Module: Fixed bug with image root and isSecure\r
        - Overlay: Fixed bugs related to IFRAME shim positioning\r
        - Overlay: center() now works in quirks mode\r
-       - Overlay: Overlay now has a custom destroy() method that also removes the IFRAME shim\r
-       - OverlayManager: Fixed bug in the prototype that was preventing multiple Managers on one page\r
+       - Overlay: Overlay now has a custom destroy() method that also removes\r
+       the IFRAME shim\r
+       - OverlayManager: Fixed bug in the prototype that was preventing\r
+       multiple Managers on one page\r
        - OverlayManager: focusEvent now fires at all appropriate times\r
-       - Tooltip: context can now be specified as an array, so Tooltips can be reused across multiple context elements\r
-       - Tooltip: preventoverlap now functions properly for large context elements (i.e, images)\r
+       - Tooltip: context can now be specified as an array, so Tooltips can be\r
+       reused across multiple context elements\r
+       - Tooltip: preventoverlap now functions properly for large context\r
+       elements (i.e, images)\r
        - Tooltip: fixed bugs regarding setTimeout\r
-       - Tooltip: added mousemove event to allow for more accurate Tooltip positioning\r
-       - Panel: added dragEvent for monitoring all event handlers for drag and drop\r
+       - Tooltip: added mousemove event to allow for more accurate Tooltip\r
+       positioning\r
+       - Panel: added dragEvent for monitoring all event handlers for drag and\r
+       drop\r
        - Panel: modality mask is now resized on scroll\r
-       - Panel: KeyListeners are now properly destroyed when the Panel is destroyed\r
+       - Panel: KeyListeners are now properly destroyed when the Panel is\r
+       destroyed\r
        - Panel: Header is now sized properly in quirks mode\r
        - Dialog: Blinking cursor issue is fixed for Firefox\r
        - Dialog: callback object for Connection is now public (this.callback)\r
-       - Dialog: onsuccess/onfailure properties removed (as a result of the public callback object)\r
+       - Dialog: onsuccess/onfailure properties removed (as a result of the\r
+       public callback object)\r
        - Dialog: Dialog is now invisible by default\r
        - Dialog: Buttons are now properly cleaned up on destroy\r
 \r
 *** version 0.10.0 ***\r
 \r
 * Initial release\r
+\r
index 9580fc8ee6e8752214ed5c652005652abc3f701d..c482bc2f315e7603e4313e4add050902e9248cac 100755 (executable)
@@ -97,6 +97,7 @@ Version 0.11.0
     -moz-opacity: 0.7;\r
     opacity:.70;\r
     filter:alpha(opacity=70);\r
+       zoom:1;\r
 }\r
 \r
 .panel {\r
@@ -108,7 +109,7 @@ Version 0.11.0
        background-color:#FFF;\r
        border:1px solid #000;\r
        z-index:1;\r
-       overflow:auto;\r
+       overflow:hidden;\r
 }\r
 \r
 .panel .hd {\r
index 7bb86ad63feb430537987e7d7dbaecbb2162af8f..bdef18412272146f77318933641c18a560e6ac77 100755 (executable)
@@ -2,13 +2,14 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version: 0.12.0\r
 */\r
+\r
 /**\r
-* @class \r
-* Config is a utility used within an object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
 * @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config = function(owner) {\r
        if (owner) {\r
@@ -16,119 +17,31 @@ YAHOO.util.Config = function(owner) {
        } else {\r
                YAHOO.log("No owner specified for Config object", "error");\r
        }\r
-}\r
+};\r
 \r
 YAHOO.util.Config.prototype = {\r
-       \r
-       /**\r
-       * Object reference to the owner of this Config object\r
-       * @type object\r
-       */\r
-       owner : null,\r
 \r
        /**\r
-       * Object reference to the owner of this Config object\r
-       * args: key, value\r
-       * @type YAHOO.util.CustomEvent\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
        */\r
-       configChangedEvent : null,\r
+       owner : null,\r
 \r
        /**\r
        * Boolean flag that specifies whether a queue is currently being executed\r
-       * @type boolean\r
+       * @property queueInProgress\r
+       * @type Boolean\r
        */\r
        queueInProgress : false,\r
 \r
-       /**\r
-       * Adds a property to the Config object's private config hash. \r
-       * @param {string}       key     The configuration property's name\r
-       * @param {object}       propertyObject  The object containing all of this property's arguments\r
-       */\r
-       addProperty : function(key, propertyObject){},\r
-\r
-       /**\r
-       * Returns a key-value configuration map of the values currently set in the Config object.\r
-       * @return {object} The current config, represented in a key-value map\r
-       */\r
-       getConfig : function(){},\r
-\r
-       /**\r
-       * Returns the value of specified property.\r
-       * @param {key}          The name of the property\r
-       * @return {object}      The value of the specified property\r
-       */\r
-       getProperty : function(key){},\r
-\r
-       /**\r
-       * Resets the specified property's value to its initial value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       resetProperty : function(key){},\r
-\r
-       /**\r
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @param {boolean}      Whether the value should be set silently, without firing the property event.\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */\r
-       setProperty : function(key,value,silent){},\r
-\r
-       /**\r
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
-       * moved from its current position to the end of the queue.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */      \r
-       queueProperty : function(key,value){},\r
-\r
-       /**\r
-       * Fires the event for a property using the property's current value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       refireEvent : function(key){},\r
-\r
-       /**\r
-       * Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.\r
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
-       * @param {object}       userConfig      The configuration object literal\r
-       * @param {boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
-       */\r
-       applyConfig : function(userConfig,init){},\r
-\r
-       /**\r
-       * Refires the events for all configuration properties using their current values.\r
-       */\r
-       refresh : function(){},\r
-\r
-       /**\r
-       * Fires the normalized list of queued property change events\r
-       */\r
-       fireQueue : function(){},\r
-\r
-       /**\r
-       * Subscribes an external handler to the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
-       * @param {boolean}      override        Optional. If true, will override "this" within the handler to map to the scope object passed into the method.\r
-       */      \r
-       subscribeToConfigEvent : function(key,handler,obj,override){},\r
 \r
        /**\r
-       * Unsubscribes an external handler from the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
-       unsubscribeFromConfigEvent: function(key,handler,obj){},\r
-\r
-       /**\r
-       * Validates that the value passed in is a boolean.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
-       */      \r
        checkBoolean: function(val) {\r
                if (typeof val == 'boolean') {\r
                        return true;\r
@@ -139,8 +52,9 @@ YAHOO.util.Config.prototype = {
 \r
        /**\r
        * Validates that the value passed in is a number.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
        checkNumber: function(val) {\r
                if (isNaN(val)) {\r
@@ -149,47 +63,81 @@ YAHOO.util.Config.prototype = {
                        return true;\r
                }\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
-* Initializes the configuration object and all of its local members.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config.prototype.init = function(owner) {\r
 \r
        this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
        this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
        this.queueInProgress = false;\r
 \r
        /* Private Members */\r
 \r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
        var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
        var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
        var eventQueue = [];\r
 \r
        /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
        * @private\r
-       * Fires a configuration property event using the specified value. \r
-       * @param {string}       key                     The configuration property's name\r
-       * @param {value}        object          The value of the correct type for the property\r
-       */ \r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
        var fireEvent = function( key, value ) {\r
                YAHOO.log("Firing Config event: " + key + "=" + value, "info");\r
-               \r
+\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
 \r
                if (typeof property != 'undefined' && property.event) {\r
                        property.event.fire(value);\r
-               }       \r
-       }\r
+               }\r
+       };\r
        /* End Private Members */\r
 \r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
        this.addProperty = function( key, propertyObject ) {\r
                key = key.toLowerCase();\r
-               \r
+\r
                YAHOO.log("Added property: " + key, "info");\r
 \r
                config[key] = propertyObject;\r
@@ -202,25 +150,36 @@ YAHOO.util.Config.prototype.init = function(owner) {
                }\r
 \r
                this.setProperty(key, propertyObject.value, true);\r
-               \r
+\r
                if (! propertyObject.suppressEvent) {\r
                        this.queueProperty(key, propertyObject.value);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
        this.getConfig = function() {\r
                var cfg = {};\r
-                       \r
+\r
                for (var prop in config) {\r
-                       var property = config[prop]\r
+                       var property = config[prop];\r
                        if (typeof property != 'undefined' && property.event) {\r
                                cfg[prop] = property.value;\r
                        }\r
                }\r
-               \r
+\r
                return cfg;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
        this.getProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -230,26 +189,43 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return undefined;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
        this.resetProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
                if (typeof property != 'undefined' && property.event) {\r
-                       this.setProperty(key, initialConfig[key].value);\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
                } else {\r
-                       return undefined;\r
+                       return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
        this.setProperty = function(key, value, silent) {\r
                key = key.toLowerCase();\r
-               \r
+\r
                YAHOO.log("setProperty: " + key + "=" + value, "info");\r
 \r
                if (this.queueInProgress && ! silent) {\r
-                       this.queueProperty(key,value); // Currently running through a queue... \r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
                        return true;\r
                } else {\r
                        var property = config[key];\r
@@ -268,15 +244,23 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                return false;\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
        this.queueProperty = function(key, value) {\r
                key = key.toLowerCase();\r
 \r
                YAHOO.log("queueProperty: " + key + "=" + value, "info");\r
 \r
                var property = config[key];\r
-                                                       \r
+\r
                if (typeof property != 'undefined' && property.event) {\r
                        if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
                                return false;\r
@@ -296,7 +280,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        if (queueItem) {\r
                                                var queueItemKey = queueItem[0];\r
                                                var queueItemValue = queueItem[1];\r
-                                               \r
+\r
                                                if (queueItemKey.toLowerCase() == key) {\r
                                                        // found a dupe... push to end of queue, null current item, and break\r
                                                        eventQueue[i] = null;\r
@@ -306,7 +290,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                }\r
                                        }\r
                                }\r
-                               \r
+\r
                                if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
                                        eventQueue.push([key, value]);\r
                                }\r
@@ -322,7 +306,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                if (queueItemCheck) {\r
                                                        var queueItemCheckKey = queueItemCheck[0];\r
                                                        var queueItemCheckValue = queueItemCheck[1];\r
-                                                       \r
+\r
                                                        if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
                                                                eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
                                                                eventQueue[q] = null;\r
@@ -332,15 +316,20 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        }\r
                                }\r
                        }\r
-       \r
+\r
                        YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");\r
 \r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
        this.refireEvent = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -352,8 +341,15 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                fireEvent(key, property.value);\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
        this.applyConfig = function(userConfig, init) {\r
                if (init) {\r
                        initialConfig = userConfig;\r
@@ -361,14 +357,22 @@ YAHOO.util.Config.prototype.init = function(owner) {
                for (var prop in userConfig) {\r
                        this.queueProperty(prop, userConfig[prop]);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
        this.refresh = function() {\r
                for (var prop in config) {\r
                        this.refireEvent(prop);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
        this.fireQueue = function() {\r
                this.queueInProgress = true;\r
                for (var i=0;i<eventQueue.length;i++) {\r
@@ -376,18 +380,27 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        if (queueItem) {\r
                                var key = queueItem[0];\r
                                var value = queueItem[1];\r
-                               \r
+\r
                                var property = config[key];\r
                                property.value = value;\r
 \r
                                fireEvent(key,value);\r
                        }\r
                }\r
-               \r
+\r
                this.queueInProgress = false;\r
-               eventQueue = new Array();\r
-       }\r
+               eventQueue = [];\r
+       };\r
 \r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
        this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
                key = key.toLowerCase();\r
 \r
@@ -400,9 +413,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
-\r
+       };\r
 \r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
        this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
                key = key.toLowerCase();\r
 \r
@@ -412,16 +432,26 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
        this.toString = function() {\r
                var output = "Config";\r
                if (this.owner) {\r
                        output += " [" + this.owner.toString() + "]";\r
                }\r
                return output;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
        this.outputEventQueue = function() {\r
                var output = "";\r
                for (var q=0;q<eventQueue.length;q++) {\r
@@ -431,268 +461,265 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        }\r
                }\r
                return output;\r
-       }\r
-}\r
+       };\r
+};\r
 \r
 /**\r
-* Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
 * @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
 * @param {Function}    fn      The function to look for in the subscribers list\r
-* @param {object}      obj     The execution scope object for the subscription\r
-* @return {boolean}    true, if the function/object pair is already subscribed to the CustomEvent passed in\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
 YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
        for (var e=0;e<evt.subscribers.length;e++) {\r
                var subsc = evt.subscribers[e];\r
                if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
                        return true;\r
-                       break;\r
                }\r
        }\r
        return false;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class \r
+};\r
+\r
+/**\r
+*  The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
+* @module Container\r
+* @requires yahoo,dom,event,dragdrop,animation\r
+*/\r
+\r
+/**\r
 * Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @param {string}      el      The element ID representing the Module <em>OR</em>\r
-* @param {Element}     el      The element representing the Module\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+* @class Module\r
+* @namespace YAHOO.widget\r
 * @constructor\r
+* @param {String} el                   The element ID representing the Module <em>OR</em>\r
+* @param {HTMLElement} el              The element representing the Module\r
+* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Module = function(el, userConfig) {\r
-       if (el) { \r
-               this.init(el, userConfig); \r
+       if (el) {\r
+               this.init(el, userConfig);\r
        } else {\r
                YAHOO.log("No element or element ID specified for Module instantiation", "error");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the prefix path to use for non-secure images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";\r
 \r
 /**\r
 * Constant representing the prefix path to use for securely served images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT_SSL\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";\r
 \r
 /**\r
 * Constant for the default CSS class name that represents a Module\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_MODULE\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_MODULE = "module";\r
 \r
 /**\r
 * Constant representing the module header\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_HEADER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_HEADER = "hd";\r
 \r
 /**\r
 * Constant representing the module body\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_BODY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_BODY = "bd";\r
 \r
 /**\r
 * Constant representing the module footer\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_FOOTER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_FOOTER = "ft";\r
 \r
 /**\r
 * Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size\r
-* @type string\r
+* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = null;\r
+YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
 \r
 YAHOO.widget.Module.prototype = {\r
 \r
        /**\r
        * The class's constructor function\r
-       * @type function\r
+       * @property contructor\r
+       * @type Function\r
        */\r
        constructor : YAHOO.widget.Module,\r
 \r
        /**\r
        * The main module element that contains the header, body, and footer\r
-       * @type Element\r
+       * @property element\r
+       * @type HTMLElement\r
        */\r
-       element : null, \r
+       element : null,\r
 \r
        /**\r
        * The header element, denoted with CSS class "hd"\r
-       * @type Element\r
+       * @property header\r
+       * @type HTMLElement\r
        */\r
        header : null,\r
 \r
        /**\r
        * The body element, denoted with CSS class "bd"\r
-       * @type Element\r
+       * @property body\r
+       * @type HTMLElement\r
        */\r
        body : null,\r
 \r
        /**\r
        * The footer element, denoted with CSS class "ft"\r
-       * @type Element\r
+       * @property footer\r
+       * @type HTMLElement\r
        */\r
        footer : null,\r
 \r
        /**\r
        * The id of the element\r
-       * @type string\r
+       * @property id\r
+       * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
-       * Array of elements\r
-       * @type Element[]\r
-       */\r
-       childNodesInDOM : null,\r
-\r
-       /**\r
-       * The string representing the image root\r
-       * @type string\r
+       * The String representing the image root\r
+       * @property imageRoot\r
+       * @type String\r
        */\r
        imageRoot : YAHOO.widget.Module.IMG_ROOT,\r
 \r
-       /**\r
-       * CustomEvent fired prior to class initalization.\r
-       * args: class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeInitEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after class initalization.\r
-       * args: class reference of the initializing class, such as this.initEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       initEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is appended to the DOM\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       appendEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeRenderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       renderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the header content of the Module is modified\r
-       * args: string/element representing the new header content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeHeaderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the body content of the Module is modified\r
-       * args: string/element representing the new body content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeBodyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the footer content of the Module is modified\r
-       * args: string/element representing the new footer content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeFooterEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the content of the Module is modified\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeContentEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is destroyed\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       destroyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeShowEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       showEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeHideEvent : null,\r
-       \r
-       /**\r
-       * CustomEvent fired after the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       hideEvent : null,\r
-               \r
        /**\r
        * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
+       * @method initEvents\r
        */\r
        initEvents : function() {\r
 \r
-               this.beforeInitEvent            = new YAHOO.util.CustomEvent("beforeInit");\r
-               this.initEvent                          = new YAHOO.util.CustomEvent("init");\r
-\r
-               this.appendEvent                        = new YAHOO.util.CustomEvent("append");\r
-\r
-               this.beforeRenderEvent          = new YAHOO.util.CustomEvent("beforeRender");\r
-               this.renderEvent                        = new YAHOO.util.CustomEvent("render");\r
-\r
-               this.changeHeaderEvent          = new YAHOO.util.CustomEvent("changeHeader");\r
-               this.changeBodyEvent            = new YAHOO.util.CustomEvent("changeBody");\r
-               this.changeFooterEvent          = new YAHOO.util.CustomEvent("changeFooter");\r
-\r
-               this.changeContentEvent         = new YAHOO.util.CustomEvent("changeContent");\r
-\r
-               this.destroyEvent                       = new YAHOO.util.CustomEvent("destroy");\r
-               this.beforeShowEvent            = new YAHOO.util.CustomEvent("beforeShow");\r
-               this.showEvent                          = new YAHOO.util.CustomEvent("show");\r
-               this.beforeHideEvent            = new YAHOO.util.CustomEvent("beforeHide");\r
-               this.hideEvent                          = new YAHOO.util.CustomEvent("hide");\r
-       }, \r
+               /**\r
+               * CustomEvent fired prior to class initalization.\r
+               * @event beforeInitEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");\r
+\r
+               /**\r
+               * CustomEvent fired after class initalization.\r
+               * @event initEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.initEvent = new YAHOO.util.CustomEvent("init");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is appended to the DOM\r
+               * @event appendEvent\r
+               */\r
+               this.appendEvent = new YAHOO.util.CustomEvent("append");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is rendered\r
+               * @event beforeRenderEvent\r
+               */\r
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is rendered\r
+               * @event renderEvent\r
+               */\r
+               this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+\r
+               /**\r
+               * CustomEvent fired when the header content of the Module is modified\r
+               * @event changeHeaderEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new header content\r
+               */\r
+               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");\r
+\r
+               /**\r
+               * CustomEvent fired when the body content of the Module is modified\r
+               * @event changeBodyEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new body content\r
+               */\r
+               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");\r
+\r
+               /**\r
+               * CustomEvent fired when the footer content of the Module is modified\r
+               * @event changeFooterEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new footer content\r
+               */\r
+               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");\r
+\r
+               /**\r
+               * CustomEvent fired when the content of the Module is modified\r
+               * @event changeContentEvent\r
+               */\r
+               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is destroyed\r
+               * @event destroyEvent\r
+               */\r
+               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is shown\r
+               * @event beforeShowEvent\r
+               */\r
+               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is shown\r
+               * @event showEvent\r
+               */\r
+               this.showEvent = new YAHOO.util.CustomEvent("show");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is hidden\r
+               * @event beforeHideEvent\r
+               */\r
+               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is hidden\r
+               * @event hideEvent\r
+               */\r
+               this.hideEvent = new YAHOO.util.CustomEvent("hide");\r
+       },\r
 \r
        /**\r
        * String representing the current user-agent platform\r
-       * @type string\r
+       * @property platform\r
+       * @type String\r
        */\r
        platform : function() {\r
                                        var ua = navigator.userAgent.toLowerCase();\r
@@ -707,7 +734,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * String representing the current user-agent browser\r
-       * @type string\r
+       * @property browser\r
+       * @type String\r
        */\r
        browser : function() {\r
                        var ua = navigator.userAgent.toLowerCase();\r
@@ -728,10 +756,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Boolean representing whether or not the current browsing context is secure (https)\r
-       * @type boolean\r
+       * @property isSecure\r
+       * @type Boolean\r
        */\r
        isSecure : function() {\r
-               if (window.location.href.toLowerCase().indexOf("https") == 0) {\r
+               if (window.location.href.toLowerCase().indexOf("https") === 0) {\r
                        return true;\r
                } else {\r
                        return false;\r
@@ -744,16 +773,37 @@ YAHOO.widget.Module.prototype = {
        initDefaultConfig : function() {\r
                // Add properties //\r
 \r
+               /**\r
+               * Specifies whether the Module is visible on the page.\r
+               * @config visible\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );\r
+\r
+               /**\r
+               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.\r
+               * @config effect\r
+               * @type Object\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );\r
+\r
+               /**\r
+               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document\r
+               * @config monitorresize\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );\r
        },\r
 \r
        /**\r
        * The Module class's initialization method, which is executed for Module and all of its subclasses. 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.\r
-       * @param {string}       el      The element ID representing the Module <em>OR</em>\r
-       * @param {Element}      el      The element representing the Module\r
-       * @param {object}       userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+       * @method init\r
+       * @param {String}       el      The element ID representing the Module <em>OR</em>\r
+       * @param {HTMLElement}  el      The element representing the Module\r
+       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
        */\r
        init : function(el, userConfig) {\r
 \r
@@ -761,8 +811,13 @@ YAHOO.widget.Module.prototype = {
 \r
                this.beforeInitEvent.fire(YAHOO.widget.Module);\r
 \r
+               /**\r
+               * The Module's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
-               \r
+\r
                if (this.isSecure) {\r
                        this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;\r
                }\r
@@ -778,10 +833,10 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                this.element = el;\r
-               \r
+\r
                if (el.id) {\r
                        this.id = el.id;\r
-               } \r
+               }\r
 \r
                var childNodes = this.element.childNodes;\r
 \r
@@ -820,93 +875,101 @@ YAHOO.widget.Module.prototype = {
        },\r
 \r
        /**\r
-       * Initialized an empty DOM element that is placed out of the visible area that can be used to detect text resize.\r
+       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.\r
+       * @method initResizeMonitor\r
        */\r
        initResizeMonitor : function() {\r
 \r
         if(this.browser != "opera") {\r
 \r
             var resizeMonitor = document.getElementById("_yuiResizeMonitor");\r
-    \r
+\r
             if (! resizeMonitor) {\r
-    \r
+\r
                 resizeMonitor = document.createElement("iframe");\r
-    \r
+\r
                 var bIE = (this.browser.indexOf("ie") === 0);\r
-    \r
-                if(this.isSecure && this.RESIZE_MONITOR_SECURE_URL && bIE) {\r
-    \r
-                    resizeMonitor.src = this.RESIZE_MONITOR_SECURE_URL;\r
-    \r
+\r
+                if(this.isSecure &&\r
+                   YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL &&\r
+                   bIE) {\r
+\r
+                  resizeMonitor.src =\r
+                       YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;\r
+\r
                 }\r
-                \r
+\r
                 resizeMonitor.id = "_yuiResizeMonitor";\r
                 resizeMonitor.style.visibility = "hidden";\r
-                \r
+\r
                 document.body.appendChild(resizeMonitor);\r
-    \r
+\r
                 resizeMonitor.style.width = "10em";\r
                 resizeMonitor.style.height = "10em";\r
                 resizeMonitor.style.position = "absolute";\r
-                \r
+\r
                 var nLeft = -1 * resizeMonitor.offsetWidth,\r
                     nTop = -1 * resizeMonitor.offsetHeight;\r
-    \r
+\r
                 resizeMonitor.style.top = nTop + "px";\r
                 resizeMonitor.style.left =  nLeft + "px";\r
                 resizeMonitor.style.borderStyle = "none";\r
                 resizeMonitor.style.borderWidth = "0";\r
                 YAHOO.util.Dom.setStyle(resizeMonitor, "opacity", "0");\r
-                \r
+\r
                 resizeMonitor.style.visibility = "visible";\r
-    \r
+\r
                 if(!bIE) {\r
-    \r
+\r
                     var doc = resizeMonitor.contentWindow.document;\r
-    \r
+\r
                     doc.open();\r
                     doc.close();\r
-                \r
+\r
                 }\r
-    \r
+\r
             }\r
-    \r
+\r
             if(resizeMonitor && resizeMonitor.contentWindow) {\r
-    \r
+\r
                 this.resizeMonitor = resizeMonitor;\r
-    \r
+\r
                 YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
-    \r
+\r
             }\r
-        \r
+\r
         }\r
 \r
        },\r
 \r
        /**\r
        * Event handler fired when the resize monitor element is resized.\r
+       * @method onDomResize\r
+       * @param {DOMEvent} e   The DOM resize event\r
+       * @param {Object} obj   The scope object passed to the handler\r
        */\r
-       onDomResize : function(e, obj) { \r
+       onDomResize : function(e, obj) {\r
 \r
         var nLeft = -1 * this.resizeMonitor.offsetWidth,\r
             nTop = -1 * this.resizeMonitor.offsetHeight;\r
-        \r
+\r
         this.resizeMonitor.style.top = nTop + "px";\r
         this.resizeMonitor.style.left =  nLeft + "px";\r
-       \r
+\r
        },\r
 \r
        /**\r
        * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {string}       headerContent   The HTML used to set the header <em>OR</em>\r
-       * @param {Element}      headerContent   The Element to append to the header\r
-       */      \r
+       * @method setHeader\r
+       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>\r
+       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header\r
+       */\r
        setHeader : function(headerContent) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                if (typeof headerContent == "string") {\r
                        this.header.innerHTML = headerContent;\r
                } else {\r
@@ -920,14 +983,15 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the header\r
-       */      \r
+       * @method appendToHeader\r
+       * @param {HTMLElement}  element The element to append to the header\r
+       */\r
        appendToHeader : function(element) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                this.header.appendChild(element);\r
                this.changeHeaderEvent.fire(element);\r
                this.changeContentEvent.fire();\r
@@ -935,9 +999,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       bodyContent     The HTML used to set the body <em>OR</em>\r
-       * @param {Element}      bodyContent     The Element to append to the body\r
-       */              \r
+       * @method setBody\r
+       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>\r
+       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body\r
+       */\r
        setBody : function(bodyContent) {\r
                if (! this.body) {\r
                        this.body = document.createElement("DIV");\r
@@ -958,7 +1023,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the body. If no body is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the body\r
+       * @method appendToBody\r
+       * @param {HTMLElement}  element The element to append to the body\r
        */\r
        appendToBody : function(element) {\r
                if (! this.body) {\r
@@ -973,9 +1039,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       footerContent   The HTML used to set the footer <em>OR</em>\r
-       * @param {Element}      footerContent   The Element to append to the footer\r
-       */      \r
+       * @method setFooter\r
+       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>\r
+       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer\r
+       */\r
        setFooter : function(footerContent) {\r
                if (! this.footer) {\r
                        this.footer = document.createElement("DIV");\r
@@ -995,7 +1062,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the footer. If no footer is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the footer\r
+       * @method appendToFooter\r
+       * @param {HTMLElement}  element The element to append to the footer\r
        */\r
        appendToFooter : function(element) {\r
                if (! this.footer) {\r
@@ -1010,10 +1078,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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 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.\r
-       * @param {string}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-       * @param {Element}      appendToNode    The element to which the Module should be appended to prior to rendering        \r
-       * @param {Element}      moduleElement   OPTIONAL. The element that represents the actual Standard Module container. \r
-       * @return {boolean} Success or failure of the render\r
+       * @method render\r
+       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering\r
+       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container.\r
+       * @return {Boolean} Success or failure of the render\r
        */\r
        render : function(appendToNode, moduleElement) {\r
                this.beforeRenderEvent.fire();\r
@@ -1027,12 +1096,12 @@ YAHOO.widget.Module.prototype = {
                        if (typeof element == "string") {\r
                                element = document.getElementById(element);\r
                        }\r
-                       \r
+\r
                        if (element) {\r
                                element.appendChild(me.element);\r
                                me.appendEvent.fire();\r
                        }\r
-               }\r
+               };\r
 \r
                if (appendToNode) {\r
                        appendTo(appendToNode);\r
@@ -1044,7 +1113,7 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                // Need to get everything into the DOM if it isn't already\r
-               \r
+\r
                if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {\r
                        // There is a header, but it's not in the DOM yet... need to add it\r
                        var firstChild = moduleElement.firstChild;\r
@@ -1075,6 +1144,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Removes the Module element from the DOM and sets all child elements to null.\r
+       * @method destroy\r
        */\r
        destroy : function() {\r
                if (this.element) {\r
@@ -1094,6 +1164,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Shows the Module element by setting the visible configuration property to true. Also fires two events: beforeShowEvent prior to the visibility change, and showEvent after.\r
+       * @method show\r
        */\r
        show : function() {\r
                this.cfg.setProperty("visible", true);\r
@@ -1101,6 +1172,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Hides the Module element by setting the visible configuration property to false. Also fires two events: beforeHideEvent prior to the visibility change, and hideEvent after.\r
+       * @method hide\r
        */\r
        hide : function() {\r
                this.cfg.setProperty("visible", false);\r
@@ -1111,6 +1183,10 @@ YAHOO.widget.Module.prototype = {
        /**\r
        * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".\r
        * This method is responsible for firing showEvent and hideEvent.\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configVisible\r
        */\r
        configVisible : function(type, args, obj) {\r
                var visible = args[0];\r
@@ -1127,6 +1203,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Default event handler for the "monitorresize" configuration property\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configMonitorResize\r
        */\r
        configMonitorResize : function(type, args, obj) {\r
                var monitor = args[0];\r
@@ -1137,95 +1217,97 @@ YAHOO.widget.Module.prototype = {
                        this.resizeMonitor = null;\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the Object.\r
+* @method toString\r
+* @return {String}     The string representation of the Module\r
+*/\r
 YAHOO.widget.Module.prototype.toString = function() {\r
        return "Module " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+};\r
+\r
+/**\r
+* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
+* @class Overlay\r
+* @namespace YAHOO.widget\r
+* @extends YAHOO.widget.Module\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 * @constructor\r
 */\r
 YAHOO.widget.Overlay = function(el, userConfig) {\r
        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);\r
 \r
 /**\r
-* The URL of the blank image that will be placed in the iframe\r
-* @type string\r
+* The URL that will be placed in the iframe\r
+* @property YAHOO.widget.Overlay.IFRAME_SRC\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Overlay.IFRAME_SRC = "promo/m/irs/blank.gif";\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
 \r
 /**\r
 * Constant representing the top left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_LEFT = "tl";\r
 \r
 /**\r
 * Constant representing the top right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_RIGHT = "tr";\r
 \r
 /**\r
 * Constant representing the top bottom left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";\r
 \r
 /**\r
 * Constant representing the bottom right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";\r
 \r
 /**\r
 * Constant representing the default CSS class used for an Overlay\r
-* @type string\r
+* @property YAHOO.widget.Overlay.CSS_OVERLAY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";\r
 \r
 /**\r
-* CustomEvent fired before the Overlay is moved.\r
-* args: x,y that the Overlay will be moved to\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Overlay.prototype.beforeMoveEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after the Overlay is moved.\r
-* args: x,y that the Overlay was moved to\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Overlay.prototype.moveEvent = null;\r
-\r
-/**\r
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
+\r
        this.beforeInitEvent.fire(YAHOO.widget.Overlay);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);\r
@@ -1245,80 +1327,180 @@ YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
 \r
        this.initEvent.fire(YAHOO.widget.Overlay);\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Overlay.prototype.initEvents = function() {\r
        YAHOO.widget.Overlay.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired before the Overlay is moved.\r
+       * @event beforeMoveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);\r
+\r
+       /**\r
+       * CustomEvent fired after the Overlay is moved.\r
+       * @event moveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.moveEvent = new YAHOO.util.CustomEvent("move", this);\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);\r
 \r
        // Add overlay config properties //\r
+\r
+       /**\r
+       * The absolute x-coordinate position of the Overlay\r
+       * @config x\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * The absolute y-coordinate position of the Overlay\r
+       * @config y\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * An array with the absolute x and y positions of the Overlay\r
+       * @config xy\r
+       * @type Number[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * The 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 Overlay's top left corner to the context element's bottom left corner.\r
+       * @config context\r
+       * @type Array\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * True if the Overlay should be anchored to the center of the viewport.\r
+       * @config fixedcenter\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );\r
 \r
+       /**\r
+       * CSS width of the Overlay.\r
+       * @config width\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * CSS height of the Overlay.\r
+       * @config height\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * CSS z-index of the Overlay.\r
+       * @config zIndex\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );\r
 \r
+       /**\r
+       * True if the Overlay should be prevented from being positioned out of the viewport.\r
+       * @config constraintoviewport\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );\r
+\r
+       /**\r
+       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true for IE6 and below, false for all others\r
+       */\r
        this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );\r
-}\r
+};\r
 \r
 /**\r
 * Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);\r
-* @param {int} x       The Overlay's new x position\r
-* @param {int} y       The Overlay's new y position\r
+* @method moveTo\r
+* @param {Number}      x       The Overlay's new x position\r
+* @param {Number}      y       The Overlay's new y position\r
 */\r
 YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {\r
        this.cfg.setProperty("xy",[x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method hideMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");\r
-}\r
+};\r
 \r
 /**\r
 * Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method showMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "show-scrollbars");\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.\r
+* @method configVisible\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {\r
        var visible = args[0];\r
        var currentVis = YAHOO.util.Dom.getStyle(this.element, "visibility");\r
 \r
+       if (currentVis == "inherit") {\r
+               var e = this.element.parentNode;\r
+               while (e.nodeType != 9 && e.nodeType != 11) {\r
+                       currentVis = YAHOO.util.Dom.getStyle(e, "visibility");\r
+                       if (currentVis != "inherit") { break; }\r
+                       e = e.parentNode;\r
+               }\r
+               if (currentVis == "inherit") {\r
+                       currentVis = "visible";\r
+               }\r
+       }\r
+\r
        var effect = this.cfg.getProperty("effect");\r
 \r
-       var effectInstances = new Array();\r
+       var effectInstances = [];\r
        if (effect) {\r
                if (effect instanceof Array) {\r
                        for (var i=0;i<effect.length;i++) {\r
@@ -1335,23 +1517,23 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        if (visible) { // Show\r
                if (isMacGecko) {\r
                        this.showMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate in\r
                        if (visible) { // Animate in if not showing\r
-                               if (currentVis != "visible") {\r
+                               if (currentVis != "visible" || currentVis === "") {\r
                                        this.beforeShowEvent.fire();\r
-                                       for (var i=0;i<effectInstances.length;i++) {\r
-                                               var e = effectInstances[i];\r
-                                               if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
-                                                       e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
+                                       for (var j=0;j<effectInstances.length;j++) {\r
+                                               var ei = effectInstances[j];\r
+                                               if (j === 0 && ! YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
+                                                       ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
                                                }\r
-                                               e.animateIn();\r
+                                               ei.animateIn();\r
                                        }\r
                                }\r
                        }\r
                } else { // Show\r
-                       if (currentVis != "visible") {\r
+                       if (currentVis != "visible" || currentVis === "") {\r
                                this.beforeShowEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");\r
                                this.cfg.refireEvent("iframe");\r
@@ -1362,52 +1544,59 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        } else { // Hide\r
                if (isMacGecko) {\r
                        this.hideMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate out if showing\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible") {\r
                                this.beforeHideEvent.fire();\r
-                               for (var i=0;i<effectInstances.length;i++) {\r
-                                       var e = effectInstances[i];\r
-                                       if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {                            \r
-                                               e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
+                               for (var k=0;k<effectInstances.length;k++) {\r
+                                       var h = effectInstances[k];\r
+                                       if (k === 0 && ! YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {\r
+                                               h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
                                        }\r
-                                       e.animateOut();\r
+                                       h.animateOut();\r
                                }\r
+                       } else if (currentVis === "") {\r
+                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                        }\r
                } else { // Simple hide\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible" || currentVis === "") {\r
                                this.beforeHideEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                                this.cfg.refireEvent("iframe");\r
                                this.hideEvent.fire();\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Center event handler used for centering on scroll/resize, but only if the Overlay is visible\r
+* @method doCenterOnDOMEvent\r
 */\r
 YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {\r
        if (this.cfg.getProperty("visible")) {\r
                this.center();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "fixedcenter" property is changed.\r
+* @method configFixedCenter\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        if (val) {\r
                this.center();\r
-                       \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent, this.center, this)) {\r
                        this.beforeShowEvent.subscribe(this.center, this, true);\r
                }\r
-               \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);\r
                }\r
@@ -1419,30 +1608,42 @@ YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {
                YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
                YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configHeight = function(type, args, obj) {\r
        var height = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "height", height);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configWidth = function(type, args, obj) {\r
        var width = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "width", width);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {\r
        var zIndex = args[0];\r
@@ -1465,10 +1666,14 @@ YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {
 \r
        YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);\r
        this.cfg.setProperty("zIndex", zIndex, true);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "xy" property is changed.\r
+* @method configXY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1487,10 +1692,14 @@ YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "x" property is changed.\r
+* @method configX\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {\r
        var x = args[0];\r
@@ -1505,15 +1714,19 @@ YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
        y = this.cfg.getProperty("y");\r
 \r
        YAHOO.util.Dom.setX(this.element, x, true);\r
-       \r
+\r
        this.cfg.setProperty("xy", [x, y], true);\r
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "y" property is changed.\r
+* @method configY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {\r
        var x = this.cfg.getProperty("x");\r
@@ -1533,43 +1746,52 @@ YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
+\r
+/**\r
+* Shows the iframe shim, if it has been enabled\r
+* @method showIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.showIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "block";\r
+       }\r
+};\r
+\r
+/**\r
+* Hides the iframe shim, if it has been enabled\r
+* @method hideIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.hideIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "none";\r
+       }\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "iframe" property is changed.\r
+* @method configIframe\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {\r
 \r
        var val = args[0];\r
 \r
-       var el = this.element;\r
-       \r
-       var showIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "block";\r
-               }\r
-       }\r
-\r
-       var hideIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "none";\r
-               }\r
-       }\r
-\r
        if (val) { // IFRAME shim is enabled\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, showIframe, this)) {\r
-                       this.showEvent.subscribe(showIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {\r
+                       this.showEvent.subscribe(this.showIframe, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, hideIframe, this)) {\r
-                       this.hideEvent.subscribe(hideIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {\r
+                       this.hideEvent.subscribe(this.hideIframe, this, true);\r
                }\r
 \r
                var x = this.cfg.getProperty("x");\r
                var y = this.cfg.getProperty("y");\r
 \r
                if (! x || ! y) {\r
-                       YAHOO.log("syncPosition needed for iframe", "iframe");\r
                        this.syncPosition();\r
                        x = this.cfg.getProperty("x");\r
                        y = this.cfg.getProperty("y");\r
@@ -1583,8 +1805,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                if (this.isSecure) {\r
                                        this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
                                }\r
-                               \r
-                               var parent = el.parentNode;\r
+\r
+                               var parent = this.element.parentNode;\r
                                if (parent) {\r
                                        parent.appendChild(this.iframe);\r
                                } else {\r
@@ -1597,12 +1819,12 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                YAHOO.util.Dom.setStyle(this.iframe, "padding", "0");\r
                                YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
                                if (this.cfg.getProperty("visible")) {\r
-                                       showIframe.call(this);\r
+                                       this.showIframe();\r
                                } else {\r
-                                       hideIframe.call(this);\r
+                                       this.hideIframe();\r
                                }\r
                        }\r
-                       \r
+\r
                        var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");\r
 \r
                        if (iframeDisplay == "none") {\r
@@ -1611,8 +1833,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
 \r
                        YAHOO.util.Dom.setXY(this.iframe, [x,y]);\r
 \r
-                       var width = el.clientWidth;\r
-                       var height = el.clientHeight;\r
+                       var width = this.element.clientWidth;\r
+                       var height = this.element.clientHeight;\r
 \r
                        YAHOO.util.Dom.setStyle(this.iframe, "width", (width+2) + "px");\r
                        YAHOO.util.Dom.setStyle(this.iframe, "height", (height+2) + "px");\r
@@ -1625,14 +1847,18 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                if (this.iframe) {\r
                        this.iframe.style.display = "none";\r
                }\r
-               this.showEvent.unsubscribe(showIframe, this);\r
-               this.hideEvent.unsubscribe(hideIframe, this);\r
+               this.showEvent.unsubscribe(this.showIframe, this);\r
+               this.hideEvent.unsubscribe(this.hideIframe, this);\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The default event handler fired when the "constraintoviewport" property is changed.\r
+* @method configConstrainToViewport\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args, obj) {\r
        var val = args[0];\r
@@ -1643,10 +1869,14 @@ YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args,
        } else {\r
                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {\r
        var contextArgs = args[0];\r
@@ -1660,27 +1890,28 @@ YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {
                        if (typeof contextEl == "string") {\r
                                this.cfg.setProperty("context", [document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner], true);\r
                        }\r
-                       \r
+\r
                        if (elementMagnetCorner && contextMagnetCorner) {\r
                                this.align(elementMagnetCorner, contextMagnetCorner);\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.\r
-* @param {string} elementAlign         The string representing the corner of the Overlay that should be aligned to the context element\r
-* @param {string} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
+* @method align\r
+* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element\r
+* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
 */\r
 YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {\r
        var contextArgs = this.cfg.getProperty("context");\r
        if (contextArgs) {\r
                var context = contextArgs[0];\r
-               \r
+\r
                var element = this.element;\r
                var me = this;\r
 \r
@@ -1711,7 +1942,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                                me.moveTo(h-element.offsetWidth,v-element.offsetHeight);\r
                                                break;\r
                                }\r
-                       }\r
+                       };\r
 \r
                        switch (contextAlign) {\r
                                case YAHOO.widget.Overlay.TOP_LEFT:\r
@@ -1719,7 +1950,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                        break;\r
                                case YAHOO.widget.Overlay.TOP_RIGHT:\r
                                        doAlign(contextRegion.top, contextRegion.right);\r
-                                       break;          \r
+                                       break;\r
                                case YAHOO.widget.Overlay.BOTTOM_LEFT:\r
                                        doAlign(contextRegion.bottom, contextRegion.left);\r
                                        break;\r
@@ -1729,10 +1960,14 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                        }\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.\r
+* @method enforceConstraints\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1740,26 +1975,20 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        var x = pos[0];\r
        var y = pos[1];\r
 \r
-       var width = parseInt(this.cfg.getProperty("width"));\r
-\r
-       if (isNaN(width)) {\r
-               width = 0;\r
-       }\r
-\r
        var offsetHeight = this.element.offsetHeight;\r
-       var offsetWidth = (width>0?width:this.element.offsetWidth); //this.element.offsetWidth;\r
+       var offsetWidth = this.element.offsetWidth;\r
 \r
        var viewPortWidth = YAHOO.util.Dom.getViewportWidth();\r
        var viewPortHeight = YAHOO.util.Dom.getViewportHeight();\r
 \r
-       var scrollX = window.scrollX || document.documentElement.scrollLeft;\r
-       var scrollY = window.scrollY || document.documentElement.scrollTop;\r
+       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
+       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;\r
 \r
        var topConstraint = scrollY + 10;\r
        var leftConstraint = scrollX + 10;\r
        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-       \r
+\r
        if (x < leftConstraint) {\r
                x = leftConstraint;\r
        } else if (x > rightConstraint) {\r
@@ -1775,10 +2004,11 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        this.cfg.setProperty("x", x, true);\r
        this.cfg.setProperty("y", y, true);\r
        this.cfg.setProperty("xy", [x,y], true);\r
-}\r
+};\r
 \r
 /**\r
 * Centers the container in the viewport.\r
+* @method center\r
 */\r
 YAHOO.widget.Overlay.prototype.center = function() {\r
        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
@@ -1792,161 +2022,195 @@ YAHOO.widget.Overlay.prototype.center = function() {
 \r
        var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;\r
        var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;\r
-       \r
-       this.element.style.left = parseInt(x) + "px";\r
-       this.element.style.top = parseInt(y) + "px";\r
-       this.syncPosition();\r
+\r
+       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);\r
 \r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.\r
+* @method syncPosition\r
 */\r
 YAHOO.widget.Overlay.prototype.syncPosition = function() {\r
        var pos = YAHOO.util.Dom.getXY(this.element);\r
        this.cfg.setProperty("x", pos[0], true);\r
        this.cfg.setProperty("y", pos[1], true);\r
        this.cfg.setProperty("xy", pos, true);\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
 YAHOO.widget.Overlay.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Overlay.superclass.onDomResize.call(this, e, obj);\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+       var me = this;\r
+       setTimeout(function() {\r
+               me.syncPosition();\r
+               me.cfg.refireEvent("iframe");\r
+               me.cfg.refireEvent("context");\r
+       }, 0);\r
+};\r
 \r
 /**\r
 * Removes the Overlay element from the DOM and sets all child elements to null.\r
+* @method destroy\r
 */\r
 YAHOO.widget.Overlay.prototype.destroy = function() {\r
        if (this.iframe) {\r
                this.iframe.parentNode.removeChild(this.iframe);\r
        }\r
-       \r
+\r
        this.iframe = null;\r
 \r
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  \r
+       YAHOO.widget.Overlay.superclass.destroy.call(this);\r
 };\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Overlay.\r
+*/\r
 YAHOO.widget.Overlay.prototype.toString = function() {\r
        return "Overlay " + this.id;\r
-}\r
+};\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window scroll\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowScrollEvent\r
 */\r
 YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window resize\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowResizeEvent\r
 */\r
 YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window scroll\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowScrollHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM scroll event\r
 */\r
 YAHOO.widget.Overlay.windowScrollHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowScrollEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.scrollEnd) {\r
+                       window.scrollEnd = -1;\r
+               }\r
+               clearTimeout(window.scrollEnd);\r
+               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowScrollEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window resize\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowResizeHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM resize event\r
 */\r
 YAHOO.widget.Overlay.windowResizeHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowResizeEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.resizeEnd) {\r
+                       window.resizeEnd = -1;\r
+               }\r
+               clearTimeout(window.resizeEnd);\r
+               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowResizeEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
+* A boolean that indicated whether the window resize and scroll events have already been subscribed to.\r
+* @property YAHOO.widget.Overlay._initialized\r
 * @private\r
+* @type Boolean\r
 */\r
-YAHOO.widget.Overlay._initialized == null;\r
+YAHOO.widget.Overlay._initialized = null;\r
 \r
-if (YAHOO.widget.Overlay._initialized == null) {\r
+if (YAHOO.widget.Overlay._initialized === null) {\r
        YAHOO.util.Event.addListener(window, "scroll", YAHOO.widget.Overlay.windowScrollHandler);\r
        YAHOO.util.Event.addListener(window, "resize", YAHOO.widget.Overlay.windowResizeHandler);\r
 \r
        YAHOO.widget.Overlay._initialized = true;\r
 }\r
+\r
 /**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
-* OverlayManager is used for maintaining the focus status of multiple Overlays.\r
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
-* @param {object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
+* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget\r
+* @namespace YAHOO.widget\r
+* @class OverlayManager\r
 * @constructor\r
+* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
+* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
 */\r
 YAHOO.widget.OverlayManager = function(userConfig) {\r
        this.init(userConfig);\r
-}\r
+};\r
 \r
 /**\r
 * The CSS class representing a focused Overlay\r
-* @type string\r
+* @property YAHOO.widget.OverlayManager.CSS_FOCUSED\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";\r
 \r
 YAHOO.widget.OverlayManager.prototype = {\r
-\r
+       /**\r
+       * The class's constructor function\r
+       * @property contructor\r
+       * @type Function\r
+       */\r
        constructor : YAHOO.widget.OverlayManager,\r
 \r
        /**\r
        * The array of Overlays that are currently registered\r
-       * @type Array\r
+       * @property overlays\r
+       * @type YAHOO.widget.Overlay[]\r
        */\r
        overlays : null,\r
 \r
        /**\r
        * Initializes the default configuration of the OverlayManager\r
-       */      \r
+       * @method initDefaultConfig\r
+       */\r
        initDefaultConfig : function() {\r
+               /**\r
+               * The collection of registered Overlays in use by the OverlayManager\r
+               * @config overlays\r
+               * @type YAHOO.widget.Overlay[]\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("overlays", { suppressEvent:true } );\r
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
-       }, \r
-\r
-       /**\r
-       * Returns the currently focused Overlay\r
-       * @return {Overlay}     The currently focused Overlay\r
-       */\r
-       getActive : function() {},\r
-\r
-       /**\r
-       * Focuses the specified Overlay\r
-       * @param {Overlay}      The Overlay to focus\r
-       * @param {string}       The id of the Overlay to focus\r
-       */\r
-       focus : function(overlay) {},\r
 \r
-       /**\r
-       * Removes the specified Overlay from the manager\r
-       * @param {Overlay}      The Overlay to remove\r
-       * @param {string}       The id of the Overlay to remove\r
-       */\r
-       remove: function(overlay) {},\r
-\r
-       /**\r
-       * Removes focus from all registered Overlays in the manager\r
-       */\r
-       blurAll : function() {},\r
+               /**\r
+               * The default DOM event that should be used to focus an Overlay\r
+               * @config focusevent\r
+               * @type String\r
+               * @default "mousedown"\r
+               */\r
+               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
+       },\r
 \r
        /**\r
        * Initializes the OverlayManager\r
-       * @param {Array}        overlays        Optional. A collection of Overlays to register with the manager.\r
-       * @param {object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
+       * @method init\r
+       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.\r
+       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
        */\r
        init : function(userConfig) {\r
+               /**\r
+               * The OverlayManager's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
 \r
                this.initDefaultConfig();\r
@@ -1956,12 +2220,29 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
                this.cfg.fireQueue();\r
 \r
+               /**\r
+               * The currently activated Overlay\r
+               * @property activeOverlay\r
+               * @private\r
+               * @type YAHOO.widget.Overlay\r
+               */\r
                var activeOverlay = null;\r
 \r
+               /**\r
+               * Returns the currently focused Overlay\r
+               * @method getActive\r
+               * @return {YAHOO.widget.Overlay}        The currently focused Overlay\r
+               */\r
                this.getActive = function() {\r
                        return activeOverlay;\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Focuses the specified Overlay\r
+               * @method focus\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus\r
+               * @param {String} overlay       The id of the Overlay to focus\r
+               */\r
                this.focus = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1971,12 +2252,18 @@ YAHOO.widget.OverlayManager.prototype = {
                                this.overlays.sort(this.compareZIndexDesc);\r
                                var topZIndex = YAHOO.util.Dom.getStyle(this.overlays[0].element, "zIndex");\r
                                if (! isNaN(topZIndex) && this.overlays[0] != overlay) {\r
-                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex) + 1));\r
+                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex, 10) + 2));\r
                                }\r
                                this.overlays.sort(this.compareZIndexDesc);\r
                        }\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Removes the specified Overlay from the manager\r
+               * @method remove\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove\r
+               * @param {String} overlay       The id of the Overlay to remove\r
+               */\r
                this.remove = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1987,24 +2274,28 @@ YAHOO.widget.OverlayManager.prototype = {
                                o.cfg.setProperty("zIndex", originalZ, true);\r
 \r
                                o.cfg.setProperty("manager", null);\r
-                               o.focusEvent = null\r
+                               o.focusEvent = null;\r
                                o.blurEvent = null;\r
                                o.focus = null;\r
                                o.blur = null;\r
                        }\r
-               }\r
+               };\r
 \r
+               /**\r
+               * Removes focus from all registered Overlays in the manager\r
+               * @method blurAll\r
+               */\r
                this.blurAll = function() {\r
                        activeOverlay = null;\r
                        for (var o=0;o<this.overlays.length;o++) {\r
                                YAHOO.util.Dom.removeClass(this.overlays[o].element, YAHOO.widget.OverlayManager.CSS_FOCUSED);\r
-                       }               \r
-               }\r
+                       }\r
+               };\r
 \r
                var overlays = this.cfg.getProperty("overlays");\r
-               \r
+\r
                if (! this.overlays) {\r
-                       this.overlays = new Array();\r
+                       this.overlays = [];\r
                }\r
 \r
                if (overlays) {\r
@@ -2015,9 +2306,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each.\r
-       * @param {Overlay}      overlay         An Overlay to register with the manager.\r
-       * @param {Overlay[]}    overlay         An array of Overlays to register with the manager.\r
-       * @return       {boolean}       True if any Overlays are registered.\r
+       * @method register\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.\r
+       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.\r
+       * @return       {Boolean}       True if any Overlays are registered.\r
        */\r
        register : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2025,33 +2317,33 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
                        overlay.focusEvent = new YAHOO.util.CustomEvent("focus");\r
                        overlay.blurEvent = new YAHOO.util.CustomEvent("blur");\r
-                       \r
+\r
                        var mgr=this;\r
 \r
                        overlay.focus = function() {\r
                                mgr.focus(this);\r
                                this.focusEvent.fire();\r
-                       } \r
+                       };\r
 \r
                        overlay.blur = function() {\r
                                mgr.blurAll();\r
                                this.blurEvent.fire();\r
-                       }\r
+                       };\r
 \r
                        var focusOnDomEvent = function(e,obj) {\r
                                overlay.focus();\r
-                       }\r
-                       \r
+                       };\r
+\r
                        var focusevent = this.cfg.getProperty("focusevent");\r
                        YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);\r
 \r
                        var zIndex = YAHOO.util.Dom.getStyle(overlay.element, "zIndex");\r
                        if (! isNaN(zIndex)) {\r
-                               overlay.cfg.setProperty("zIndex", parseInt(zIndex));\r
+                               overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));\r
                        } else {\r
                                overlay.cfg.setProperty("zIndex", 0);\r
                        }\r
-                       \r
+\r
                        this.overlays.push(overlay);\r
                        return true;\r
                } else if (overlay instanceof Array) {\r
@@ -2071,9 +2363,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Attempts to locate an Overlay by instance or ID.\r
-       * @param {Overlay}      overlay         An Overlay to locate within the manager\r
-       * @param {string}       overlay         An Overlay id to locate within the manager\r
-       * @return       {Overlay}       The requested Overlay, if found, or null if it cannot be located.\r
+       * @method find\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager\r
+       * @param {String}       overlay         An Overlay id to locate within the manager\r
+       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.\r
        */\r
        find : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2083,18 +2376,20 @@ YAHOO.widget.OverlayManager.prototype = {
                                }\r
                        }\r
                } else if (typeof overlay == "string") {\r
-                       for (var o=0;o<this.overlays.length;o++) {\r
-                               if (this.overlays[o].id == overlay) {\r
-                                       return this.overlays[o];\r
+                       for (var p=0;p<this.overlays.length;p++) {\r
+                               if (this.overlays[p].id == overlay) {\r
+                                       return this.overlays[p];\r
                                }\r
-                       }                       \r
+                       }\r
                }\r
                return null;\r
        },\r
 \r
        /**\r
        * Used for sorting the manager's Overlays by z-index.\r
+       * @method compareZIndexDesc\r
        * @private\r
+       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.\r
        */\r
        compareZIndexDesc : function(o1, o2) {\r
                var zIndex1 = o1.cfg.getProperty("zIndex");\r
@@ -2111,6 +2406,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Shows all Overlays in the manager.\r
+       * @method showAll\r
        */\r
        showAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2120,6 +2416,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Hides all Overlays in the manager.\r
+       * @method hideAll\r
        */\r
        hideAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2129,24 +2426,26 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * @method toString\r
+       * @return {String}      The string representation of the OverlayManager\r
+       */\r
        toString : function() {\r
                return "OverlayManager";\r
        }\r
 \r
-}/**\r
-* Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-* Code licensed under the BSD License:\r
-* http://developer.yahoo.net/yui/license.txt\r
+};\r
+\r
+/**\r
 * KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.\r
-* @param {Element}     attachTo        The element or element ID to which the key event should be attached\r
-* @param {string}      attachTo        The element or element ID to which the key event should be attached\r
-* @param {object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
-* @param {function}    handler         The CustomEvent handler to fire when the key event is detected\r
-* @param {object}      handler         An object literal representing the handler. \r
-* @param {string}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
+* @namespace YAHOO.util\r
+* @class KeyListener\r
 * @constructor\r
+* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached\r
+* @param {String}      attachTo        The element or element ID to which the key event should be attached\r
+* @param {Object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected\r
+* @param {Object}      handler         An object literal representing the handler.\r
+* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
 */\r
 YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {\r
        if (! attachTo) {\r
@@ -2163,9 +2462,26 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
                event = YAHOO.util.KeyListener.KEYDOWN;\r
        }\r
 \r
+       /**\r
+       * The CustomEvent fired internally when a key is pressed\r
+       * @event keyEvent\r
+       * @private\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        var keyEvent = new YAHOO.util.CustomEvent("keyPressed");\r
-       \r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is enabled via the enable() function\r
+       * @event enabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.enabledEvent = new YAHOO.util.CustomEvent("enabled");\r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is disabled via the disable() function\r
+       * @event disabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.disabledEvent = new YAHOO.util.CustomEvent("disabled");\r
 \r
        if (typeof attachTo == 'string') {\r
@@ -2180,133 +2496,142 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
 \r
        /**\r
        * Handles the key event when a key is pressed.\r
+       * @method handleKeyPress\r
+       * @param {DOMEvent} e   The keypress DOM event\r
+       * @param {Object}       obj     The DOM event scope object\r
        * @private\r
        */\r
        function handleKeyPress(e, obj) {\r
-               var keyPressed = e.charCode || e.keyCode;\r
-               \r
-               if (! keyData.shift)    keyData.shift = false;\r
-               if (! keyData.alt)              keyData.alt = false;\r
-               if (! keyData.ctrl)             keyData.ctrl = false;\r
+               if (! keyData.shift) {\r
+                       keyData.shift = false;\r
+               }\r
+               if (! keyData.alt) {\r
+                       keyData.alt = false;\r
+               }\r
+               if (! keyData.ctrl) {\r
+                       keyData.ctrl = false;\r
+               }\r
 \r
                // check held down modifying keys first\r
-               if (e.shiftKey == keyData.shift && \r
+               if (e.shiftKey == keyData.shift &&\r
                        e.altKey   == keyData.alt &&\r
                        e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match\r
 \r
+                       var dataItem;\r
+                       var keyPressed;\r
+\r
                        if (keyData.keys instanceof Array) {\r
                                for (var i=0;i<keyData.keys.length;i++) {\r
-                                       if (keyPressed == keyData.keys[i]) {\r
-                                               keyEvent.fire(keyPressed, e);\r
+                                       dataItem = keyData.keys[i];\r
+\r
+                                       if (dataItem == e.charCode ) {\r
+                                               keyEvent.fire(e.charCode, e);\r
+                                               break;\r
+                                       } else if (dataItem == e.keyCode) {\r
+                                               keyEvent.fire(e.keyCode, e);\r
                                                break;\r
                                        }\r
                                }\r
                        } else {\r
-                               if (keyPressed == keyData.keys) {\r
-                                       keyEvent.fire(keyPressed, e);\r
+                               dataItem = keyData.keys;\r
+                               if (dataItem == e.charCode ) {\r
+                                       keyEvent.fire(e.charCode, e);\r
+                               } else if (dataItem == e.keyCode) {\r
+                                       keyEvent.fire(e.keyCode, e);\r
                                }\r
                        }\r
                }\r
        }\r
 \r
+       /**\r
+       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element\r
+       * @method enable\r
+       */\r
        this.enable = function() {\r
                if (! this.enabled) {\r
                        YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);\r
                        this.enabledEvent.fire(keyData);\r
                }\r
+               /**\r
+               * Boolean indicating the enabled/disabled state of the Tooltip\r
+               * @property enabled\r
+               * @type Boolean\r
+               */\r
                this.enabled = true;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Disables the KeyListener by removing the DOM event listeners from the target DOM element\r
+       * @method disable\r
+       */\r
        this.disable = function() {\r
                if (this.enabled) {\r
                        YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);\r
                        this.disabledEvent.fire(keyData);\r
                }\r
                this.enabled = false;\r
-       }\r
+       };\r
 \r
        /**\r
-       * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * Returns a String representation of the object.\r
+       * @method toString\r
+       * @return {String}      The string representation of the KeyListener\r
+       */\r
        this.toString = function() {\r
                return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");\r
-       }\r
+       };\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the DOM "keydown" event.\r
+* @property YAHOO.util.KeyListener.KEYDOWN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYDOWN = "keydown";\r
 \r
 /**\r
 * Constant representing the DOM "keyup" event.\r
+* @property YAHOO.util.KeyListener.KEYUP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYUP = "keyup";\r
 \r
 /**\r
-* Boolean indicating the enabled/disabled state of the Tooltip\r
-* @type Booleam\r
-*/\r
-YAHOO.util.KeyListener.prototype.enabled = null;\r
-\r
-/**\r
-* Enables the KeyListener, by dynamically attaching the key event to the appropriate DOM element.\r
-*/\r
-YAHOO.util.KeyListener.prototype.enable = function() {};\r
-\r
-/**\r
-* Disables the KeyListener, by dynamically removing the key event from the appropriate DOM element.\r
-*/\r
-YAHOO.util.KeyListener.prototype.disable = function() {};\r
-\r
-/**\r
-* CustomEvent fired when the KeyListener is enabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.util.KeyListener.prototype.enabledEvent = null;\r
-\r
-/**\r
-* CustomEvent fired when the KeyListener is disabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.util.KeyListener.prototype.disabledEvent = null;\r
-/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
 * Tooltip is an implementation of Overlay that behaves like an OS tooltip, displaying when the user mouses over a particular element, and disappearing on mouse out.\r
-* @param {string}      el      The element ID representing the Tooltip <em>OR</em>\r
-* @param {Element}     el      The element representing the Tooltip\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Tooltip\r
+* @extends YAHOO.widget.Overlay\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Tooltip <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Tooltip\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Tooltip = function(el, userConfig) {\r
        YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Tooltip, YAHOO.widget.Overlay);\r
 \r
-YAHOO.widget.Tooltip.logger = new YAHOO.widget.LogWriter("Tooltip");\r
-\r
 /**\r
 * Constant representing the Tooltip CSS class\r
-* @type string\r
+* @property YAHOO.widget.Tooltip.CSS_TOOLTIP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Tooltip.CSS_TOOLTIP = "tt";\r
 \r
 /**\r
 * The Tooltip initialization method. This method is automatically called by the constructor. A Tooltip is automatically rendered by the init method, and it also is set to be invisible by default, and constrained to viewport by default as well.\r
-* @param {string}      el      The element ID representing the Tooltip <em>OR</em>\r
-* @param {Element}     el      The element representing the Tooltip\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Tooltip <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Tooltip\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {\r
        this.logger = YAHOO.widget.Tooltip.logger;\r
@@ -2314,7 +2639,7 @@ YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
        if (document.readyState && document.readyState != "complete") {\r
                var deferredInit = function() {\r
                        this.init(el, userConfig);\r
-               }\r
+               };\r
                YAHOO.util.Event.addListener(window, "load", deferredInit, this, true);\r
        } else {\r
                YAHOO.widget.Tooltip.superclass.init.call(this, el);\r
@@ -2326,7 +2651,7 @@ YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
                if (userConfig) {\r
                        this.cfg.applyConfig(userConfig, true);\r
                }\r
-               \r
+\r
                this.cfg.queueProperty("visible",false);\r
                this.cfg.queueProperty("constraintoviewport",true);\r
 \r
@@ -2335,53 +2660,113 @@ YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
 \r
                this.initEvent.fire(YAHOO.widget.Tooltip);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Tooltip.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);\r
 \r
+       /**\r
+       * Specifies whether the Tooltip should be kept from overlapping its context element.\r
+       * @config preventoverlap\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("preventoverlap",          { value:true, validator:this.cfg.checkBoolean, supercedes:["x","y","xy"] } );\r
 \r
+       /**\r
+       * The number of milliseconds to wait before showing a Tooltip on mouseover.\r
+       * @config showdelay\r
+       * @type Number\r
+       * @default 200\r
+       */\r
        this.cfg.addProperty("showdelay",                       { value:200, handler:this.configShowDelay, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The number of milliseconds to wait before automatically dismissing a Tooltip after the mouse has been resting on the context element.\r
+       * @config autodismissdelay\r
+       * @type Number\r
+       * @default 5000\r
+       */\r
        this.cfg.addProperty("autodismissdelay",        { value:5000, handler:this.configAutoDismissDelay, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The number of milliseconds to wait before hiding a Tooltip on mouseover.\r
+       * @config hidedelay\r
+       * @type Number\r
+       * @default 250\r
+       */\r
        this.cfg.addProperty("hidedelay",                       { value:250, handler:this.configHideDelay, validator:this.cfg.checkNumber } );\r
 \r
+       /**\r
+       * Specifies the Tooltip's text.\r
+       * @config text\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("text",                            { handler:this.configText, suppressEvent:true } );\r
+\r
+       /**\r
+       * Specifies the container element that the Tooltip's markup should be rendered into.\r
+       * @config container\r
+       * @type HTMLElement/String\r
+       * @default document.body\r
+       */\r
        this.cfg.addProperty("container",                       { value:document.body, handler:this.configContainer } );\r
-}\r
+\r
+       /**\r
+       * Specifies the element or elements that the Tooltip should be anchored to on mouseover.\r
+       * @config context\r
+       * @type HTMLElement[]/String[]\r
+       * @default null\r
+       */\r
+\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "text" property is changed.\r
+* @method configText\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configText = function(type, args, obj) {\r
        var text = args[0];\r
        if (text) {\r
                this.setBody(text);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "container" property is changed.\r
+* @method configContainer\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configContainer = function(type, args, obj) {\r
        var container = args[0];\r
        if (typeof container == 'string') {\r
                this.cfg.setProperty("container", document.getElementById(container), true);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {\r
        var context = args[0];\r
        if (context) {\r
-               \r
+\r
                // Normalize parameter into an array\r
                if (! (context instanceof Array)) {\r
                        if (typeof context == "string") {\r
@@ -2405,14 +2790,14 @@ YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
 \r
                // Add mouseover/mouseout listeners to context elements\r
                this._context = context;\r
-               for (var c=0;c<this._context.length;++c) {\r
-                       var el = this._context[c];\r
-                       YAHOO.util.Event.addListener(el, "mouseover", this.onContextMouseOver, this);\r
-                       YAHOO.util.Event.addListener(el, "mousemove", this.onContextMouseMove, this);\r
-                       YAHOO.util.Event.addListener(el, "mouseout", this.onContextMouseOut, this);\r
+               for (var d=0;d<this._context.length;++d) {\r
+                       var el2 = this._context[d];\r
+                       YAHOO.util.Event.addListener(el2, "mouseover", this.onContextMouseOver, this);\r
+                       YAHOO.util.Event.addListener(el2, "mousemove", this.onContextMouseMove, this);\r
+                       YAHOO.util.Event.addListener(el2, "mouseout", this.onContextMouseOut, this);\r
                }\r
        }\r
-}\r
+};\r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
@@ -2420,19 +2805,21 @@ YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
 \r
 /**\r
 * The default event handler fired when the user moves the mouse while over the context element.\r
+* @method onContextMouseMove\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseMove = function(e, obj) {\r
        obj.pageX = YAHOO.util.Event.getPageX(e);\r
        obj.pageY = YAHOO.util.Event.getPageY(e);\r
 \r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the user mouses over the context element.\r
+* @method onContextMouseOver\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {\r
 \r
@@ -2441,7 +2828,7 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
                obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time");\r
                obj.hideProcId = null;\r
        }\r
-       \r
+\r
        var context = this;\r
        YAHOO.util.Event.addListener(context, "mousemove", obj.onContextMouseMove, obj);\r
 \r
@@ -2456,12 +2843,13 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
        */\r
        obj.showProcId = obj.doShow(e, context);\r
        obj.logger.log("Setting show tooltip timeout: " + this.showProcId, "time");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the user mouses out of the context element.\r
+* @method onContextMouseOut\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {\r
        var el = this;\r
@@ -2470,11 +2858,11 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
                el.title = obj._tempTitle;\r
                obj._tempTitle = null;\r
        }\r
-       \r
+\r
        if (obj.showProcId) {\r
                clearTimeout(obj.showProcId);\r
                obj.logger.log("Clearing show timer: " + obj.showProcId, "time");\r
-               obj.showProcId = null;          \r
+               obj.showProcId = null;\r
        }\r
 \r
        if (obj.hideProcId) {\r
@@ -2487,17 +2875,18 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
        obj.hideProcId = setTimeout(function() {\r
                                obj.hide();\r
                                }, obj.cfg.getProperty("hidedelay"));\r
-}\r
+};\r
 \r
 // END BUILT-IN DOM EVENT HANDLERS //\r
 \r
 /**\r
 * Processes the showing of the Tooltip by setting the timeout delay and offset of the Tooltip.\r
+* @method doShow\r
 * @param {DOMEvent} e  The current DOM event\r
-* @return {int}        The process ID of the timeout function associated with doShow\r
+* @return {Number}     The process ID of the timeout function associated with doShow\r
 */\r
 YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {\r
-       \r
+\r
        var yOffset = 25;\r
        if (this.browser == "opera" && context.tagName == "A") {\r
                yOffset += 12;\r
@@ -2517,7 +2906,7 @@ YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
                        if (me.cfg.getProperty("preventoverlap")) {\r
                                me.preventOverlap(me.pageX, me.pageY);\r
                        }\r
-                       \r
+\r
                        YAHOO.util.Event.removeListener(context, "mousemove", me.onContextMouseMove);\r
 \r
                        me.show();\r
@@ -2525,10 +2914,11 @@ YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
                        me.logger.log("Hide tooltip time active: " + me.hideProcId, "time");\r
                },\r
        this.cfg.getProperty("showdelay"));\r
-}\r
+};\r
 \r
 /**\r
 * Sets the timeout for the auto-dismiss delay, which by default is 5 seconds, meaning that a tooltip will automatically dismiss itself after 5 seconds of being displayed.\r
+* @method doHide\r
 */\r
 YAHOO.widget.Tooltip.prototype.doHide = function() {\r
        var me = this;\r
@@ -2539,15 +2929,18 @@ YAHOO.widget.Tooltip.prototype.doHide = function() {
                        me.hide();\r
                },\r
                this.cfg.getProperty("autodismissdelay"));\r
-}\r
+};\r
 \r
 /**\r
 * Fired when the Tooltip is moved, this event handler is used to prevent the Tooltip from overlapping with its context element.\r
+* @method preventOverlay\r
+* @param {Number} pageX        The x coordinate position of the mouse pointer\r
+* @param {Number} pageY        The y coordinate position of the mouse pointer\r
 */\r
 YAHOO.widget.Tooltip.prototype.preventOverlap = function(pageX, pageY) {\r
-       \r
+\r
        var height = this.element.offsetHeight;\r
-       \r
+\r
        var elementRegion = YAHOO.util.Dom.getRegion(this.element);\r
 \r
        elementRegion.top -= 5;\r
@@ -2556,82 +2949,75 @@ YAHOO.widget.Tooltip.prototype.preventOverlap = function(pageX, pageY) {
        elementRegion.bottom += 5;\r
 \r
        var mousePoint = new YAHOO.util.Point(pageX, pageY);\r
-       \r
+\r
        this.logger.log("context " + elementRegion, "ttip");\r
        this.logger.log("mouse " + mousePoint, "ttip");\r
 \r
        if (elementRegion.contains(mousePoint)) {\r
                this.logger.log("OVERLAP", "warn");\r
-               this.cfg.setProperty("y", (pageY-height-5))\r
+               this.cfg.setProperty("y", (pageY-height-5));\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the Tooltip\r
+*/\r
 YAHOO.widget.Tooltip.prototype.toString = function() {\r
        return "Tooltip " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * Panel is an implementation of Overlay that behaves like an OS window, with a draggable header and an optional close icon at the top right.\r
-* @param {string}      el      The element ID representing the Panel <em>OR</em>\r
-* @param {Element}     el      The element representing the Panel\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Panel\r
+* @extends YAHOO.widget.Overlay\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Panel <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Panel\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Panel = function(el, userConfig) {\r
        YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Panel, YAHOO.widget.Overlay);\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Panel\r
-* @type string\r
+* @property YAHOO.widget.Panel.CSS_PANEL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Panel.CSS_PANEL = "panel";\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Panel's wrapping container\r
-* @type string\r
+* @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Panel.CSS_PANEL_CONTAINER = "panel-container";\r
 \r
-/**\r
-* CustomEvent fired after the modality mask is shown\r
-* args: none\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Panel.prototype.showMaskEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after the modality mask is hidden\r
-* args: none\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Panel.prototype.hideMaskEvent = null;\r
-\r
 /**\r
 * The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Panel.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.Panel.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
+\r
        this.beforeInitEvent.fire(YAHOO.widget.Panel);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Panel.CSS_PANEL);\r
 \r
-       this.buildWrapper();                    \r
-       \r
+       this.buildWrapper();\r
+\r
        if (userConfig) {\r
                this.cfg.applyConfig(userConfig, true);\r
        }\r
@@ -2645,9 +3031,35 @@ YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
                }\r
        }, this, true);\r
 \r
-       this.initEvent.fire(YAHOO.widget.Panel);\r
+       var me = this;\r
 \r
-}\r
+       this.showMaskEvent.subscribe(function() {\r
+               var checkFocusable = function(el) {\r
+                       if (el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") {\r
+                               if (! YAHOO.util.Dom.isAncestor(me.element, el)) {\r
+                                       YAHOO.util.Event.addListener(el, "focus", el.blur);\r
+                                       return true;\r
+                               }\r
+                       } else {\r
+                               return false;\r
+                       }\r
+               };\r
+\r
+               this.focusableElements = YAHOO.util.Dom.getElementsBy(checkFocusable);\r
+       }, this, true);\r
+\r
+       this.hideMaskEvent.subscribe(function() {\r
+               for (var i=0;i<this.focusableElements.length;i++) {\r
+                       var el2 = this.focusableElements[i];\r
+                       YAHOO.util.Event.removeListener(el2, "focus", el2.blur);\r
+               }\r
+       }, this, true);\r
+\r
+       this.beforeShowEvent.subscribe(function() {\r
+               this.cfg.refireEvent("underlay");\r
+       }, this, true);\r
+       this.initEvent.fire(YAHOO.widget.Panel);\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
@@ -2655,40 +3067,90 @@ YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
 YAHOO.widget.Panel.prototype.initEvents = function() {\r
        YAHOO.widget.Panel.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired after the modality mask is shown\r
+       * @event showMaskEvent\r
+       */\r
        this.showMaskEvent = new YAHOO.util.CustomEvent("showMask");\r
+\r
+       /**\r
+       * CustomEvent fired after the modality mask is hidden\r
+       * @event hideMaskEvent\r
+       */\r
        this.hideMaskEvent = new YAHOO.util.CustomEvent("hideMask");\r
 \r
+       /**\r
+       * CustomEvent when the Panel is dragged\r
+       * @event dragEvent\r
+       */\r
        this.dragEvent = new YAHOO.util.CustomEvent("drag");\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Panel's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Panel.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);\r
 \r
        // Add panel config properties //\r
 \r
+       /**\r
+       * True if the Panel should display a "close" button\r
+       * @config close\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("close", { value:true, handler:this.configClose, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
+\r
+       /**\r
+       * True if the Panel should be draggable\r
+       * @config draggable\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("draggable", { value:true, handler:this.configDraggable, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
 \r
+       /**\r
+       * Sets the type of underlay to display for the Panel. Valid values are "shadow", "matte", and "none".\r
+       * @config underlay\r
+       * @type String\r
+       * @default shadow\r
+       */\r
        this.cfg.addProperty("underlay", { value:"shadow", handler:this.configUnderlay, supercedes:["visible"] } );\r
+\r
+       /**\r
+       * True if the Panel should be displayed in a modal fashion, automatically creating a transparent mask over the document that will not be removed until the Panel is dismissed.\r
+       * @config modal\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("modal",   { value:false, handler:this.configModal, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
 \r
+       /**\r
+       * A KeyListener (or array of KeyListeners) that will be enabled when the Panel is shown, and disabled when the Panel is hidden.\r
+       * @config keylisteners\r
+       * @type YAHOO.util.KeyListener[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("keylisteners", { handler:this.configKeyListeners, suppressEvent:true, supercedes:["visible"] } );\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "close" property is changed. The method controls the appending or hiding of the close icon at the top right of the Panel.\r
+* @method configClose\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        var doHide = function(e, obj) {\r
                obj.hide();\r
-       }\r
+       };\r
 \r
        if (val) {\r
                if (! this.close) {\r
@@ -2703,7 +3165,7 @@ YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {
 \r
                        this.close.innerHTML = "&nbsp;";\r
                        this.innerElement.appendChild(this.close);\r
-                       YAHOO.util.Event.addListener(this.close, "click", doHide, this);        \r
+                       YAHOO.util.Event.addListener(this.close, "click", doHide, this);\r
                } else {\r
                        this.close.style.display = "block";\r
                }\r
@@ -2712,10 +3174,14 @@ YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {
                        this.close.style.display = "none";\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "draggable" property is changed.\r
+* @method configDraggable\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configDraggable = function(type, args, obj) {\r
        var val = args[0];\r
@@ -2732,10 +3198,14 @@ YAHOO.widget.Panel.prototype.configDraggable = function(type, args, obj) {
                        YAHOO.util.Dom.setStyle(this.header,"cursor","auto");\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "underlay" property is changed.\r
+* @method configUnderlay\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {\r
        var val = args[0];\r
@@ -2750,7 +3220,7 @@ YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {
                                this.underlay.className = "underlay";\r
                                this.underlay.innerHTML = "&nbsp;";\r
                                this.element.appendChild(this.underlay);\r
-                       } \r
+                       }\r
 \r
                        this.sizeUnderlay();\r
                        break;\r
@@ -2758,16 +3228,19 @@ YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {
                        YAHOO.util.Dom.removeClass(this.element, "shadow");\r
                        YAHOO.util.Dom.addClass(this.element, "matte");\r
                        break;\r
-               case "none":\r
                default:\r
                        YAHOO.util.Dom.removeClass(this.element, "shadow");\r
                        YAHOO.util.Dom.removeClass(this.element, "matte");\r
                        break;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "modal" property is changed. This handler subscribes or unsubscribes to the show and hide events to handle the display or hide of the modality mask.\r
+* @method configModal\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {\r
        var modal = args[0];\r
@@ -2775,8 +3248,8 @@ YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {
        if (modal) {\r
                this.buildMask();\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed( this.showEvent, this.showMask, this ) ) {\r
-                       this.showEvent.subscribe(this.showMask, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed( this.beforeShowEvent, this.showMask, this ) ) {\r
+                       this.beforeShowEvent.subscribe(this.showMask, this, true);\r
                }\r
                if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {\r
                        this.hideEvent.subscribe(this.hideMask, this, true);\r
@@ -2784,19 +3257,38 @@ YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {
                if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowScrollEvent, this.sizeMask, this ) ) {\r
-                       YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.sizeMask, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {\r
+                       this.destroyEvent.subscribe(this.removeMask, this, true);\r
                }\r
+\r
+               this.cfg.refireEvent("zIndex");\r
        } else {\r
                this.beforeShowEvent.unsubscribe(this.showMask, this);\r
                this.hideEvent.unsubscribe(this.hideMask, this);\r
-               YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);\r
-               YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.sizeMask);\r
+               YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);\r
+               this.destroyEvent.unsubscribe(this.removeMask, this);\r
        }\r
-}\r
+};\r
+\r
+/**\r
+* Removes the modality mask.\r
+* @method removeMask\r
+*/\r
+YAHOO.widget.Panel.prototype.removeMask = function() {\r
+       if (this.mask) {\r
+               if (this.mask.parentNode) {\r
+                       this.mask.parentNode.removeChild(this.mask);\r
+               }\r
+               this.mask = null;\r
+       }\r
+};\r
 \r
 /**\r
-* The default event handler fired when the "keylisteners" property is changed. \r
+* The default event handler fired when the "keylisteners" property is changed.\r
+* @method configKeyListeners\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configKeyListeners = function(type, args, obj) {\r
        var listeners = args[0];\r
@@ -2815,81 +3307,120 @@ YAHOO.widget.Panel.prototype.configKeyListeners = function(type, args, obj) {
                                }\r
                        }\r
                } else {\r
-                       if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) {\r
-                               this.showEvent.subscribe(listeners.enable, listeners, true);\r
-                       }\r
-                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {\r
-                               this.hideEvent.subscribe(listeners.disable, listeners, true);\r
-                               this.destroyEvent.subscribe(listeners.disable, listeners, true); \r
-                       }\r
+                       if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) {\r
+                               this.showEvent.subscribe(listeners.enable, listeners, true);\r
+                       }\r
+                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {\r
+                               this.hideEvent.subscribe(listeners.disable, listeners, true);\r
+                               this.destroyEvent.subscribe(listeners.disable, listeners, true);\r
+                       }\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configHeight = function(type, args, obj) {\r
+       var height = args[0];\r
+       var el = this.innerElement;\r
+       YAHOO.util.Dom.setStyle(el, "height", height);\r
+       this.cfg.refireEvent("underlay");\r
+       this.cfg.refireEvent("iframe");\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configWidth = function(type, args, obj) {\r
+       var width = args[0];\r
+       var el = this.innerElement;\r
+       YAHOO.util.Dom.setStyle(el, "width", width);\r
+       this.cfg.refireEvent("underlay");\r
+       this.cfg.refireEvent("iframe");\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configzIndex = function(type, args, obj) {\r
+       YAHOO.widget.Panel.superclass.configzIndex.call(this, type, args, obj);\r
+\r
+       var maskZ = 0;\r
+       var currentZ = YAHOO.util.Dom.getStyle(this.element, "zIndex");\r
+\r
+       if (this.mask) {\r
+               if (! currentZ || isNaN(currentZ)) {\r
+                       currentZ = 0;\r
+               }\r
+\r
+               if (currentZ === 0) {\r
+                       this.cfg.setProperty("zIndex", 1);\r
+               } else {\r
+                       maskZ = currentZ - 1;\r
+                       YAHOO.util.Dom.setStyle(this.mask, "zIndex", maskZ);\r
                }\r
-       } \r
-}\r
+\r
+       }\r
+};\r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 \r
 /**\r
 * Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a  local instance variable called container, and the element is reinserted inside of it.\r
+* @method buildWrapper\r
 */\r
 YAHOO.widget.Panel.prototype.buildWrapper = function() {\r
        var elementParent = this.element.parentNode;\r
-\r
-       var elementClone = this.element.cloneNode(true);\r
-       this.innerElement = elementClone;\r
-       this.innerElement.style.visibility = "inherit";\r
-\r
-       YAHOO.util.Dom.addClass(this.innerElement, YAHOO.widget.Panel.CSS_PANEL);\r
+       var originalElement = this.element;\r
 \r
        var wrapper = document.createElement("DIV");\r
        wrapper.className = YAHOO.widget.Panel.CSS_PANEL_CONTAINER;\r
-       wrapper.id = elementClone.id + "_c";\r
-       \r
-       wrapper.appendChild(elementClone);\r
-       \r
+       wrapper.id = originalElement.id + "_c";\r
+\r
        if (elementParent) {\r
-               elementParent.replaceChild(wrapper, this.element);\r
+               elementParent.insertBefore(wrapper, originalElement);\r
        }\r
 \r
-       this.element = wrapper;\r
-\r
-       // Resynchronize the local field references\r
+       wrapper.appendChild(originalElement);\r
 \r
-       var childNodes = this.innerElement.childNodes;\r
-       if (childNodes) {\r
-               for (var i=0;i<childNodes.length;i++) {\r
-                       var child = childNodes[i];\r
-                       switch (child.className) {\r
-                               case YAHOO.widget.Module.CSS_HEADER:\r
-                                       this.header = child;\r
-                                       break;\r
-                               case YAHOO.widget.Module.CSS_BODY:\r
-                                       this.body = child;\r
-                                       break;\r
-                               case YAHOO.widget.Module.CSS_FOOTER:\r
-                                       this.footer = child;\r
-                                       break;\r
-                       }\r
-               }\r
-       }\r
+       this.element = wrapper;\r
+       this.innerElement = originalElement;\r
 \r
-       this.initDefaultConfig(); // We've changed the DOM, so the configuration must be re-tooled to get the DOM references right\r
-}\r
+       YAHOO.util.Dom.setStyle(this.innerElement, "visibility", "inherit");\r
+};\r
 \r
 /**\r
 * Adjusts the size of the shadow based on the size of the element.\r
+* @method sizeUnderlay\r
 */\r
 YAHOO.widget.Panel.prototype.sizeUnderlay = function() {\r
        if (this.underlay && this.browser != "gecko" && this.browser != "safari") {\r
                this.underlay.style.width = this.innerElement.offsetWidth + "px";\r
                this.underlay.style.height = this.innerElement.offsetHeight + "px";\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) { \r
+YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Panel.superclass.onDomResize.call(this, e, obj);\r
        var me = this;\r
        setTimeout(function() {\r
@@ -2899,6 +3430,7 @@ YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) {
 \r
 /**\r
 * Registers the Panel's header for drag & drop capability.\r
+* @method registerDragDrop\r
 */\r
 YAHOO.widget.Panel.prototype.registerDragDrop = function() {\r
        if (this.header) {\r
@@ -2907,7 +3439,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                if (! this.header.id) {\r
                        this.header.id = this.id + "_h";\r
                }\r
-               \r
+\r
                var me = this;\r
 \r
                this.dd.startDrag = function() {\r
@@ -2931,7 +3463,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
                                var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
 \r
-                               this.minX = leftConstraint\r
+                               this.minX = leftConstraint;\r
                                this.maxX = rightConstraint;\r
                                this.constrainX = true;\r
 \r
@@ -2944,8 +3476,8 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("startDrag", arguments);\r
-               }\r
-               \r
+               };\r
+\r
                this.dd.onDrag = function() {\r
                        me.syncPosition();\r
                        me.cfg.refireEvent("iframe");\r
@@ -2954,7 +3486,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("onDrag", arguments);\r
-               }\r
+               };\r
 \r
                this.dd.endDrag = function() {\r
                        if (me.browser == "ie") {\r
@@ -2962,17 +3494,18 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("endDrag", arguments);\r
-               }\r
+               };\r
 \r
                this.dd.setHandleElId(this.header.id);\r
                this.dd.addInvalidHandleType("INPUT");\r
                this.dd.addInvalidHandleType("SELECT");\r
                this.dd.addInvalidHandleType("TEXTAREA");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Builds the mask that is laid over the document when the Panel is configured to be modal.\r
+* @method buildMask\r
 */\r
 YAHOO.widget.Panel.prototype.buildMask = function() {\r
        if (! this.mask) {\r
@@ -2983,16 +3516,20 @@ YAHOO.widget.Panel.prototype.buildMask = function() {
 \r
                var maskClick = function(e, obj) {\r
                        YAHOO.util.Event.stopEvent(e);\r
-               }\r
-\r
-               YAHOO.util.Event.addListener(this.mask, maskClick, this);\r
+               };\r
 \r
-               document.body.appendChild(this.mask);\r
+               var firstChild = document.body.firstChild;\r
+               if (firstChild) {\r
+                       document.body.insertBefore(this.mask, document.body.firstChild);\r
+               } else {\r
+                       document.body.appendChild(this.mask);\r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Hides the modality mask.\r
+* @method hideMask\r
 */\r
 YAHOO.widget.Panel.prototype.hideMask = function() {\r
        if (this.cfg.getProperty("modal") && this.mask) {\r
@@ -3000,10 +3537,11 @@ YAHOO.widget.Panel.prototype.hideMask = function() {
                this.hideMaskEvent.fire();\r
                YAHOO.util.Dom.removeClass(document.body, "masked");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Shows the modality mask.\r
+* @method showMask\r
 */\r
 YAHOO.widget.Panel.prototype.showMask = function() {\r
        if (this.cfg.getProperty("modal") && this.mask) {\r
@@ -3012,157 +3550,106 @@ YAHOO.widget.Panel.prototype.showMask = function() {
                this.mask.style.display = "block";\r
                this.showMaskEvent.fire();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the size of the modality mask to cover the entire scrollable area of the document\r
+* @method sizeMask\r
 */\r
 YAHOO.widget.Panel.prototype.sizeMask = function() {\r
        if (this.mask) {\r
                this.mask.style.height = YAHOO.util.Dom.getDocumentHeight()+"px";\r
                this.mask.style.width = YAHOO.util.Dom.getDocumentWidth()+"px";\r
        }\r
-}\r
-\r
-/**\r
-* The default event handler fired when the "height" property is changed.\r
-*/\r
-YAHOO.widget.Panel.prototype.configHeight = function(type, args, obj) {\r
-       var height = args[0];\r
-       var el = this.innerElement;\r
-       YAHOO.util.Dom.setStyle(el, "height", height);\r
-       this.cfg.refireEvent("underlay");\r
-       this.cfg.refireEvent("iframe");\r
-}\r
-\r
-/**\r
-* The default event handler fired when the "width" property is changed.\r
-*/\r
-YAHOO.widget.Panel.prototype.configWidth = function(type, args, obj) {\r
-       var width = args[0];\r
-       var el = this.innerElement;\r
-       YAHOO.util.Dom.setStyle(el, "width", width);\r
-       this.cfg.refireEvent("underlay");\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Renders the Panel by inserting the elements that are not already in the main Panel into their correct places. Optionally appends the Panel to the specified node prior to the render's execution. NOTE: For Panels 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.\r
-* @param {string}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-* @param {Element}     appendToNode    The element to which the Module should be appended to prior to rendering        \r
+* @method render\r
+* @param {String}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+* @param {HTMLElement} appendToNode    The element to which the Module should be appended to prior to rendering\r
 * @return {boolean} Success or failure of the render\r
 */\r
 YAHOO.widget.Panel.prototype.render = function(appendToNode) {\r
        return YAHOO.widget.Panel.superclass.render.call(this, appendToNode, this.innerElement);\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Panel.\r
+*/\r
 YAHOO.widget.Panel.prototype.toString = function() {\r
        return "Panel " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * 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.\r
-* @param {string}      el      The element ID representing the Dialog <em>OR</em>\r
-* @param {Element}     el      The element representing the Dialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Dialog\r
+* @extends YAHOO.widget.Panel\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Dialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Dialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Dialog = function(el, userConfig) {\r
        YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Dialog, YAHOO.widget.Panel);\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Dialog\r
-* @type string\r
+* @property YAHOO.widget.Dialog.CSS_DIALOG\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Dialog.CSS_DIALOG = "dialog";\r
 \r
-\r
-/**\r
-* CustomEvent fired prior to submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.beforeSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.submitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to manual submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.manualSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to asynchronous submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.asyncSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to form-based submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.formSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after cancel\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.cancelEvent = null;\r
-\r
-\r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);\r
 \r
        /**\r
        * The internally maintained callback object for use with the Connection utility\r
-       * @type object\r
-       * @private\r
+       * @property callback\r
+       * @type Object\r
        */\r
        this.callback = {\r
+               /**\r
+               * The function to execute upon success of the Connection submission\r
+               * @property callback.success\r
+               * @type Function\r
+               */\r
                success : null,\r
+               /**\r
+               * The function to execute upon failure of the Connection submission\r
+               * @property callback.failure\r
+               * @type Function\r
+               */\r
                failure : null,\r
-               argument: null,\r
-               scope : this\r
-       }\r
-\r
-       this.doSubmit = function() {\r
-               var method = this.cfg.getProperty("postmethod");\r
-               switch (method) {\r
-                       case "async":\r
-                               YAHOO.util.Connect.setForm(this.form.name);\r
-                               var cObj = YAHOO.util.Connect.asyncRequest('POST', this.form.action, this.callback);\r
-                               this.asyncSubmitEvent.fire();\r
-                               break;\r
-                       case "form":\r
-                               this.form.submit();\r
-                               this.formSubmitEvent.fire();\r
-                               break;\r
-                       case "none":\r
-                       case "manual":\r
-                               this.manualSubmitEvent.fire();\r
-                               break;\r
-               }\r
-       }\r
+               /**\r
+               * The arbitraty argument or arguments to pass to the Connection callback functions\r
+               * @property callback.argument\r
+               * @type Object\r
+               */\r
+               argument: null\r
+       };\r
 \r
        // Add form dialog config properties //\r
-       this.cfg.addProperty("postmethod", { value:"async", validator:function(val) { \r
+\r
+       /**\r
+       * The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual".\r
+       * @config postmethod\r
+       * @type String\r
+       * @default async\r
+       */\r
+       this.cfg.addProperty("postmethod", { value:"async", validator:function(val) {\r
                                                                                                        if (val != "form" && val != "async" && val != "none" && val != "manual") {\r
                                                                                                                return false;\r
                                                                                                        } else {\r
@@ -3170,34 +3657,69 @@ YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {
                                                                                                        }\r
                                                                                                } });\r
 \r
+       /**\r
+       * Object literal(s) defining the buttons for the Dialog's footer.\r
+       * @config buttons\r
+       * @type Object[]\r
+       * @default "none"\r
+       */\r
        this.cfg.addProperty("buttons",         { value:"none", handler:this.configButtons } );\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Dialog.prototype.initEvents = function() {\r
        YAHOO.widget.Dialog.superclass.initEvents.call(this);\r
-       \r
+\r
+       /**\r
+       * CustomEvent fired prior to submission\r
+       * @event beforeSumitEvent\r
+       */\r
        this.beforeSubmitEvent  = new YAHOO.util.CustomEvent("beforeSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired after submission\r
+       * @event submitEvent\r
+       */\r
        this.submitEvent                = new YAHOO.util.CustomEvent("submit");\r
 \r
+       /**\r
+       * CustomEvent fired prior to manual submission\r
+       * @event manualSubmitEvent\r
+       */\r
        this.manualSubmitEvent  = new YAHOO.util.CustomEvent("manualSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired prior to asynchronous submission\r
+       * @event asyncSubmitEvent\r
+       */\r
        this.asyncSubmitEvent   = new YAHOO.util.CustomEvent("asyncSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired prior to form-based submission\r
+       * @event formSubmitEvent\r
+       */\r
        this.formSubmitEvent    = new YAHOO.util.CustomEvent("formSubmit");\r
 \r
+       /**\r
+       * CustomEvent fired after cancel\r
+       * @event cancelEvent\r
+       */\r
        this.cancelEvent                = new YAHOO.util.CustomEvent("cancel");\r
-}\r
+};\r
 \r
 /**\r
 * The Dialog initialization method, which is executed for Dialog and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Dialog <em>OR</em>\r
-* @param {Element}     el      The element representing the Dialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Dialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Dialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.Dialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
+\r
        this.beforeInitEvent.fire(YAHOO.widget.Dialog);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Dialog.CSS_DIALOG);\r
@@ -3223,10 +3745,36 @@ YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {
        }, this, true);\r
 \r
        this.initEvent.fire(YAHOO.widget.Dialog);\r
-}\r
+};\r
+\r
+/**\r
+* Performs the submission of the Dialog form depending on the value of "postmethod" property.\r
+* @method doSubmit\r
+*/\r
+YAHOO.widget.Dialog.prototype.doSubmit = function() {\r
+       var pm = this.cfg.getProperty("postmethod");\r
+       switch (pm) {\r
+               case "async":\r
+                       var method = this.form.getAttribute("method") || 'POST';\r
+                       method = method.toUpperCase();\r
+                       YAHOO.util.Connect.setForm(this.form);\r
+                       var cObj = YAHOO.util.Connect.asyncRequest(method, this.form.getAttribute("action"), this.callback);\r
+                       this.asyncSubmitEvent.fire();\r
+                       break;\r
+               case "form":\r
+                       this.form.submit();\r
+                       this.formSubmitEvent.fire();\r
+                       break;\r
+               case "none":\r
+               case "manual":\r
+                       this.manualSubmitEvent.fire();\r
+                       break;\r
+       }\r
+};\r
 \r
 /**\r
 * Prepares the Dialog's internal FORM object, creating one if one is not currently present.\r
+* @method registerForm\r
 */\r
 YAHOO.widget.Dialog.prototype.registerForm = function() {\r
        var form = this.element.getElementsByTagName("FORM")[0];\r
@@ -3243,7 +3791,6 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        if (el.focus) {\r
                                if (el.type && el.type != "hidden") {\r
                                        return el;\r
-                                       break;\r
                                }\r
                        }\r
                }\r
@@ -3256,7 +3803,6 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        if (el.focus) {\r
                                if (el.type && el.type != "hidden") {\r
                                        return el;\r
-                                       break;\r
                                }\r
                        }\r
                }\r
@@ -3268,7 +3814,7 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
        if (this.cfg.getProperty("modal") && this.form) {\r
 \r
                var me = this;\r
-               \r
+\r
                var firstElement = this.firstFormElement || this.firstButton;\r
                if (firstElement) {\r
                        this.preventBackTab = new YAHOO.util.KeyListener(firstElement, { shift:true, keys:9 }, {fn:me.focusLast, scope:me, correctScope:true} );\r
@@ -3283,12 +3829,16 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        this.hideEvent.subscribe(this.preventTabOut.disable, this.preventTabOut, true);\r
                }\r
        }\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler for the "buttons" configuration property\r
+* @method configButtons\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {\r
        var buttons = args[0];\r
@@ -3301,6 +3851,7 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        var button = buttons[b];\r
 \r
                        var htmlButton = document.createElement("BUTTON");\r
+                       htmlButton.setAttribute("type", "button");\r
 \r
                        if (button.isDefault) {\r
                                htmlButton.className = "default";\r
@@ -3310,10 +3861,10 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        htmlButton.appendChild(document.createTextNode(button.text));\r
                        YAHOO.util.Event.addListener(htmlButton, "click", button.handler, this, true);\r
 \r
-                       this.buttonSpan.appendChild(htmlButton);                \r
+                       this.buttonSpan.appendChild(htmlButton);\r
                        button.htmlButton = htmlButton;\r
 \r
-                       if (b == 0) {\r
+                       if (b === 0) {\r
                                this.firstButton = button.htmlButton;\r
                        }\r
 \r
@@ -3334,30 +3885,17 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        }\r
 \r
                        this.buttonSpan = null;\r
-                       this.firstButtom = null;\r
+                       this.firstButton = null;\r
                        this.lastButton = null;\r
                        this.defaultHtmlButton = null;\r
                }\r
        }\r
-}\r
-\r
-/**\r
-* The default handler fired when the "success" property is changed. Used for asynchronous submission only.\r
-*/ \r
-YAHOO.widget.Dialog.prototype.configOnSuccess = function(type,args,obj){};\r
-\r
-/**\r
-* The default handler fired when the "failure" property is changed. Used for asynchronous submission only.\r
-*/ \r
-YAHOO.widget.Dialog.prototype.configOnFailure = function(type,args,obj){};\r
+};\r
 \r
-/**\r
-* Executes a submission of the form based on the value of the postmethod property.\r
-*/\r
-YAHOO.widget.Dialog.prototype.doSubmit = function() {};\r
 \r
 /**\r
 * The default event handler used to focus the first field of the form when the Dialog is shown.\r
+* @method focusFirst\r
 */\r
 YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {\r
        if (args) {\r
@@ -3372,10 +3910,11 @@ YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {
        } else {\r
                this.focusDefaultButton();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the last button in the button or form element in the Dialog\r
+* @method focusLast\r
 */\r
 YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {\r
        if (args) {\r
@@ -3393,19 +3932,21 @@ YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {
                        this.lastFormElement.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.\r
+* @method focusDefaultButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusDefaultButton = function() {\r
        if (this.defaultHtmlButton) {\r
                this.defaultHtmlButton.focus();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Blurs all the html buttons\r
+* @method blurButtons\r
 */\r
 YAHOO.widget.Dialog.prototype.blurButtons = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3415,10 +3956,11 @@ YAHOO.widget.Dialog.prototype.blurButtons = function() {
                        html.blur();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the first button in the button list\r
+* @method focusFirstButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusFirstButton = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3428,10 +3970,11 @@ YAHOO.widget.Dialog.prototype.focusFirstButton = function() {
                        html.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the first button in the button list\r
+* @method focusLastButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusLastButton = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3441,19 +3984,21 @@ YAHOO.widget.Dialog.prototype.focusLastButton = function() {
                        html.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Built-in function hook for writing a validation function that will be checked for a "true" value prior to a submit. This function, as implemented by default, always returns true, so it should be overridden if validation is necessary.\r
+* @method validate\r
 */\r
 YAHOO.widget.Dialog.prototype.validate = function() {\r
        return true;\r
-}\r
+};\r
 \r
 /**\r
 * Executes a submit of the Dialog followed by a hide, if validation is successful.\r
+* @method submit\r
 */\r
 YAHOO.widget.Dialog.prototype.submit = function() {\r
        if (this.validate()) {\r
@@ -3465,19 +4010,21 @@ YAHOO.widget.Dialog.prototype.submit = function() {
        } else {\r
                return false;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Executes the cancel of the Dialog followed by a hide.\r
+* @method cancel\r
 */\r
 YAHOO.widget.Dialog.prototype.cancel = function() {\r
        this.cancelEvent.fire();\r
-       this.hide();    \r
-}\r
+       this.hide();\r
+};\r
 \r
 /**\r
 * Returns a JSON-compatible data structure representing the data currently contained in the form.\r
-* @return {object} A JSON object reprsenting the data of the current form.\r
+* @method getData\r
+* @return {Object} A JSON object reprsenting the data of the current form.\r
 */\r
 YAHOO.widget.Dialog.prototype.getData = function() {\r
        var form = this.form;\r
@@ -3491,7 +4038,7 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                        switch (formItem.tagName) {\r
                                                case "INPUT":\r
                                                        switch (formItem.type) {\r
-                                                               case "checkbox": \r
+                                                               case "checkbox":\r
                                                                        data[i] = formItem.checked;\r
                                                                        break;\r
                                                                case "textbox":\r
@@ -3505,12 +4052,12 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                                        data[i] = formItem.value;\r
                                                        break;\r
                                                case "SELECT":\r
-                                                       var val = new Array();\r
+                                                       var val = [];\r
                                                        for (var x=0;x<formItem.options.length;x++)     {\r
                                                                var option = formItem.options[x];\r
                                                                if (option.selected) {\r
                                                                        var selval = option.value;\r
-                                                                       if (! selval || selval == "") {\r
+                                                                       if (! selval || selval === "") {\r
                                                                                selval = option.text;\r
                                                                        }\r
                                                                        val[val.length] = selval;\r
@@ -3520,126 +4067,157 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                                        break;\r
                                        }\r
                                } else if (formItem[0] && formItem[0].tagName) { // this is an array of form items\r
-                                       switch (formItem[0].tagName) {\r
-                                               case "INPUT" :\r
-                                                       switch (formItem[0].type) {\r
-                                                               case "radio":\r
-                                                                       for (var r=0; r<formItem.length; r++) {\r
-                                                                               var radio = formItem[r];\r
-                                                                               if (radio.checked) {\r
-                                                                                       data[radio.name] = radio.value;\r
-                                                                                       break;\r
-                                                                               }\r
+                                       if (formItem[0].tagName == "INPUT") {\r
+                                               switch (formItem[0].type) {\r
+                                                       case "radio":\r
+                                                               for (var r=0; r<formItem.length; r++) {\r
+                                                                       var radio = formItem[r];\r
+                                                                       if (radio.checked) {\r
+                                                                               data[radio.name] = radio.value;\r
+                                                                               break;\r
                                                                        }\r
-                                                                       break;\r
-                                                               case "checkbox":\r
-                                                                       var cbArray = new Array();\r
-                                                                       for (var c=0; c<formItem.length; c++) {\r
-                                                                               var check = formItem[c];\r
-                                                                               if (check.checked) {\r
-                                                                                       cbArray[cbArray.length] = check.value;\r
-                                                                               }\r
+                                                               }\r
+                                                               break;\r
+                                                       case "checkbox":\r
+                                                               var cbArray = [];\r
+                                                               for (var c=0; c<formItem.length; c++) {\r
+                                                                       var check = formItem[c];\r
+                                                                       if (check.checked) {\r
+                                                                               cbArray[cbArray.length] = check.value;\r
                                                                        }\r
-                                                                       data[formItem[0].name] = cbArray;\r
-                                                                       break;\r
-                                                       }\r
+                                                               }\r
+                                                               data[formItem[0].name] = cbArray;\r
+                                                               break;\r
+                                               }\r
                                        }\r
                                }\r
                        }\r
-               }       \r
+               }\r
        }\r
        return data;\r
-}\r
+};\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the Dialog\r
+*/\r
 YAHOO.widget.Dialog.prototype.toString = function() {\r
        return "Dialog " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * SimpleDialog is a simple implementation of Dialog that can be used to submit a single value. Forms can be processed in 3 ways -- via an asynchronous Connection utility call, a simple form POST or GET, or manually.\r
-* @param {string}      el      The element ID representing the SimpleDialog <em>OR</em>\r
-* @param {Element}     el      The element representing the SimpleDialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class SimpleDialog\r
+* @extends YAHOO.widget.Dialog\r
 * @constructor\r
+* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the SimpleDialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.SimpleDialog = function(el, userConfig) {\r
        YAHOO.widget.SimpleDialog.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.SimpleDialog, YAHOO.widget.Dialog);\r
 \r
 /**\r
 * Constant for the standard network icon for a blocking action\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_BLOCK\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_BLOCK = "nt/ic/ut/bsc/blck16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for alarm\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_ALARM\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_ALARM = "nt/ic/ut/bsc/alrt16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for help\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_HELP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_HELP  = "nt/ic/ut/bsc/hlp16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for info\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_INFO\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_INFO  = "nt/ic/ut/bsc/info16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for warn\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_WARN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_WARN  = "nt/ic/ut/bsc/warn16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for a tip\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_TIP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_TIP   = "nt/ic/ut/bsc/tip16_1.gif";\r
 \r
 /**\r
 * Constant representing the default CSS class used for a SimpleDialog\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG = "simple-dialog";\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the SimpleDialog's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);\r
 \r
        // Add dialog config properties //\r
+\r
+       /**\r
+       * Sets the informational icon for the SimpleDialog\r
+       * @config icon\r
+       * @type String\r
+       * @default "none"\r
+       */\r
        this.cfg.addProperty("icon",    { value:"none", handler:this.configIcon, suppressEvent:true } );\r
+\r
+       /**\r
+       * Sets the text for the SimpleDialog\r
+       * @config text\r
+       * @type String\r
+       * @default ""\r
+       */\r
        this.cfg.addProperty("text",    { value:"", handler:this.configText, suppressEvent:true, supercedes:["icon"] } );\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The SimpleDialog initialization method, which is executed for SimpleDialog and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the SimpleDialog <em>OR</em>\r
-* @param {Element}     el      The element representing the SimpleDialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the SimpleDialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.SimpleDialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
@@ -3662,19 +4240,24 @@ YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {
 \r
        this.initEvent.fire(YAHOO.widget.SimpleDialog);\r
 \r
-}\r
+};\r
 /**\r
 * Prepares the SimpleDialog's internal FORM object, creating one if one is not currently present, and adding the value hidden field.\r
+* @method registerForm\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.registerForm = function() {\r
        YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);\r
        this.form.innerHTML += "<input type=\"hidden\" name=\"" + this.id + "\" value=\"\"/>";\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Fired when the "icon" property is set.\r
+* @method configIcon\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.configIcon = function(type,args,obj) {\r
        var icon = args[0];\r
@@ -3682,10 +4265,14 @@ YAHOO.widget.SimpleDialog.prototype.configIcon = function(type,args,obj) {
                var iconHTML = "<img src=\"" + this.imageRoot + icon + "\" class=\"icon\" />";\r
                this.body.innerHTML = iconHTML + this.body.innerHTML;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Fired when the "text" property is set.\r
+* @method configText\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {\r
        var text = args[0];\r
@@ -3693,27 +4280,28 @@ YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {
                this.setBody(text);\r
                this.cfg.refireEvent("icon");\r
        }\r
-}\r
+};\r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the SimpleDialog\r
+*/\r
 YAHOO.widget.SimpleDialog.prototype.toString = function() {\r
        return "SimpleDialog " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.\r
-* @param {Overlay}     overlay         The Overlay that the animation should be associated with\r
-* @param {object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(float), and method(i.e. YAHOO.util.Easing.easeIn).\r
-* @param {object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(float), and method(i.e. YAHOO.util.Easing.easeIn).\r
-* @param {Element}     targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
+* @namespace YAHOO.widget\r
+* @class ContainerEffect\r
 * @constructor\r
+* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with\r
+* @param {Object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {Object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
+* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
 */\r
 YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {\r
        if (! animClass) {\r
@@ -3722,28 +4310,39 @@ YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement,
 \r
        /**\r
        * The overlay to animate\r
+       * @property overlay\r
+       * @type YAHOO.widget.Overlay\r
        */\r
        this.overlay = overlay;\r
        /**\r
        * The animation attributes to use when transitioning into view\r
+       * @property attrIn\r
+       * @type Object\r
        */\r
        this.attrIn = attrIn;\r
        /**\r
        * The animation attributes to use when transitioning out of view\r
+       * @property attrOut\r
+       * @type Object\r
        */\r
        this.attrOut = attrOut;\r
        /**\r
        * The target element to be animated\r
+       * @property targetElement\r
+       * @type HTMLElement\r
        */\r
        this.targetElement = targetElement || overlay.element;\r
        /**\r
        * The animation class to use for animating the overlay\r
+       * @property animClass\r
+       * @type class\r
        */\r
        this.animClass = animClass;\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the animation classes and events.\r
+* @method init\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.init = function() {\r
        this.beforeAnimateInEvent = new YAHOO.util.CustomEvent("beforeAnimateIn");\r
@@ -3761,74 +4360,103 @@ YAHOO.widget.ContainerEffect.prototype.init = function() {
        this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);\r
        this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);\r
        this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, this);\r
-}\r
+};\r
 \r
 /**\r
 * Triggers the in-animation.\r
+* @method animateIn\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.animateIn = function() {\r
        this.beforeAnimateInEvent.fire();\r
        this.animIn.animate();\r
-}\r
+};\r
 \r
 /**\r
 * Triggers the out-animation.\r
+* @method animateOut\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.animateOut = function() {\r
        this.beforeAnimateOutEvent.fire();\r
        this.animOut.animate();\r
-}\r
+};\r
 \r
 /**\r
 * The default onStart handler for the in-animation.\r
+* @method handleStartAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };\r
 /**\r
 * The default onTween handler for the in-animation.\r
+* @method handleTweenAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };\r
 /**\r
 * The default onComplete handler for the in-animation.\r
+* @method handleCompleteAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };\r
 \r
 /**\r
 * The default onStart handler for the out-animation.\r
+* @method handleStartAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };\r
 /**\r
 * The default onTween handler for the out-animation.\r
+* @method handleTweenAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };\r
 /**\r
 * The default onComplete handler for the out-animation.\r
+* @method handleCompleteAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the ContainerEffect\r
+*/\r
 YAHOO.widget.ContainerEffect.prototype.toString = function() {\r
        var output = "ContainerEffect";\r
        if (this.overlay) {\r
                output += " [" + this.overlay.toString() + "]";\r
        }\r
        return output;\r
-}\r
+};\r
 \r
 /**\r
 * A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
+* @method FADE\r
+* @static\r
 * @param {Overlay}     The Overlay object to animate\r
-* @param {float}       The duration of the animation\r
-* @type ContainerEffect\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
 */\r
 YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
        var fade = new YAHOO.widget.ContainerEffect(overlay, { attributes:{opacity: {from:0, to:1}}, duration:dur, method:YAHOO.util.Easing.easeIn }, { attributes:{opacity: {to:0}}, duration:dur, method:YAHOO.util.Easing.easeOut}, overlay.element );\r
 \r
        fade.handleStartAnimateIn = function(type,args,obj) {\r
                YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
-               \r
+\r
                if (! obj.overlay.underlay) {\r
                        obj.overlay.cfg.refireEvent("underlay");\r
                }\r
@@ -3838,24 +4466,24 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
                        obj.overlay.underlay.style.filter = null;\r
                }\r
 \r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible"); \r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
                YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 0);\r
-       }\r
+       };\r
 \r
        fade.handleCompleteAnimateIn = function(type,args,obj) {\r
                YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
 \r
                if (obj.overlay.element.style.filter) {\r
                        obj.overlay.element.style.filter = null;\r
-               }                       \r
-               \r
+               }\r
+\r
                if (obj.overlay.underlay) {\r
                        YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);\r
                }\r
 \r
                obj.overlay.cfg.refireEvent("iframe");\r
                obj.animateInCompleteEvent.fire();\r
-       }\r
+       };\r
 \r
        fade.handleStartAnimateOut = function(type, args, obj) {\r
                YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
@@ -3863,20 +4491,20 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
                if (obj.overlay.underlay) {\r
                        obj.overlay.underlay.style.filter = null;\r
                }\r
-       }\r
+       };\r
 \r
-       fade.handleCompleteAnimateOut =  function(type, args, obj) { \r
+       fade.handleCompleteAnimateOut =  function(type, args, obj) {\r
                YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
                if (obj.overlay.element.style.filter) {\r
                        obj.overlay.element.style.filter = null;\r
-               }                               \r
+               }\r
                YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1); \r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1);\r
 \r
                obj.overlay.cfg.refireEvent("iframe");\r
 \r
                obj.animateOutCompleteEvent.fire();\r
-       };      \r
+       };\r
 \r
        fade.init();\r
        return fade;\r
@@ -3885,9 +4513,11 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
 \r
 /**\r
 * A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
+* @method SLIDE\r
+* @static\r
 * @param {Overlay}     The Overlay object to animate\r
-* @param {float}       The duration of the animation\r
-* @type ContainerEffect\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
 */\r
 YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
        var x = overlay.cfg.getProperty("x") || YAHOO.util.Dom.getX(overlay.element);\r
@@ -3896,25 +4526,25 @@ YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {
        var clientWidth = YAHOO.util.Dom.getClientWidth();\r
        var offsetWidth = overlay.element.offsetWidth;\r
 \r
-       var slide = new YAHOO.widget.ContainerEffect(overlay, { \r
-                                                                                                                       attributes:{ points: { to:[x, y] } }, \r
-                                                                                                                       duration:dur, \r
-                                                                                                                       method:YAHOO.util.Easing.easeIn \r
-                                                                                                               }, \r
-                                                                                                               { \r
+       var slide = new YAHOO.widget.ContainerEffect(overlay, {\r
+                                                                                                                       attributes:{ points: { to:[x, y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeIn\r
+                                                                                                               },\r
+                                                                                                               {\r
                                                                                                                        attributes:{ points: { to:[(clientWidth+25), y] } },\r
-                                                                                                                       duration:dur, \r
+                                                                                                                       duration:dur,\r
                                                                                                                        method:YAHOO.util.Easing.easeOut\r
                                                                                                                },\r
                                                                                                                overlay.element,\r
-                                                                                                               YAHOO.util.Motion\r
-                                                                                               );\r
+                                                                                                               YAHOO.util.Motion);\r
+\r
 \r
        slide.handleStartAnimateIn = function(type,args,obj) {\r
                obj.overlay.element.style.left = (-25-offsetWidth) + "px";\r
                obj.overlay.element.style.top  = y + "px";\r
-       }\r
-       \r
+       };\r
+\r
        slide.handleTweenAnimateIn = function(type, args, obj) {\r
 \r
 \r
@@ -3929,46 +4559,44 @@ YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {
 \r
                obj.overlay.cfg.setProperty("xy", [currentX,currentY], true);\r
                obj.overlay.cfg.refireEvent("iframe");\r
-       }\r
-       \r
+       };\r
+\r
        slide.handleCompleteAnimateIn = function(type, args, obj) {\r
                obj.overlay.cfg.setProperty("xy", [x,y], true);\r
                obj.startX = x;\r
                obj.startY = y;\r
                obj.overlay.cfg.refireEvent("iframe");\r
                obj.animateInCompleteEvent.fire();\r
-       }\r
+       };\r
 \r
        slide.handleStartAnimateOut = function(type, args, obj) {\r
-               var clientWidth = YAHOO.util.Dom.getViewportWidth();\r
-               \r
+               var vw = YAHOO.util.Dom.getViewportWidth();\r
+\r
                var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
 \r
-               var x = pos[0];\r
-               var y = pos[1];\r
+               var yso = pos[1];\r
 \r
                var currentTo = obj.animOut.attributes.points.to;\r
-               obj.animOut.attributes.points.to = [(clientWidth+25), y];\r
-       }\r
+               obj.animOut.attributes.points.to = [(vw+25), yso];\r
+       };\r
 \r
        slide.handleTweenAnimateOut = function(type, args, obj) {\r
                var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
 \r
-               var x = pos[0];\r
-               var y = pos[1];\r
+               var xto = pos[0];\r
+               var yto = pos[1];\r
 \r
-               obj.overlay.cfg.setProperty("xy", [x,y], true);\r
+               obj.overlay.cfg.setProperty("xy", [xto,yto], true);\r
                obj.overlay.cfg.refireEvent("iframe");\r
-       }\r
+       };\r
 \r
-       slide.handleCompleteAnimateOut = function(type, args, obj) { \r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");           \r
-               var offsetWidth = obj.overlay.element.offsetWidth;\r
+       slide.handleCompleteAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
 \r
                obj.overlay.cfg.setProperty("xy", [x,y]);\r
                obj.animateOutCompleteEvent.fire();\r
-       };      \r
+       };\r
 \r
        slide.init();\r
        return slide;\r
-}
\ No newline at end of file
+};
\ No newline at end of file
index 8ded0175640d50746a6d9f849ab630bf2ca4c2bb..1e5ed5d9206cef77712abf59c201397f05d67bc2 100755 (executable)
@@ -1,49 +1,25 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}\r
-YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}\r
-YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}\r
-this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}\r
-this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}\r
-this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]\r
-if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
-return cfg;}\r
-this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}\r
-this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}\r
-this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}\r
-return true;}}else{return false;}}}\r
-this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}\r
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
+return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
+return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}\r
+return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}\r
 var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}\r
 if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}\r
 if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}\r
-return true;}else{return false;}}\r
-this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}\r
-this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}\r
-for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}\r
-this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}\r
-this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}\r
-this.queueInProgress=false;eventQueue=new Array();}\r
-this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}\r
-return true;}else{return false;}}\r
-this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}\r
-this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
-return output;}\r
-this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
-return output;}}\r
-YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}\r
-return false;}\r
-YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}\r
-YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},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("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
+return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}\r
+for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}\r
+this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}\r
+return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
+return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
+return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}\r
+return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},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("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
 if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}\r
 this.element=el;if(el.id){this.id=el.id;}\r
 var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}\r
 this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}\r
-this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}\r
+this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}\r
 resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}\r
 if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},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){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
 if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}\r
@@ -57,236 +33,115 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
 this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}\r
 this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}\r
 var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}\r
-if(element){element.appendChild(me.element);me.appendEvent.fire();}}\r
-if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}\r
+if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}\r
 if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}\r
 if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}\r
 if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}\r
 this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}\r
 if(parent){parent.removeChild(this.element);}\r
-this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},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();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}\r
-YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}\r
-YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},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();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"\r
+YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
 if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}\r
-this.initEvent.fire(YAHOO.widget.Overlay);}\r
-YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}\r
-YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}\r
-YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}\r
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}\r
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}\r
-YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}\r
+this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}\r
+e=e.parentNode;}\r
+if(currentVis=="inherit"){currentVis="visible";}}\r
+var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}\r
 var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}\r
-if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}\r
-e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}\r
-if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}\r
-e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}\r
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}\r
-YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}\r
+if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}\r
+ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}\r
+if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}\r
+h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}\r
-YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}\r
+if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}\r
 if(this.iframe){if(zIndex<=0){zIndex=1;}\r
 YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}\r
-YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}\r
-YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var 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]);}\r
-YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var 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");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}\r
-YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var 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");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}\r
-YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}\r
-var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}\r
-if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}\r
+YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var 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]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var 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");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var 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");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}\r
+if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}\r
 var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}\r
 if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}\r
-var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
-YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}\r
+var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
+YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}\r
 var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}\r
-YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}\r
-this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}\r
-YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}\r
-YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}\r
-if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}\r
-YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}\r
+YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}\r
+this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}\r
+if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}\r
 if(!contextAlign){contextAlign=contextArgs[2];}\r
-if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}\r
-switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}\r
-YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}\r
-var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}\r
+if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}\r
 if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}\r
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}\r
-YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}\r
-YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
-this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}\r
-YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}\r
-YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}\r
-YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}\r
-YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}\r
-YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}\r
-this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}\r
-this.overlays.sort(this.compareZIndexDesc);}}\r
-this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.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.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null\r
-o.blurEvent=null;o.focus=null;o.blur=null;}}\r
-this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}\r
-var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}\r
-if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}\r
-overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}\r
-var focusOnDomEvent=function(e,obj){overlay.focus();}\r
-var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}\r
+this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
+this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
+clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}\r
+clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}\r
+YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}\r
+this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.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.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}\r
+if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}\r
 this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}\r
-if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}\r
-return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}\r
-YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}\r
+if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}\r
+return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}\r
 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);}\r
 if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}\r
-function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;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){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}\r
+function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}\r
+if(!keyData.alt){keyData.alt=false;}\r
+if(!keyData.ctrl){keyData.ctrl=false;}\r
+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);}}}}\r
 this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}\r
-this.enabled=true;}\r
-this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}\r
-this.enabled=false;}\r
-this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}\r
-YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);}\r
-YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}}\r
-YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}\r
-YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}}\r
-YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}}\r
-YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];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);}\r
+this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}\r
+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.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);};YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}};YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});};YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}};YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}};YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];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);}\r
 context=this.cfg.getProperty("context");}\r
 if(this._context){for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.removeListener(el,"mouseover",this.onContextMouseOver);YAHOO.util.Event.removeListener(el,"mousemove",this.onContextMouseMove);YAHOO.util.Event.removeListener(el,"mouseout",this.onContextMouseOut);}}\r
-this._context=context;for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.addListener(el,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el,"mouseout",this.onContextMouseOut,this);}}}\r
-YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);}\r
-YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}\r
+this._context=context;for(var d=0;d<this._context.length;++d){var el2=this._context[d];YAHOO.util.Event.addListener(el2,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el2,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el2,"mouseout",this.onContextMouseOut,this);}}};YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);};YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}\r
 var context=this;YAHOO.util.Event.addListener(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}\r
-obj.showProcId=obj.doShow(e,context);}\r
-YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}\r
+obj.showProcId=obj.doShow(e,context);};YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}\r
 if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}\r
 if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}\r
-obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));}\r
-YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}\r
+obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));};YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}\r
 var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}\r
 me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}\r
-YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));}\r
-YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));}\r
-YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.logger.log("OVERLAP","warn");this.cfg.setProperty("y",(pageY-height-5))}}\r
-YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;}\r
-YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.showMaskEvent=null;YAHOO.widget.Panel.prototype.hideMaskEvent=null;YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&nbsp;");}}},this,true);this.initEvent.fire(YAHOO.widget.Panel);}\r
-YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");}\r
-YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});}\r
-YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();}\r
-if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}\r
-this.close.innerHTML="&nbsp;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}}\r
-YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}\r
-if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}}\r
-YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML="&nbsp;";this.element.appendChild(this.underlay);}\r
-this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;case"none":default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}}\r
-YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMask,this)){this.showEvent.subscribe(this.showMask,this,true);}\r
+YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));};YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));};YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}};YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;};YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&nbsp;");}}},this,true);var me=this;this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if(el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="FORM"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",el.blur);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",el2.blur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");};YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}\r
+this.close.innerHTML="&nbsp;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}\r
+if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML="&nbsp;";this.element.appendChild(this.underlay);}\r
+this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}};YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.showMask,this)){this.beforeShowEvent.subscribe(this.showMask,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.sizeMask,this,true);}}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.sizeMask);}}\r
-YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}\r
+if(!YAHOO.util.Config.alreadySubscribed(this.destroyEvent,this.removeMask,this)){this.destroyEvent.subscribe(this.removeMask,this,true);}\r
+this.cfg.refireEvent("zIndex");}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.destroyEvent.unsubscribe(this.removeMask,this);}};YAHOO.widget.Panel.prototype.removeMask=function(){if(this.mask){if(this.mask.parentNode){this.mask.parentNode.removeChild(this.mask);}\r
+this.mask=null;}};YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}}\r
-YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var elementClone=this.element.cloneNode(true);this.innerElement=elementClone;this.innerElement.style.visibility="inherit";YAHOO.util.Dom.addClass(this.innerElement,YAHOO.widget.Panel.CSS_PANEL);var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=elementClone.id+"_c";wrapper.appendChild(elementClone);if(elementParent){elementParent.replaceChild(wrapper,this.element);}\r
-this.element=wrapper;var childNodes=this.innerElement.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}\r
-this.initDefaultConfig();}\r
-YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}}\r
-YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}\r
+if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}};YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configzIndex=function(type,args,obj){YAHOO.widget.Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0;var currentZ=YAHOO.util.Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}\r
+if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;YAHOO.util.Dom.setStyle(this.mask,"zIndex",maskZ);}}};YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var originalElement=this.element;var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}\r
+wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;YAHOO.util.Dom.setStyle(this.innerElement,"visibility","inherit");};YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}};YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}\r
 var me=this;this.dd.startDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.addClass(me.element,"drag");}\r
-if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint\r
-this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}\r
-me.dragEvent.fire("startDrag",arguments);}\r
-this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}\r
-me.dragEvent.fire("onDrag",arguments);}\r
-this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}\r
-me.dragEvent.fire("endDrag",arguments);}\r
-this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}}\r
-YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML="&nbsp;";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);}\r
-YAHOO.util.Event.addListener(this.mask,maskClick,this);document.body.appendChild(this.mask);}}\r
-YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}}\r
-YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}}\r
-YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}}\r
-YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);}\r
-YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;}\r
-YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.beforeSubmitEvent=null;YAHOO.widget.Dialog.prototype.submitEvent=null;YAHOO.widget.Dialog.prototype.manualSubmitEvent=null;YAHOO.widget.Dialog.prototype.asyncSubmitEvent=null;YAHOO.widget.Dialog.prototype.formSubmitEvent=null;YAHOO.widget.Dialog.prototype.cancelEvent=null;YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null,scope:this}\r
-this.doSubmit=function(){var method=this.cfg.getProperty("postmethod");switch(method){case"async":YAHOO.util.Connect.setForm(this.form.name);var cObj=YAHOO.util.Connect.asyncRequest('POST',this.form.action,this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}}\r
-this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});}\r
-YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");}\r
-YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);}\r
-YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}\r
-this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}\r
-return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}\r
+if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var 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;}\r
+me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}\r
+me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}\r
+me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML="&nbsp;";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}};YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});};YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");};YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}\r
+this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}\r
+return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}\r
 return null;}();this.form=form;if(this.cfg.getProperty("modal")&&this.form){var me=this;var firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new YAHOO.util.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);}\r
-var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.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);}}}\r
-YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}\r
-htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b==0){this.firstButton=button.htmlButton;}\r
+var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.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);}}};YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");htmlButton.setAttribute("type","button");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}\r
+htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b===0){this.firstButton=button.htmlButton;}\r
 if(b==(buttons.length-1)){this.lastButton=button.htmlButton;}}\r
 this.setFooter(this.buttonSpan);this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");}else{if(this.buttonSpan){if(this.buttonSpan.parentNode){this.buttonSpan.parentNode.removeChild(this.buttonSpan);}\r
-this.buttonSpan=null;this.firstButtom=null;this.lastButton=null;this.defaultHtmlButton=null;}}}\r
-YAHOO.widget.Dialog.prototype.configOnSuccess=function(type,args,obj){};YAHOO.widget.Dialog.prototype.configOnFailure=function(type,args,obj){};YAHOO.widget.Dialog.prototype.doSubmit=function(){};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
-if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}}\r
-YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
-var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}}\r
-YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}}\r
-YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}}\r
-YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}}\r
-YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}}\r
-YAHOO.widget.Dialog.prototype.validate=function(){return true;}\r
-YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}}\r
-YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();}\r
-YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}\r
-break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=new Array();for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval==""){selval=option.text;}\r
+this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
+if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}};YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
+var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}};YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}\r
+break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=[];for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval===""){selval=option.text;}\r
 val[val.length]=selval;}}\r
-data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){switch(formItem[0].tagName){case"INPUT":switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}\r
-break;case"checkbox":var cbArray=new Array();for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}\r
+data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){if(formItem[0].tagName=="INPUT"){switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}\r
+break;case"checkbox":var cbArray=[];for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}\r
 data[formItem[0].name]=cbArray;break;}}}}}}\r
-return data;}\r
-YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;}\r
-YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});}\r
-YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);}\r
-YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";}\r
-YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}}\r
-YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}}\r
-YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;}\r
-YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}\r
-this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;}\r
-YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");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);}\r
-YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();}\r
-YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();}\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){}\r
-YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}\r
-return output;}\r
-YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}\r
+return data;};YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;};YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});};YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);};YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";};YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}};YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}};YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;};YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}\r
+this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");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);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}\r
+return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}\r
 if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}\r
-YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);}\r
-fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
+YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
 if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}\r
-obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();}\r
-fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}}\r
-fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
-YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.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";}\r
-slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}\r
-obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");}\r
-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();}\r
-slide.handleStartAnimateOut=function(type,args,obj){var clientWidth=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(clientWidth+25),y];}\r
-slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];obj.overlay.cfg.setProperty("xy",[x,y],true);obj.overlay.cfg.refireEvent("iframe");}\r
-slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");var offsetWidth=obj.overlay.element.offsetWidth;obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;}\r
+obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
+YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.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=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}\r
+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=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};
\ No newline at end of file
index 2cabc5e9a03220d1c91232287a2219e57f3bc7ec..ec0f864462a322d4666e9daae1739117af1b0080 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version 0.12.0\r
 */\r
 \r
 /**\r
-* @class \r
-* Config is a utility used within an object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
 * @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config = function(owner) {\r
        if (owner) {\r
                this.init(owner);\r
        }\r
-}\r
+};\r
 \r
 YAHOO.util.Config.prototype = {\r
-       \r
-       /**\r
-       * Object reference to the owner of this Config object\r
-       * @type object\r
-       */\r
-       owner : null,\r
 \r
        /**\r
-       * Object reference to the owner of this Config object\r
-       * args: key, value\r
-       * @type YAHOO.util.CustomEvent\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
        */\r
-       configChangedEvent : null,\r
+       owner : null,\r
 \r
        /**\r
        * Boolean flag that specifies whether a queue is currently being executed\r
-       * @type boolean\r
+       * @property queueInProgress\r
+       * @type Boolean\r
        */\r
        queueInProgress : false,\r
 \r
-       /**\r
-       * Adds a property to the Config object's private config hash. \r
-       * @param {string}       key     The configuration property's name\r
-       * @param {object}       propertyObject  The object containing all of this property's arguments\r
-       */\r
-       addProperty : function(key, propertyObject){},\r
-\r
-       /**\r
-       * Returns a key-value configuration map of the values currently set in the Config object.\r
-       * @return {object} The current config, represented in a key-value map\r
-       */\r
-       getConfig : function(){},\r
-\r
-       /**\r
-       * Returns the value of specified property.\r
-       * @param {key}          The name of the property\r
-       * @return {object}      The value of the specified property\r
-       */\r
-       getProperty : function(key){},\r
-\r
-       /**\r
-       * Resets the specified property's value to its initial value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       resetProperty : function(key){},\r
-\r
-       /**\r
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @param {boolean}      Whether the value should be set silently, without firing the property event.\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */\r
-       setProperty : function(key,value,silent){},\r
-\r
-       /**\r
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
-       * moved from its current position to the end of the queue.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */      \r
-       queueProperty : function(key,value){},\r
-\r
-       /**\r
-       * Fires the event for a property using the property's current value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       refireEvent : function(key){},\r
-\r
-       /**\r
-       * Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.\r
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
-       * @param {object}       userConfig      The configuration object literal\r
-       * @param {boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
-       */\r
-       applyConfig : function(userConfig,init){},\r
-\r
-       /**\r
-       * Refires the events for all configuration properties using their current values.\r
-       */\r
-       refresh : function(){},\r
-\r
-       /**\r
-       * Fires the normalized list of queued property change events\r
-       */\r
-       fireQueue : function(){},\r
-\r
-       /**\r
-       * Subscribes an external handler to the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
-       * @param {boolean}      override        Optional. If true, will override "this" within the handler to map to the scope object passed into the method.\r
-       */      \r
-       subscribeToConfigEvent : function(key,handler,obj,override){},\r
 \r
        /**\r
-       * Unsubscribes an external handler from the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
-       unsubscribeFromConfigEvent: function(key,handler,obj){},\r
-\r
-       /**\r
-       * Validates that the value passed in is a boolean.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
-       */      \r
        checkBoolean: function(val) {\r
                if (typeof val == 'boolean') {\r
                        return true;\r
@@ -138,8 +50,9 @@ YAHOO.util.Config.prototype = {
 \r
        /**\r
        * Validates that the value passed in is a number.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
        checkNumber: function(val) {\r
                if (isNaN(val)) {\r
@@ -148,31 +61,60 @@ YAHOO.util.Config.prototype = {
                        return true;\r
                }\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
-* Initializes the configuration object and all of its local members.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config.prototype.init = function(owner) {\r
 \r
        this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
        this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
+\r
        this.queueInProgress = false;\r
 \r
        /* Private Members */\r
 \r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
        var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
        var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
        var eventQueue = [];\r
 \r
        /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
        * @private\r
-       * Fires a configuration property event using the specified value. \r
-       * @param {string}       key                     The configuration property's name\r
-       * @param {value}        object          The value of the correct type for the property\r
-       */ \r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
        var fireEvent = function( key, value ) {\r
                key = key.toLowerCase();\r
 \r
@@ -180,10 +122,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
 \r
                if (typeof property != 'undefined' && property.event) {\r
                        property.event.fire(value);\r
-               }       \r
-       }\r
+               }\r
+       };\r
        /* End Private Members */\r
 \r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
        this.addProperty = function( key, propertyObject ) {\r
                key = key.toLowerCase();\r
 \r
@@ -197,25 +145,36 @@ YAHOO.util.Config.prototype.init = function(owner) {
                }\r
 \r
                this.setProperty(key, propertyObject.value, true);\r
-               \r
+\r
                if (! propertyObject.suppressEvent) {\r
                        this.queueProperty(key, propertyObject.value);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
        this.getConfig = function() {\r
                var cfg = {};\r
-                       \r
+\r
                for (var prop in config) {\r
-                       var property = config[prop]\r
+                       var property = config[prop];\r
                        if (typeof property != 'undefined' && property.event) {\r
                                cfg[prop] = property.value;\r
                        }\r
                }\r
-               \r
+\r
                return cfg;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
        this.getProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -225,24 +184,41 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return undefined;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
        this.resetProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
                if (typeof property != 'undefined' && property.event) {\r
-                       this.setProperty(key, initialConfig[key].value);\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
                } else {\r
-                       return undefined;\r
+                       return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
        this.setProperty = function(key, value, silent) {\r
                key = key.toLowerCase();\r
 \r
                if (this.queueInProgress && ! silent) {\r
-                       this.queueProperty(key,value); // Currently running through a queue... \r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
                        return true;\r
                } else {\r
                        var property = config[key];\r
@@ -261,13 +237,21 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                return false;\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
        this.queueProperty = function(key, value) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
-                                                       \r
+\r
                if (typeof property != 'undefined' && property.event) {\r
                        if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
                                return false;\r
@@ -287,7 +271,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        if (queueItem) {\r
                                                var queueItemKey = queueItem[0];\r
                                                var queueItemValue = queueItem[1];\r
-                                               \r
+\r
                                                if (queueItemKey.toLowerCase() == key) {\r
                                                        // found a dupe... push to end of queue, null current item, and break\r
                                                        eventQueue[i] = null;\r
@@ -297,7 +281,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                }\r
                                        }\r
                                }\r
-                               \r
+\r
                                if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
                                        eventQueue.push([key, value]);\r
                                }\r
@@ -313,7 +297,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                if (queueItemCheck) {\r
                                                        var queueItemCheckKey = queueItemCheck[0];\r
                                                        var queueItemCheckValue = queueItemCheck[1];\r
-                                                       \r
+\r
                                                        if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
                                                                eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
                                                                eventQueue[q] = null;\r
@@ -328,8 +312,13 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
        this.refireEvent = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -341,8 +330,15 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                fireEvent(key, property.value);\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
        this.applyConfig = function(userConfig, init) {\r
                if (init) {\r
                        initialConfig = userConfig;\r
@@ -350,14 +346,22 @@ YAHOO.util.Config.prototype.init = function(owner) {
                for (var prop in userConfig) {\r
                        this.queueProperty(prop, userConfig[prop]);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
        this.refresh = function() {\r
                for (var prop in config) {\r
                        this.refireEvent(prop);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
        this.fireQueue = function() {\r
                this.queueInProgress = true;\r
                for (var i=0;i<eventQueue.length;i++) {\r
@@ -365,18 +369,27 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        if (queueItem) {\r
                                var key = queueItem[0];\r
                                var value = queueItem[1];\r
-                               \r
+\r
                                var property = config[key];\r
                                property.value = value;\r
 \r
                                fireEvent(key,value);\r
                        }\r
                }\r
-               \r
+\r
                this.queueInProgress = false;\r
-               eventQueue = new Array();\r
-       }\r
+               eventQueue = [];\r
+       };\r
 \r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
        this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
                key = key.toLowerCase();\r
 \r
@@ -389,9 +402,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
-\r
+       };\r
 \r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
        this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
                key = key.toLowerCase();\r
 \r
@@ -401,16 +421,26 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
        this.toString = function() {\r
                var output = "Config";\r
                if (this.owner) {\r
                        output += " [" + this.owner.toString() + "]";\r
                }\r
                return output;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
        this.outputEventQueue = function() {\r
                var output = "";\r
                for (var q=0;q<eventQueue.length;q++) {\r
@@ -420,266 +450,262 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        }\r
                }\r
                return output;\r
-       }\r
-}\r
+       };\r
+};\r
 \r
 /**\r
-* Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
 * @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
 * @param {Function}    fn      The function to look for in the subscribers list\r
-* @param {object}      obj     The execution scope object for the subscription\r
-* @return {boolean}    true, if the function/object pair is already subscribed to the CustomEvent passed in\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
 YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
        for (var e=0;e<evt.subscribers.length;e++) {\r
                var subsc = evt.subscribers[e];\r
                if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
                        return true;\r
-                       break;\r
                }\r
        }\r
        return false;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class \r
+};\r
+\r
+/**\r
+*  The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
+* @module Container\r
+* @requires yahoo,dom,event,dragdrop,animation\r
+*/\r
+\r
+/**\r
 * Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @param {string}      el      The element ID representing the Module <em>OR</em>\r
-* @param {Element}     el      The element representing the Module\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+* @class Module\r
+* @namespace YAHOO.widget\r
 * @constructor\r
+* @param {String} el                   The element ID representing the Module <em>OR</em>\r
+* @param {HTMLElement} el              The element representing the Module\r
+* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Module = function(el, userConfig) {\r
-       if (el) { \r
-               this.init(el, userConfig); \r
+       if (el) {\r
+               this.init(el, userConfig);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the prefix path to use for non-secure images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";\r
 \r
 /**\r
 * Constant representing the prefix path to use for securely served images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT_SSL\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";\r
 \r
 /**\r
 * Constant for the default CSS class name that represents a Module\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_MODULE\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_MODULE = "module";\r
 \r
 /**\r
 * Constant representing the module header\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_HEADER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_HEADER = "hd";\r
 \r
 /**\r
 * Constant representing the module body\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_BODY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_BODY = "bd";\r
 \r
 /**\r
 * Constant representing the module footer\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_FOOTER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_FOOTER = "ft";\r
 \r
 /**\r
 * Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size\r
-* @type string\r
+* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = null;\r
+YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
 \r
 YAHOO.widget.Module.prototype = {\r
-\r
        /**\r
        * The class's constructor function\r
-       * @type function\r
+       * @property contructor\r
+       * @type Function\r
        */\r
        constructor : YAHOO.widget.Module,\r
 \r
        /**\r
        * The main module element that contains the header, body, and footer\r
-       * @type Element\r
+       * @property element\r
+       * @type HTMLElement\r
        */\r
-       element : null, \r
+       element : null,\r
 \r
        /**\r
        * The header element, denoted with CSS class "hd"\r
-       * @type Element\r
+       * @property header\r
+       * @type HTMLElement\r
        */\r
        header : null,\r
 \r
        /**\r
        * The body element, denoted with CSS class "bd"\r
-       * @type Element\r
+       * @property body\r
+       * @type HTMLElement\r
        */\r
        body : null,\r
 \r
        /**\r
        * The footer element, denoted with CSS class "ft"\r
-       * @type Element\r
+       * @property footer\r
+       * @type HTMLElement\r
        */\r
        footer : null,\r
 \r
        /**\r
        * The id of the element\r
-       * @type string\r
+       * @property id\r
+       * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
-       * Array of elements\r
-       * @type Element[]\r
-       */\r
-       childNodesInDOM : null,\r
-\r
-       /**\r
-       * The string representing the image root\r
-       * @type string\r
+       * The String representing the image root\r
+       * @property imageRoot\r
+       * @type String\r
        */\r
        imageRoot : YAHOO.widget.Module.IMG_ROOT,\r
 \r
-       /**\r
-       * CustomEvent fired prior to class initalization.\r
-       * args: class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeInitEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after class initalization.\r
-       * args: class reference of the initializing class, such as this.initEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       initEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is appended to the DOM\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       appendEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeRenderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       renderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the header content of the Module is modified\r
-       * args: string/element representing the new header content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeHeaderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the body content of the Module is modified\r
-       * args: string/element representing the new body content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeBodyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the footer content of the Module is modified\r
-       * args: string/element representing the new footer content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeFooterEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the content of the Module is modified\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeContentEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is destroyed\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       destroyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeShowEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       showEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeHideEvent : null,\r
-       \r
-       /**\r
-       * CustomEvent fired after the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       hideEvent : null,\r
-               \r
        /**\r
        * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
+       * @method initEvents\r
        */\r
        initEvents : function() {\r
 \r
-               this.beforeInitEvent            = new YAHOO.util.CustomEvent("beforeInit");\r
-               this.initEvent                          = new YAHOO.util.CustomEvent("init");\r
-\r
-               this.appendEvent                        = new YAHOO.util.CustomEvent("append");\r
-\r
-               this.beforeRenderEvent          = new YAHOO.util.CustomEvent("beforeRender");\r
-               this.renderEvent                        = new YAHOO.util.CustomEvent("render");\r
-\r
-               this.changeHeaderEvent          = new YAHOO.util.CustomEvent("changeHeader");\r
-               this.changeBodyEvent            = new YAHOO.util.CustomEvent("changeBody");\r
-               this.changeFooterEvent          = new YAHOO.util.CustomEvent("changeFooter");\r
-\r
-               this.changeContentEvent         = new YAHOO.util.CustomEvent("changeContent");\r
-\r
-               this.destroyEvent                       = new YAHOO.util.CustomEvent("destroy");\r
-               this.beforeShowEvent            = new YAHOO.util.CustomEvent("beforeShow");\r
-               this.showEvent                          = new YAHOO.util.CustomEvent("show");\r
-               this.beforeHideEvent            = new YAHOO.util.CustomEvent("beforeHide");\r
-               this.hideEvent                          = new YAHOO.util.CustomEvent("hide");\r
-       }, \r
+               /**\r
+               * CustomEvent fired prior to class initalization.\r
+               * @event beforeInitEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");\r
+\r
+               /**\r
+               * CustomEvent fired after class initalization.\r
+               * @event initEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.initEvent = new YAHOO.util.CustomEvent("init");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is appended to the DOM\r
+               * @event appendEvent\r
+               */\r
+               this.appendEvent = new YAHOO.util.CustomEvent("append");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is rendered\r
+               * @event beforeRenderEvent\r
+               */\r
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is rendered\r
+               * @event renderEvent\r
+               */\r
+               this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+\r
+               /**\r
+               * CustomEvent fired when the header content of the Module is modified\r
+               * @event changeHeaderEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new header content\r
+               */\r
+               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");\r
+\r
+               /**\r
+               * CustomEvent fired when the body content of the Module is modified\r
+               * @event changeBodyEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new body content\r
+               */\r
+               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");\r
+\r
+               /**\r
+               * CustomEvent fired when the footer content of the Module is modified\r
+               * @event changeFooterEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new footer content\r
+               */\r
+               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");\r
+\r
+               /**\r
+               * CustomEvent fired when the content of the Module is modified\r
+               * @event changeContentEvent\r
+               */\r
+               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is destroyed\r
+               * @event destroyEvent\r
+               */\r
+               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is shown\r
+               * @event beforeShowEvent\r
+               */\r
+               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is shown\r
+               * @event showEvent\r
+               */\r
+               this.showEvent = new YAHOO.util.CustomEvent("show");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is hidden\r
+               * @event beforeHideEvent\r
+               */\r
+               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is hidden\r
+               * @event hideEvent\r
+               */\r
+               this.hideEvent = new YAHOO.util.CustomEvent("hide");\r
+       },\r
 \r
        /**\r
        * String representing the current user-agent platform\r
-       * @type string\r
+       * @property platform\r
+       * @type String\r
        */\r
        platform : function() {\r
                                        var ua = navigator.userAgent.toLowerCase();\r
@@ -694,7 +720,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * String representing the current user-agent browser\r
-       * @type string\r
+       * @property browser\r
+       * @type String\r
        */\r
        browser : function() {\r
                        var ua = navigator.userAgent.toLowerCase();\r
@@ -715,10 +742,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Boolean representing whether or not the current browsing context is secure (https)\r
-       * @type boolean\r
+       * @property isSecure\r
+       * @type Boolean\r
        */\r
        isSecure : function() {\r
-               if (window.location.href.toLowerCase().indexOf("https") == 0) {\r
+               if (window.location.href.toLowerCase().indexOf("https") === 0) {\r
                        return true;\r
                } else {\r
                        return false;\r
@@ -731,16 +759,37 @@ YAHOO.widget.Module.prototype = {
        initDefaultConfig : function() {\r
                // Add properties //\r
 \r
+               /**\r
+               * Specifies whether the Module is visible on the page.\r
+               * @config visible\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );\r
+\r
+               /**\r
+               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.\r
+               * @config effect\r
+               * @type Object\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );\r
+\r
+               /**\r
+               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document\r
+               * @config monitorresize\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );\r
        },\r
 \r
        /**\r
        * The Module class's initialization method, which is executed for Module and all of its subclasses. 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.\r
-       * @param {string}       el      The element ID representing the Module <em>OR</em>\r
-       * @param {Element}      el      The element representing the Module\r
-       * @param {object}       userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+       * @method init\r
+       * @param {String}       el      The element ID representing the Module <em>OR</em>\r
+       * @param {HTMLElement}  el      The element representing the Module\r
+       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
        */\r
        init : function(el, userConfig) {\r
 \r
@@ -748,8 +797,13 @@ YAHOO.widget.Module.prototype = {
 \r
                this.beforeInitEvent.fire(YAHOO.widget.Module);\r
 \r
+               /**\r
+               * The Module's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
-               \r
+\r
                if (this.isSecure) {\r
                        this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;\r
                }\r
@@ -765,10 +819,10 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                this.element = el;\r
-               \r
+\r
                if (el.id) {\r
                        this.id = el.id;\r
-               } \r
+               }\r
 \r
                var childNodes = this.element.childNodes;\r
 \r
@@ -807,93 +861,101 @@ YAHOO.widget.Module.prototype = {
        },\r
 \r
        /**\r
-       * Initialized an empty DOM element that is placed out of the visible area that can be used to detect text resize.\r
+       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.\r
+       * @method initResizeMonitor\r
        */\r
        initResizeMonitor : function() {\r
 \r
         if(this.browser != "opera") {\r
 \r
             var resizeMonitor = document.getElementById("_yuiResizeMonitor");\r
-    \r
+\r
             if (! resizeMonitor) {\r
-    \r
+\r
                 resizeMonitor = document.createElement("iframe");\r
-    \r
+\r
                 var bIE = (this.browser.indexOf("ie") === 0);\r
-    \r
-                if(this.isSecure && this.RESIZE_MONITOR_SECURE_URL && bIE) {\r
-    \r
-                    resizeMonitor.src = this.RESIZE_MONITOR_SECURE_URL;\r
-    \r
+\r
+                if(this.isSecure &&\r
+                   YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL &&\r
+                   bIE) {\r
+\r
+                  resizeMonitor.src =\r
+                       YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;\r
+\r
                 }\r
-                \r
+\r
                 resizeMonitor.id = "_yuiResizeMonitor";\r
                 resizeMonitor.style.visibility = "hidden";\r
-                \r
+\r
                 document.body.appendChild(resizeMonitor);\r
-    \r
+\r
                 resizeMonitor.style.width = "10em";\r
                 resizeMonitor.style.height = "10em";\r
                 resizeMonitor.style.position = "absolute";\r
-                \r
+\r
                 var nLeft = -1 * resizeMonitor.offsetWidth,\r
                     nTop = -1 * resizeMonitor.offsetHeight;\r
-    \r
+\r
                 resizeMonitor.style.top = nTop + "px";\r
                 resizeMonitor.style.left =  nLeft + "px";\r
                 resizeMonitor.style.borderStyle = "none";\r
                 resizeMonitor.style.borderWidth = "0";\r
                 YAHOO.util.Dom.setStyle(resizeMonitor, "opacity", "0");\r
-                \r
+\r
                 resizeMonitor.style.visibility = "visible";\r
-    \r
+\r
                 if(!bIE) {\r
-    \r
+\r
                     var doc = resizeMonitor.contentWindow.document;\r
-    \r
+\r
                     doc.open();\r
                     doc.close();\r
-                \r
+\r
                 }\r
-    \r
+\r
             }\r
-    \r
+\r
             if(resizeMonitor && resizeMonitor.contentWindow) {\r
-    \r
+\r
                 this.resizeMonitor = resizeMonitor;\r
-    \r
+\r
                 YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
-    \r
+\r
             }\r
-        \r
+\r
         }\r
 \r
        },\r
 \r
        /**\r
        * Event handler fired when the resize monitor element is resized.\r
+       * @method onDomResize\r
+       * @param {DOMEvent} e   The DOM resize event\r
+       * @param {Object} obj   The scope object passed to the handler\r
        */\r
-       onDomResize : function(e, obj) { \r
+       onDomResize : function(e, obj) {\r
 \r
         var nLeft = -1 * this.resizeMonitor.offsetWidth,\r
             nTop = -1 * this.resizeMonitor.offsetHeight;\r
-        \r
+\r
         this.resizeMonitor.style.top = nTop + "px";\r
         this.resizeMonitor.style.left =  nLeft + "px";\r
-       \r
+\r
        },\r
 \r
        /**\r
        * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {string}       headerContent   The HTML used to set the header <em>OR</em>\r
-       * @param {Element}      headerContent   The Element to append to the header\r
-       */      \r
+       * @method setHeader\r
+       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>\r
+       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header\r
+       */\r
        setHeader : function(headerContent) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                if (typeof headerContent == "string") {\r
                        this.header.innerHTML = headerContent;\r
                } else {\r
@@ -907,14 +969,15 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the header\r
-       */      \r
+       * @method appendToHeader\r
+       * @param {HTMLElement}  element The element to append to the header\r
+       */\r
        appendToHeader : function(element) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                this.header.appendChild(element);\r
                this.changeHeaderEvent.fire(element);\r
                this.changeContentEvent.fire();\r
@@ -922,9 +985,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       bodyContent     The HTML used to set the body <em>OR</em>\r
-       * @param {Element}      bodyContent     The Element to append to the body\r
-       */              \r
+       * @method setBody\r
+       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>\r
+       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body\r
+       */\r
        setBody : function(bodyContent) {\r
                if (! this.body) {\r
                        this.body = document.createElement("DIV");\r
@@ -945,7 +1009,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the body. If no body is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the body\r
+       * @method appendToBody\r
+       * @param {HTMLElement}  element The element to append to the body\r
        */\r
        appendToBody : function(element) {\r
                if (! this.body) {\r
@@ -960,9 +1025,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       footerContent   The HTML used to set the footer <em>OR</em>\r
-       * @param {Element}      footerContent   The Element to append to the footer\r
-       */      \r
+       * @method setFooter\r
+       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>\r
+       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer\r
+       */\r
        setFooter : function(footerContent) {\r
                if (! this.footer) {\r
                        this.footer = document.createElement("DIV");\r
@@ -982,7 +1048,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the footer. If no footer is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the footer\r
+       * @method appendToFooter\r
+       * @param {HTMLElement}  element The element to append to the footer\r
        */\r
        appendToFooter : function(element) {\r
                if (! this.footer) {\r
@@ -997,10 +1064,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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 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.\r
-       * @param {string}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-       * @param {Element}      appendToNode    The element to which the Module should be appended to prior to rendering        \r
-       * @param {Element}      moduleElement   OPTIONAL. The element that represents the actual Standard Module container. \r
-       * @return {boolean} Success or failure of the render\r
+       * @method render\r
+       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering\r
+       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container.\r
+       * @return {Boolean} Success or failure of the render\r
        */\r
        render : function(appendToNode, moduleElement) {\r
                this.beforeRenderEvent.fire();\r
@@ -1014,12 +1082,12 @@ YAHOO.widget.Module.prototype = {
                        if (typeof element == "string") {\r
                                element = document.getElementById(element);\r
                        }\r
-                       \r
+\r
                        if (element) {\r
                                element.appendChild(me.element);\r
                                me.appendEvent.fire();\r
                        }\r
-               }\r
+               };\r
 \r
                if (appendToNode) {\r
                        appendTo(appendToNode);\r
@@ -1030,7 +1098,7 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                // Need to get everything into the DOM if it isn't already\r
-               \r
+\r
                if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {\r
                        // There is a header, but it's not in the DOM yet... need to add it\r
                        var firstChild = moduleElement.firstChild;\r
@@ -1061,6 +1129,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Removes the Module element from the DOM and sets all child elements to null.\r
+       * @method destroy\r
        */\r
        destroy : function() {\r
                if (this.element) {\r
@@ -1080,6 +1149,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Shows the Module element by setting the visible configuration property to true. Also fires two events: beforeShowEvent prior to the visibility change, and showEvent after.\r
+       * @method show\r
        */\r
        show : function() {\r
                this.cfg.setProperty("visible", true);\r
@@ -1087,6 +1157,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Hides the Module element by setting the visible configuration property to false. Also fires two events: beforeHideEvent prior to the visibility change, and hideEvent after.\r
+       * @method hide\r
        */\r
        hide : function() {\r
                this.cfg.setProperty("visible", false);\r
@@ -1097,6 +1168,10 @@ YAHOO.widget.Module.prototype = {
        /**\r
        * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".\r
        * This method is responsible for firing showEvent and hideEvent.\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configVisible\r
        */\r
        configVisible : function(type, args, obj) {\r
                var visible = args[0];\r
@@ -1113,6 +1188,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Default event handler for the "monitorresize" configuration property\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configMonitorResize\r
        */\r
        configMonitorResize : function(type, args, obj) {\r
                var monitor = args[0];\r
@@ -1123,95 +1202,97 @@ YAHOO.widget.Module.prototype = {
                        this.resizeMonitor = null;\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the Object.\r
+* @method toString\r
+* @return {String}     The string representation of the Module\r
+*/\r
 YAHOO.widget.Module.prototype.toString = function() {\r
        return "Module " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+};\r
+\r
+/**\r
+* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
+* @class Overlay\r
+* @namespace YAHOO.widget\r
+* @extends YAHOO.widget.Module\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 * @constructor\r
 */\r
 YAHOO.widget.Overlay = function(el, userConfig) {\r
        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);\r
 \r
 /**\r
-* The URL of the blank image that will be placed in the iframe\r
-* @type string\r
+* The URL that will be placed in the iframe\r
+* @property YAHOO.widget.Overlay.IFRAME_SRC\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Overlay.IFRAME_SRC = "promo/m/irs/blank.gif";\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
 \r
 /**\r
 * Constant representing the top left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_LEFT = "tl";\r
 \r
 /**\r
 * Constant representing the top right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_RIGHT = "tr";\r
 \r
 /**\r
 * Constant representing the top bottom left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";\r
 \r
 /**\r
 * Constant representing the bottom right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";\r
 \r
 /**\r
 * Constant representing the default CSS class used for an Overlay\r
-* @type string\r
+* @property YAHOO.widget.Overlay.CSS_OVERLAY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";\r
 \r
 /**\r
-* CustomEvent fired before the Overlay is moved.\r
-* args: x,y that the Overlay will be moved to\r
-* @type YAHOO.util.CustomEvent\r
+* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
-YAHOO.widget.Overlay.prototype.beforeMoveEvent = null;\r
+YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
+       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
 \r
-/**\r
-* CustomEvent fired after the Overlay is moved.\r
-* args: x,y that the Overlay was moved to\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Overlay.prototype.moveEvent = null;\r
-\r
-/**\r
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
-*/\r
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
-       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
        this.beforeInitEvent.fire(YAHOO.widget.Overlay);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);\r
@@ -1230,81 +1311,181 @@ YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
        }\r
 \r
        this.initEvent.fire(YAHOO.widget.Overlay);\r
-\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Overlay.prototype.initEvents = function() {\r
        YAHOO.widget.Overlay.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired before the Overlay is moved.\r
+       * @event beforeMoveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);\r
+\r
+       /**\r
+       * CustomEvent fired after the Overlay is moved.\r
+       * @event moveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.moveEvent = new YAHOO.util.CustomEvent("move", this);\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);\r
 \r
        // Add overlay config properties //\r
+\r
+       /**\r
+       * The absolute x-coordinate position of the Overlay\r
+       * @config x\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * The absolute y-coordinate position of the Overlay\r
+       * @config y\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * An array with the absolute x and y positions of the Overlay\r
+       * @config xy\r
+       * @type Number[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * The 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 Overlay's top left corner to the context element's bottom left corner.\r
+       * @config context\r
+       * @type Array\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * True if the Overlay should be anchored to the center of the viewport.\r
+       * @config fixedcenter\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );\r
 \r
+       /**\r
+       * CSS width of the Overlay.\r
+       * @config width\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * CSS height of the Overlay.\r
+       * @config height\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * CSS z-index of the Overlay.\r
+       * @config zIndex\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );\r
 \r
+       /**\r
+       * True if the Overlay should be prevented from being positioned out of the viewport.\r
+       * @config constraintoviewport\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );\r
+\r
+       /**\r
+       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true for IE6 and below, false for all others\r
+       */\r
        this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );\r
-}\r
+};\r
 \r
 /**\r
 * Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);\r
-* @param {int} x       The Overlay's new x position\r
-* @param {int} y       The Overlay's new y position\r
+* @method moveTo\r
+* @param {Number}      x       The Overlay's new x position\r
+* @param {Number}      y       The Overlay's new y position\r
 */\r
 YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {\r
        this.cfg.setProperty("xy",[x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method hideMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");\r
-}\r
+};\r
 \r
 /**\r
 * Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method showMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "show-scrollbars");\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.\r
+* @method configVisible\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {\r
        var visible = args[0];\r
+\r
        var currentVis = YAHOO.util.Dom.getStyle(this.element, "visibility");\r
 \r
+       if (currentVis == "inherit") {\r
+               var e = this.element.parentNode;\r
+               while (e.nodeType != 9 && e.nodeType != 11) {\r
+                       currentVis = YAHOO.util.Dom.getStyle(e, "visibility");\r
+                       if (currentVis != "inherit") { break; }\r
+                       e = e.parentNode;\r
+               }\r
+               if (currentVis == "inherit") {\r
+                       currentVis = "visible";\r
+               }\r
+       }\r
+\r
        var effect = this.cfg.getProperty("effect");\r
 \r
-       var effectInstances = new Array();\r
+       var effectInstances = [];\r
        if (effect) {\r
                if (effect instanceof Array) {\r
                        for (var i=0;i<effect.length;i++) {\r
@@ -1321,23 +1502,23 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        if (visible) { // Show\r
                if (isMacGecko) {\r
                        this.showMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate in\r
                        if (visible) { // Animate in if not showing\r
-                               if (currentVis != "visible") {\r
+                               if (currentVis != "visible" || currentVis === "") {\r
                                        this.beforeShowEvent.fire();\r
-                                       for (var i=0;i<effectInstances.length;i++) {\r
-                                               var e = effectInstances[i];\r
-                                               if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
-                                                       e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
+                                       for (var j=0;j<effectInstances.length;j++) {\r
+                                               var ei = effectInstances[j];\r
+                                               if (j === 0 && ! YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
+                                                       ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
                                                }\r
-                                               e.animateIn();\r
+                                               ei.animateIn();\r
                                        }\r
                                }\r
                        }\r
                } else { // Show\r
-                       if (currentVis != "visible") {\r
+                       if (currentVis != "visible" || currentVis === "") {\r
                                this.beforeShowEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");\r
                                this.cfg.refireEvent("iframe");\r
@@ -1348,52 +1529,59 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        } else { // Hide\r
                if (isMacGecko) {\r
                        this.hideMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate out if showing\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible") {\r
                                this.beforeHideEvent.fire();\r
-                               for (var i=0;i<effectInstances.length;i++) {\r
-                                       var e = effectInstances[i];\r
-                                       if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {                            \r
-                                               e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
+                               for (var k=0;k<effectInstances.length;k++) {\r
+                                       var h = effectInstances[k];\r
+                                       if (k === 0 && ! YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {\r
+                                               h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
                                        }\r
-                                       e.animateOut();\r
+                                       h.animateOut();\r
                                }\r
+                       } else if (currentVis === "") {\r
+                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                        }\r
                } else { // Simple hide\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible" || currentVis === "") {\r
                                this.beforeHideEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                                this.cfg.refireEvent("iframe");\r
                                this.hideEvent.fire();\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Center event handler used for centering on scroll/resize, but only if the Overlay is visible\r
+* @method doCenterOnDOMEvent\r
 */\r
 YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {\r
        if (this.cfg.getProperty("visible")) {\r
                this.center();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "fixedcenter" property is changed.\r
+* @method configFixedCenter\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        if (val) {\r
                this.center();\r
-                       \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent, this.center, this)) {\r
                        this.beforeShowEvent.subscribe(this.center, this, true);\r
                }\r
-               \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);\r
                }\r
@@ -1405,30 +1593,42 @@ YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {
                YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
                YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configHeight = function(type, args, obj) {\r
        var height = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "height", height);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configWidth = function(type, args, obj) {\r
        var width = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "width", width);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {\r
        var zIndex = args[0];\r
@@ -1451,10 +1651,14 @@ YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {
 \r
        YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);\r
        this.cfg.setProperty("zIndex", zIndex, true);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "xy" property is changed.\r
+* @method configXY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1471,10 +1675,14 @@ YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "x" property is changed.\r
+* @method configX\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {\r
        var x = args[0];\r
@@ -1489,15 +1697,19 @@ YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
        y = this.cfg.getProperty("y");\r
 \r
        YAHOO.util.Dom.setX(this.element, x, true);\r
-       \r
+\r
        this.cfg.setProperty("xy", [x, y], true);\r
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "y" property is changed.\r
+* @method configY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {\r
        var x = this.cfg.getProperty("x");\r
@@ -1517,36 +1729,46 @@ YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
+\r
+/**\r
+* Shows the iframe shim, if it has been enabled\r
+* @method showIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.showIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "block";\r
+       }\r
+};\r
+\r
+/**\r
+* Hides the iframe shim, if it has been enabled\r
+* @method hideIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.hideIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "none";\r
+       }\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "iframe" property is changed.\r
+* @method configIframe\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {\r
 \r
        var val = args[0];\r
 \r
-       var el = this.element;\r
-       \r
-       var showIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "block";\r
-               }\r
-       }\r
-\r
-       var hideIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "none";\r
-               }\r
-       }\r
-\r
        if (val) { // IFRAME shim is enabled\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, showIframe, this)) {\r
-                       this.showEvent.subscribe(showIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {\r
+                       this.showEvent.subscribe(this.showIframe, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, hideIframe, this)) {\r
-                       this.hideEvent.subscribe(hideIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {\r
+                       this.hideEvent.subscribe(this.hideIframe, this, true);\r
                }\r
 \r
                var x = this.cfg.getProperty("x");\r
@@ -1564,8 +1786,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                if (this.isSecure) {\r
                                        this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
                                }\r
-                               \r
-                               var parent = el.parentNode;\r
+\r
+                               var parent = this.element.parentNode;\r
                                if (parent) {\r
                                        parent.appendChild(this.iframe);\r
                                } else {\r
@@ -1578,12 +1800,12 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                YAHOO.util.Dom.setStyle(this.iframe, "padding", "0");\r
                                YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
                                if (this.cfg.getProperty("visible")) {\r
-                                       showIframe.call(this);\r
+                                       this.showIframe();\r
                                } else {\r
-                                       hideIframe.call(this);\r
+                                       this.hideIframe();\r
                                }\r
                        }\r
-                       \r
+\r
                        var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");\r
 \r
                        if (iframeDisplay == "none") {\r
@@ -1592,8 +1814,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
 \r
                        YAHOO.util.Dom.setXY(this.iframe, [x,y]);\r
 \r
-                       var width = el.clientWidth;\r
-                       var height = el.clientHeight;\r
+                       var width = this.element.clientWidth;\r
+                       var height = this.element.clientHeight;\r
 \r
                        YAHOO.util.Dom.setStyle(this.iframe, "width", (width+2) + "px");\r
                        YAHOO.util.Dom.setStyle(this.iframe, "height", (height+2) + "px");\r
@@ -1606,14 +1828,18 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                if (this.iframe) {\r
                        this.iframe.style.display = "none";\r
                }\r
-               this.showEvent.unsubscribe(showIframe, this);\r
-               this.hideEvent.unsubscribe(hideIframe, this);\r
+               this.showEvent.unsubscribe(this.showIframe, this);\r
+               this.hideEvent.unsubscribe(this.hideIframe, this);\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The default event handler fired when the "constraintoviewport" property is changed.\r
+* @method configConstrainToViewport\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args, obj) {\r
        var val = args[0];\r
@@ -1624,10 +1850,14 @@ YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args,
        } else {\r
                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {\r
        var contextArgs = args[0];\r
@@ -1641,27 +1871,28 @@ YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {
                        if (typeof contextEl == "string") {\r
                                this.cfg.setProperty("context", [document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner], true);\r
                        }\r
-                       \r
+\r
                        if (elementMagnetCorner && contextMagnetCorner) {\r
                                this.align(elementMagnetCorner, contextMagnetCorner);\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.\r
-* @param {string} elementAlign         The string representing the corner of the Overlay that should be aligned to the context element\r
-* @param {string} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
+* @method align\r
+* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element\r
+* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
 */\r
 YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {\r
        var contextArgs = this.cfg.getProperty("context");\r
        if (contextArgs) {\r
                var context = contextArgs[0];\r
-               \r
+\r
                var element = this.element;\r
                var me = this;\r
 \r
@@ -1692,7 +1923,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                                me.moveTo(h-element.offsetWidth,v-element.offsetHeight);\r
                                                break;\r
                                }\r
-                       }\r
+                       };\r
 \r
                        switch (contextAlign) {\r
                                case YAHOO.widget.Overlay.TOP_LEFT:\r
@@ -1700,7 +1931,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                        break;\r
                                case YAHOO.widget.Overlay.TOP_RIGHT:\r
                                        doAlign(contextRegion.top, contextRegion.right);\r
-                                       break;          \r
+                                       break;\r
                                case YAHOO.widget.Overlay.BOTTOM_LEFT:\r
                                        doAlign(contextRegion.bottom, contextRegion.left);\r
                                        break;\r
@@ -1710,10 +1941,14 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                        }\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.\r
+* @method enforceConstraints\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1721,26 +1956,20 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        var x = pos[0];\r
        var y = pos[1];\r
 \r
-       var width = parseInt(this.cfg.getProperty("width"));\r
-\r
-       if (isNaN(width)) {\r
-               width = 0;\r
-       }\r
-\r
        var offsetHeight = this.element.offsetHeight;\r
-       var offsetWidth = (width>0?width:this.element.offsetWidth); //this.element.offsetWidth;\r
+       var offsetWidth = this.element.offsetWidth;\r
 \r
        var viewPortWidth = YAHOO.util.Dom.getViewportWidth();\r
        var viewPortHeight = YAHOO.util.Dom.getViewportHeight();\r
 \r
-       var scrollX = window.scrollX || document.documentElement.scrollLeft;\r
-       var scrollY = window.scrollY || document.documentElement.scrollTop;\r
+       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
+       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;\r
 \r
        var topConstraint = scrollY + 10;\r
        var leftConstraint = scrollX + 10;\r
        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-       \r
+\r
        if (x < leftConstraint) {\r
                x = leftConstraint;\r
        } else if (x > rightConstraint) {\r
@@ -1756,10 +1985,11 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        this.cfg.setProperty("x", x, true);\r
        this.cfg.setProperty("y", y, true);\r
        this.cfg.setProperty("xy", [x,y], true);\r
-}\r
+};\r
 \r
 /**\r
 * Centers the container in the viewport.\r
+* @method center\r
 */\r
 YAHOO.widget.Overlay.prototype.center = function() {\r
        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
@@ -1773,161 +2003,195 @@ YAHOO.widget.Overlay.prototype.center = function() {
 \r
        var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;\r
        var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;\r
-       \r
-       this.element.style.left = parseInt(x) + "px";\r
-       this.element.style.top = parseInt(y) + "px";\r
-       this.syncPosition();\r
+\r
+       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);\r
 \r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.\r
+* @method syncPosition\r
 */\r
 YAHOO.widget.Overlay.prototype.syncPosition = function() {\r
        var pos = YAHOO.util.Dom.getXY(this.element);\r
        this.cfg.setProperty("x", pos[0], true);\r
        this.cfg.setProperty("y", pos[1], true);\r
        this.cfg.setProperty("xy", pos, true);\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
 YAHOO.widget.Overlay.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Overlay.superclass.onDomResize.call(this, e, obj);\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+       var me = this;\r
+       setTimeout(function() {\r
+               me.syncPosition();\r
+               me.cfg.refireEvent("iframe");\r
+               me.cfg.refireEvent("context");\r
+       }, 0);\r
+};\r
 \r
 /**\r
 * Removes the Overlay element from the DOM and sets all child elements to null.\r
+* @method destroy\r
 */\r
 YAHOO.widget.Overlay.prototype.destroy = function() {\r
        if (this.iframe) {\r
                this.iframe.parentNode.removeChild(this.iframe);\r
        }\r
-       \r
+\r
        this.iframe = null;\r
 \r
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  \r
+       YAHOO.widget.Overlay.superclass.destroy.call(this);\r
 };\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Overlay.\r
+*/\r
 YAHOO.widget.Overlay.prototype.toString = function() {\r
        return "Overlay " + this.id;\r
-}\r
+};\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window scroll\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowScrollEvent\r
 */\r
 YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window resize\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowResizeEvent\r
 */\r
 YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window scroll\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowScrollHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM scroll event\r
 */\r
 YAHOO.widget.Overlay.windowScrollHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowScrollEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.scrollEnd) {\r
+                       window.scrollEnd = -1;\r
+               }\r
+               clearTimeout(window.scrollEnd);\r
+               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowScrollEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window resize\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowResizeHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM resize event\r
 */\r
 YAHOO.widget.Overlay.windowResizeHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowResizeEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.resizeEnd) {\r
+                       window.resizeEnd = -1;\r
+               }\r
+               clearTimeout(window.resizeEnd);\r
+               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowResizeEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
+* A boolean that indicated whether the window resize and scroll events have already been subscribed to.\r
+* @property YAHOO.widget.Overlay._initialized\r
 * @private\r
+* @type Boolean\r
 */\r
-YAHOO.widget.Overlay._initialized == null;\r
+YAHOO.widget.Overlay._initialized = null;\r
 \r
-if (YAHOO.widget.Overlay._initialized == null) {\r
+if (YAHOO.widget.Overlay._initialized === null) {\r
        YAHOO.util.Event.addListener(window, "scroll", YAHOO.widget.Overlay.windowScrollHandler);\r
        YAHOO.util.Event.addListener(window, "resize", YAHOO.widget.Overlay.windowResizeHandler);\r
 \r
        YAHOO.widget.Overlay._initialized = true;\r
 }\r
+\r
 /**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
-* OverlayManager is used for maintaining the focus status of multiple Overlays.\r
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
-* @param {object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
+* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget\r
+* @namespace YAHOO.widget\r
+* @class OverlayManager\r
 * @constructor\r
+* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
+* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
 */\r
 YAHOO.widget.OverlayManager = function(userConfig) {\r
        this.init(userConfig);\r
-}\r
+};\r
 \r
 /**\r
 * The CSS class representing a focused Overlay\r
-* @type string\r
+* @property YAHOO.widget.OverlayManager.CSS_FOCUSED\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";\r
 \r
 YAHOO.widget.OverlayManager.prototype = {\r
-\r
+       /**\r
+       * The class's constructor function\r
+       * @property contructor\r
+       * @type Function\r
+       */\r
        constructor : YAHOO.widget.OverlayManager,\r
 \r
        /**\r
        * The array of Overlays that are currently registered\r
-       * @type Array\r
+       * @property overlays\r
+       * @type YAHOO.widget.Overlay[]\r
        */\r
        overlays : null,\r
 \r
        /**\r
        * Initializes the default configuration of the OverlayManager\r
-       */      \r
+       * @method initDefaultConfig\r
+       */\r
        initDefaultConfig : function() {\r
+               /**\r
+               * The collection of registered Overlays in use by the OverlayManager\r
+               * @config overlays\r
+               * @type YAHOO.widget.Overlay[]\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("overlays", { suppressEvent:true } );\r
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
-       }, \r
 \r
-       /**\r
-       * Returns the currently focused Overlay\r
-       * @return {Overlay}     The currently focused Overlay\r
-       */\r
-       getActive : function() {},\r
-\r
-       /**\r
-       * Focuses the specified Overlay\r
-       * @param {Overlay}      The Overlay to focus\r
-       * @param {string}       The id of the Overlay to focus\r
-       */\r
-       focus : function(overlay) {},\r
-\r
-       /**\r
-       * Removes the specified Overlay from the manager\r
-       * @param {Overlay}      The Overlay to remove\r
-       * @param {string}       The id of the Overlay to remove\r
-       */\r
-       remove: function(overlay) {},\r
-\r
-       /**\r
-       * Removes focus from all registered Overlays in the manager\r
-       */\r
-       blurAll : function() {},\r
+               /**\r
+               * The default DOM event that should be used to focus an Overlay\r
+               * @config focusevent\r
+               * @type String\r
+               * @default "mousedown"\r
+               */\r
+               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
+       },\r
 \r
        /**\r
        * Initializes the OverlayManager\r
-       * @param {Array}        overlays        Optional. A collection of Overlays to register with the manager.\r
-       * @param {object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
+       * @method init\r
+       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.\r
+       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
        */\r
        init : function(userConfig) {\r
+               /**\r
+               * The OverlayManager's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
 \r
                this.initDefaultConfig();\r
@@ -1937,12 +2201,29 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
                this.cfg.fireQueue();\r
 \r
+               /**\r
+               * The currently activated Overlay\r
+               * @property activeOverlay\r
+               * @private\r
+               * @type YAHOO.widget.Overlay\r
+               */\r
                var activeOverlay = null;\r
 \r
+               /**\r
+               * Returns the currently focused Overlay\r
+               * @method getActive\r
+               * @return {YAHOO.widget.Overlay}        The currently focused Overlay\r
+               */\r
                this.getActive = function() {\r
                        return activeOverlay;\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Focuses the specified Overlay\r
+               * @method focus\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus\r
+               * @param {String} overlay       The id of the Overlay to focus\r
+               */\r
                this.focus = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1952,12 +2233,18 @@ YAHOO.widget.OverlayManager.prototype = {
                                this.overlays.sort(this.compareZIndexDesc);\r
                                var topZIndex = YAHOO.util.Dom.getStyle(this.overlays[0].element, "zIndex");\r
                                if (! isNaN(topZIndex) && this.overlays[0] != overlay) {\r
-                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex) + 1));\r
+                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex, 10) + 2));\r
                                }\r
                                this.overlays.sort(this.compareZIndexDesc);\r
                        }\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Removes the specified Overlay from the manager\r
+               * @method remove\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove\r
+               * @param {String} overlay       The id of the Overlay to remove\r
+               */\r
                this.remove = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1968,24 +2255,28 @@ YAHOO.widget.OverlayManager.prototype = {
                                o.cfg.setProperty("zIndex", originalZ, true);\r
 \r
                                o.cfg.setProperty("manager", null);\r
-                               o.focusEvent = null\r
+                               o.focusEvent = null;\r
                                o.blurEvent = null;\r
                                o.focus = null;\r
                                o.blur = null;\r
                        }\r
-               }\r
+               };\r
 \r
+               /**\r
+               * Removes focus from all registered Overlays in the manager\r
+               * @method blurAll\r
+               */\r
                this.blurAll = function() {\r
                        activeOverlay = null;\r
                        for (var o=0;o<this.overlays.length;o++) {\r
                                YAHOO.util.Dom.removeClass(this.overlays[o].element, YAHOO.widget.OverlayManager.CSS_FOCUSED);\r
-                       }               \r
-               }\r
+                       }\r
+               };\r
 \r
                var overlays = this.cfg.getProperty("overlays");\r
-               \r
+\r
                if (! this.overlays) {\r
-                       this.overlays = new Array();\r
+                       this.overlays = [];\r
                }\r
 \r
                if (overlays) {\r
@@ -1996,9 +2287,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each.\r
-       * @param {Overlay}      overlay         An Overlay to register with the manager.\r
-       * @param {Overlay[]}    overlay         An array of Overlays to register with the manager.\r
-       * @return       {boolean}       True if any Overlays are registered.\r
+       * @method register\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.\r
+       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.\r
+       * @return       {Boolean}       True if any Overlays are registered.\r
        */\r
        register : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2006,33 +2298,33 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
                        overlay.focusEvent = new YAHOO.util.CustomEvent("focus");\r
                        overlay.blurEvent = new YAHOO.util.CustomEvent("blur");\r
-                       \r
+\r
                        var mgr=this;\r
 \r
                        overlay.focus = function() {\r
                                mgr.focus(this);\r
                                this.focusEvent.fire();\r
-                       } \r
+                       };\r
 \r
                        overlay.blur = function() {\r
                                mgr.blurAll();\r
                                this.blurEvent.fire();\r
-                       }\r
+                       };\r
 \r
                        var focusOnDomEvent = function(e,obj) {\r
                                overlay.focus();\r
-                       }\r
-                       \r
+                       };\r
+\r
                        var focusevent = this.cfg.getProperty("focusevent");\r
                        YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);\r
 \r
                        var zIndex = YAHOO.util.Dom.getStyle(overlay.element, "zIndex");\r
                        if (! isNaN(zIndex)) {\r
-                               overlay.cfg.setProperty("zIndex", parseInt(zIndex));\r
+                               overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));\r
                        } else {\r
                                overlay.cfg.setProperty("zIndex", 0);\r
                        }\r
-                       \r
+\r
                        this.overlays.push(overlay);\r
                        return true;\r
                } else if (overlay instanceof Array) {\r
@@ -2052,9 +2344,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Attempts to locate an Overlay by instance or ID.\r
-       * @param {Overlay}      overlay         An Overlay to locate within the manager\r
-       * @param {string}       overlay         An Overlay id to locate within the manager\r
-       * @return       {Overlay}       The requested Overlay, if found, or null if it cannot be located.\r
+       * @method find\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager\r
+       * @param {String}       overlay         An Overlay id to locate within the manager\r
+       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.\r
        */\r
        find : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2064,18 +2357,20 @@ YAHOO.widget.OverlayManager.prototype = {
                                }\r
                        }\r
                } else if (typeof overlay == "string") {\r
-                       for (var o=0;o<this.overlays.length;o++) {\r
-                               if (this.overlays[o].id == overlay) {\r
-                                       return this.overlays[o];\r
+                       for (var p=0;p<this.overlays.length;p++) {\r
+                               if (this.overlays[p].id == overlay) {\r
+                                       return this.overlays[p];\r
                                }\r
-                       }                       \r
+                       }\r
                }\r
                return null;\r
        },\r
 \r
        /**\r
        * Used for sorting the manager's Overlays by z-index.\r
+       * @method compareZIndexDesc\r
        * @private\r
+       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.\r
        */\r
        compareZIndexDesc : function(o1, o2) {\r
                var zIndex1 = o1.cfg.getProperty("zIndex");\r
@@ -2092,6 +2387,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Shows all Overlays in the manager.\r
+       * @method showAll\r
        */\r
        showAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2101,6 +2397,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Hides all Overlays in the manager.\r
+       * @method hideAll\r
        */\r
        hideAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2108,35 +2405,55 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
        },\r
 \r
+\r
        /**\r
        * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * @method toString\r
+       * @return {String}      The string representation of the OverlayManager\r
+       */\r
        toString : function() {\r
                return "OverlayManager";\r
        }\r
 \r
-}/**\r
-* Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-* Code licensed under the BSD License:\r
-* http://developer.yahoo.net/yui/license.txt\r
+};\r
+\r
+/**\r
 * KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.\r
-* @param {Element}     attachTo        The element or element ID to which the key event should be attached\r
-* @param {string}      attachTo        The element or element ID to which the key event should be attached\r
-* @param {object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
-* @param {function}    handler         The CustomEvent handler to fire when the key event is detected\r
-* @param {object}      handler         An object literal representing the handler. \r
-* @param {string}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
+* @namespace YAHOO.util\r
+* @class KeyListener\r
 * @constructor\r
+* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached\r
+* @param {String}      attachTo        The element or element ID to which the key event should be attached\r
+* @param {Object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected\r
+* @param {Object}      handler         An object literal representing the handler.\r
+* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
 */\r
 YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {\r
        if (! event) {\r
                event = YAHOO.util.KeyListener.KEYDOWN;\r
        }\r
 \r
+       /**\r
+       * The CustomEvent fired internally when a key is pressed\r
+       * @event keyEvent\r
+       * @private\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        var keyEvent = new YAHOO.util.CustomEvent("keyPressed");\r
-       \r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is enabled via the enable() function\r
+       * @event enabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.enabledEvent = new YAHOO.util.CustomEvent("enabled");\r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is disabled via the disable() function\r
+       * @event disabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.disabledEvent = new YAHOO.util.CustomEvent("disabled");\r
 \r
        if (typeof attachTo == 'string') {\r
@@ -2151,137 +2468,149 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
 \r
        /**\r
        * Handles the key event when a key is pressed.\r
+       * @method handleKeyPress\r
+       * @param {DOMEvent} e   The keypress DOM event\r
+       * @param {Object}       obj     The DOM event scope object\r
        * @private\r
        */\r
        function handleKeyPress(e, obj) {\r
-               var keyPressed = e.charCode || e.keyCode;\r
-               \r
-               if (! keyData.shift)    keyData.shift = false;\r
-               if (! keyData.alt)              keyData.alt = false;\r
-               if (! keyData.ctrl)             keyData.ctrl = false;\r
+               if (! keyData.shift) {\r
+                       keyData.shift = false;\r
+               }\r
+               if (! keyData.alt) {\r
+                       keyData.alt = false;\r
+               }\r
+               if (! keyData.ctrl) {\r
+                       keyData.ctrl = false;\r
+               }\r
 \r
                // check held down modifying keys first\r
-               if (e.shiftKey == keyData.shift && \r
+               if (e.shiftKey == keyData.shift &&\r
                        e.altKey   == keyData.alt &&\r
                        e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match\r
 \r
+                       var dataItem;\r
+                       var keyPressed;\r
+\r
                        if (keyData.keys instanceof Array) {\r
                                for (var i=0;i<keyData.keys.length;i++) {\r
-                                       if (keyPressed == keyData.keys[i]) {\r
-                                               keyEvent.fire(keyPressed, e);\r
+                                       dataItem = keyData.keys[i];\r
+\r
+                                       if (dataItem == e.charCode ) {\r
+                                               keyEvent.fire(e.charCode, e);\r
+                                               break;\r
+                                       } else if (dataItem == e.keyCode) {\r
+                                               keyEvent.fire(e.keyCode, e);\r
                                                break;\r
                                        }\r
                                }\r
                        } else {\r
-                               if (keyPressed == keyData.keys) {\r
-                                       keyEvent.fire(keyPressed, e);\r
+                               dataItem = keyData.keys;\r
+\r
+                               if (dataItem == e.charCode ) {\r
+                                       keyEvent.fire(e.charCode, e);\r
+                               } else if (dataItem == e.keyCode) {\r
+                                       keyEvent.fire(e.keyCode, e);\r
                                }\r
                        }\r
                }\r
        }\r
 \r
+       /**\r
+       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element\r
+       * @method enable\r
+       */\r
        this.enable = function() {\r
                if (! this.enabled) {\r
                        YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);\r
                        this.enabledEvent.fire(keyData);\r
                }\r
+               /**\r
+               * Boolean indicating the enabled/disabled state of the Tooltip\r
+               * @property enabled\r
+               * @type Boolean\r
+               */\r
                this.enabled = true;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Disables the KeyListener by removing the DOM event listeners from the target DOM element\r
+       * @method disable\r
+       */\r
        this.disable = function() {\r
                if (this.enabled) {\r
                        YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);\r
                        this.disabledEvent.fire(keyData);\r
                }\r
                this.enabled = false;\r
-       }\r
+       };\r
 \r
        /**\r
-       * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * Returns a String representation of the object.\r
+       * @method toString\r
+       * @return {String}      The string representation of the KeyListener\r
+       */\r
        this.toString = function() {\r
                return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");\r
-       }\r
+       };\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the DOM "keydown" event.\r
+* @property YAHOO.util.KeyListener.KEYDOWN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYDOWN = "keydown";\r
 \r
 /**\r
 * Constant representing the DOM "keyup" event.\r
+* @property YAHOO.util.KeyListener.KEYUP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYUP = "keyup";\r
 \r
 /**\r
-* Boolean indicating the enabled/disabled state of the Tooltip\r
-* @type Booleam\r
-*/\r
-YAHOO.util.KeyListener.prototype.enabled = null;\r
-\r
-/**\r
-* Enables the KeyListener, by dynamically attaching the key event to the appropriate DOM element.\r
-*/\r
-YAHOO.util.KeyListener.prototype.enable = function() {};\r
-\r
-/**\r
-* Disables the KeyListener, by dynamically removing the key event from the appropriate DOM element.\r
-*/\r
-YAHOO.util.KeyListener.prototype.disable = function() {};\r
-\r
-/**\r
-* CustomEvent fired when the KeyListener is enabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.util.KeyListener.prototype.enabledEvent = null;\r
-\r
-/**\r
-* CustomEvent fired when the KeyListener is disabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.util.KeyListener.prototype.disabledEvent = null;\r
-/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
 * Tooltip is an implementation of Overlay that behaves like an OS tooltip, displaying when the user mouses over a particular element, and disappearing on mouse out.\r
-* @param {string}      el      The element ID representing the Tooltip <em>OR</em>\r
-* @param {Element}     el      The element representing the Tooltip\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Tooltip\r
+* @extends YAHOO.widget.Overlay\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Tooltip <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Tooltip\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Tooltip = function(el, userConfig) {\r
        YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Tooltip, YAHOO.widget.Overlay);\r
 \r
 /**\r
 * Constant representing the Tooltip CSS class\r
-* @type string\r
+* @property YAHOO.widget.Tooltip.CSS_TOOLTIP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Tooltip.CSS_TOOLTIP = "tt";\r
 \r
 /**\r
 * The Tooltip initialization method. This method is automatically called by the constructor. A Tooltip is automatically rendered by the init method, and it also is set to be invisible by default, and constrained to viewport by default as well.\r
-* @param {string}      el      The element ID representing the Tooltip <em>OR</em>\r
-* @param {Element}     el      The element representing the Tooltip\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Tooltip <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Tooltip\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {\r
        if (document.readyState && document.readyState != "complete") {\r
                var deferredInit = function() {\r
                        this.init(el, userConfig);\r
-               }\r
+               };\r
                YAHOO.util.Event.addListener(window, "load", deferredInit, this, true);\r
        } else {\r
                YAHOO.widget.Tooltip.superclass.init.call(this, el);\r
@@ -2293,7 +2622,7 @@ YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
                if (userConfig) {\r
                        this.cfg.applyConfig(userConfig, true);\r
                }\r
-               \r
+\r
                this.cfg.queueProperty("visible",false);\r
                this.cfg.queueProperty("constraintoviewport",true);\r
 \r
@@ -2302,53 +2631,113 @@ YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
 \r
                this.initEvent.fire(YAHOO.widget.Tooltip);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Tooltip.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);\r
 \r
+       /**\r
+       * Specifies whether the Tooltip should be kept from overlapping its context element.\r
+       * @config preventoverlap\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("preventoverlap",          { value:true, validator:this.cfg.checkBoolean, supercedes:["x","y","xy"] } );\r
 \r
+       /**\r
+       * The number of milliseconds to wait before showing a Tooltip on mouseover.\r
+       * @config showdelay\r
+       * @type Number\r
+       * @default 200\r
+       */\r
        this.cfg.addProperty("showdelay",                       { value:200, handler:this.configShowDelay, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The number of milliseconds to wait before automatically dismissing a Tooltip after the mouse has been resting on the context element.\r
+       * @config autodismissdelay\r
+       * @type Number\r
+       * @default 5000\r
+       */\r
        this.cfg.addProperty("autodismissdelay",        { value:5000, handler:this.configAutoDismissDelay, validator:this.cfg.checkNumber } );\r
+\r
+       /**\r
+       * The number of milliseconds to wait before hiding a Tooltip on mouseover.\r
+       * @config hidedelay\r
+       * @type Number\r
+       * @default 250\r
+       */\r
        this.cfg.addProperty("hidedelay",                       { value:250, handler:this.configHideDelay, validator:this.cfg.checkNumber } );\r
 \r
+       /**\r
+       * Specifies the Tooltip's text.\r
+       * @config text\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("text",                            { handler:this.configText, suppressEvent:true } );\r
+\r
+       /**\r
+       * Specifies the container element that the Tooltip's markup should be rendered into.\r
+       * @config container\r
+       * @type HTMLElement/String\r
+       * @default document.body\r
+       */\r
        this.cfg.addProperty("container",                       { value:document.body, handler:this.configContainer } );\r
-}\r
+\r
+       /**\r
+       * Specifies the element or elements that the Tooltip should be anchored to on mouseover.\r
+       * @config context\r
+       * @type HTMLElement[]/String[]\r
+       * @default null\r
+       */\r
+\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "text" property is changed.\r
+* @method configText\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configText = function(type, args, obj) {\r
        var text = args[0];\r
        if (text) {\r
                this.setBody(text);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "container" property is changed.\r
+* @method configContainer\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configContainer = function(type, args, obj) {\r
        var container = args[0];\r
        if (typeof container == 'string') {\r
                this.cfg.setProperty("container", document.getElementById(container), true);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {\r
        var context = args[0];\r
        if (context) {\r
-               \r
+\r
                // Normalize parameter into an array\r
                if (! (context instanceof Array)) {\r
                        if (typeof context == "string") {\r
@@ -2372,14 +2761,14 @@ YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
 \r
                // Add mouseover/mouseout listeners to context elements\r
                this._context = context;\r
-               for (var c=0;c<this._context.length;++c) {\r
-                       var el = this._context[c];\r
-                       YAHOO.util.Event.addListener(el, "mouseover", this.onContextMouseOver, this);\r
-                       YAHOO.util.Event.addListener(el, "mousemove", this.onContextMouseMove, this);\r
-                       YAHOO.util.Event.addListener(el, "mouseout", this.onContextMouseOut, this);\r
+               for (var d=0;d<this._context.length;++d) {\r
+                       var el2 = this._context[d];\r
+                       YAHOO.util.Event.addListener(el2, "mouseover", this.onContextMouseOver, this);\r
+                       YAHOO.util.Event.addListener(el2, "mousemove", this.onContextMouseMove, this);\r
+                       YAHOO.util.Event.addListener(el2, "mouseout", this.onContextMouseOut, this);\r
                }\r
        }\r
-}\r
+};\r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
@@ -2387,19 +2776,21 @@ YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
 \r
 /**\r
 * The default event handler fired when the user moves the mouse while over the context element.\r
+* @method onContextMouseMove\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseMove = function(e, obj) {\r
        obj.pageX = YAHOO.util.Event.getPageX(e);\r
        obj.pageY = YAHOO.util.Event.getPageY(e);\r
 \r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the user mouses over the context element.\r
+* @method onContextMouseOver\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {\r
 \r
@@ -2407,7 +2798,7 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
                clearTimeout(obj.hideProcId);\r
                obj.hideProcId = null;\r
        }\r
-       \r
+\r
        var context = this;\r
        YAHOO.util.Event.addListener(context, "mousemove", obj.onContextMouseMove, obj);\r
 \r
@@ -2421,12 +2812,13 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
        * @type int\r
        */\r
        obj.showProcId = obj.doShow(e, context);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the user mouses out of the context element.\r
+* @method onContextMouseOut\r
 * @param {DOMEvent} e  The current DOM event\r
-* @param {object}      obj     The object argument\r
+* @param {Object}      obj     The object argument\r
 */\r
 YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {\r
        var el = this;\r
@@ -2435,7 +2827,7 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
                el.title = obj._tempTitle;\r
                obj._tempTitle = null;\r
        }\r
-       \r
+\r
        if (obj.showProcId) {\r
                clearTimeout(obj.showProcId);\r
                obj.showProcId = null;\r
@@ -2450,17 +2842,18 @@ YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
        obj.hideProcId = setTimeout(function() {\r
                                obj.hide();\r
                                }, obj.cfg.getProperty("hidedelay"));\r
-}\r
+};\r
 \r
 // END BUILT-IN DOM EVENT HANDLERS //\r
 \r
 /**\r
 * Processes the showing of the Tooltip by setting the timeout delay and offset of the Tooltip.\r
+* @method doShow\r
 * @param {DOMEvent} e  The current DOM event\r
-* @return {int}        The process ID of the timeout function associated with doShow\r
+* @return {Number}     The process ID of the timeout function associated with doShow\r
 */\r
 YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {\r
-       \r
+\r
        var yOffset = 25;\r
        if (this.browser == "opera" && context.tagName == "A") {\r
                yOffset += 12;\r
@@ -2479,17 +2872,18 @@ YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
                        if (me.cfg.getProperty("preventoverlap")) {\r
                                me.preventOverlap(me.pageX, me.pageY);\r
                        }\r
-                       \r
+\r
                        YAHOO.util.Event.removeListener(context, "mousemove", me.onContextMouseMove);\r
 \r
                        me.show();\r
                        me.hideProcId = me.doHide();\r
                },\r
        this.cfg.getProperty("showdelay"));\r
-}\r
+};\r
 \r
 /**\r
 * Sets the timeout for the auto-dismiss delay, which by default is 5 seconds, meaning that a tooltip will automatically dismiss itself after 5 seconds of being displayed.\r
+* @method doHide\r
 */\r
 YAHOO.widget.Tooltip.prototype.doHide = function() {\r
        var me = this;\r
@@ -2498,15 +2892,18 @@ YAHOO.widget.Tooltip.prototype.doHide = function() {
                        me.hide();\r
                },\r
                this.cfg.getProperty("autodismissdelay"));\r
-}\r
+};\r
 \r
 /**\r
 * Fired when the Tooltip is moved, this event handler is used to prevent the Tooltip from overlapping with its context element.\r
+* @method preventOverlay\r
+* @param {Number} pageX        The x coordinate position of the mouse pointer\r
+* @param {Number} pageY        The y coordinate position of the mouse pointer\r
 */\r
 YAHOO.widget.Tooltip.prototype.preventOverlap = function(pageX, pageY) {\r
-       \r
+\r
        var height = this.element.offsetHeight;\r
-       \r
+\r
        var elementRegion = YAHOO.util.Dom.getRegion(this.element);\r
 \r
        elementRegion.top -= 5;\r
@@ -2515,79 +2912,71 @@ YAHOO.widget.Tooltip.prototype.preventOverlap = function(pageX, pageY) {
        elementRegion.bottom += 5;\r
 \r
        var mousePoint = new YAHOO.util.Point(pageX, pageY);\r
-       \r
+\r
        if (elementRegion.contains(mousePoint)) {\r
-               this.logger.log("OVERLAP", "warn");\r
-               this.cfg.setProperty("y", (pageY-height-5))\r
+               this.cfg.setProperty("y", (pageY-height-5));\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the Tooltip\r
+*/\r
 YAHOO.widget.Tooltip.prototype.toString = function() {\r
        return "Tooltip " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * Panel is an implementation of Overlay that behaves like an OS window, with a draggable header and an optional close icon at the top right.\r
-* @param {string}      el      The element ID representing the Panel <em>OR</em>\r
-* @param {Element}     el      The element representing the Panel\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Panel\r
+* @extends YAHOO.widget.Overlay\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Panel <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Panel\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Panel = function(el, userConfig) {\r
        YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Panel, YAHOO.widget.Overlay);\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Panel\r
-* @type string\r
+* @property YAHOO.widget.Panel.CSS_PANEL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Panel.CSS_PANEL = "panel";\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Panel's wrapping container\r
-* @type string\r
+* @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Panel.CSS_PANEL_CONTAINER = "panel-container";\r
 \r
-/**\r
-* CustomEvent fired after the modality mask is shown\r
-* args: none\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Panel.prototype.showMaskEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after the modality mask is hidden\r
-* args: none\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Panel.prototype.hideMaskEvent = null;\r
-\r
 /**\r
 * The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Panel.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.Panel.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
+\r
        this.beforeInitEvent.fire(YAHOO.widget.Panel);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Panel.CSS_PANEL);\r
 \r
-       this.buildWrapper();                    \r
-       \r
+       this.buildWrapper();\r
+\r
        if (userConfig) {\r
                this.cfg.applyConfig(userConfig, true);\r
        }\r
@@ -2601,9 +2990,36 @@ YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
                }\r
        }, this, true);\r
 \r
-       this.initEvent.fire(YAHOO.widget.Panel);\r
+       var me = this;\r
 \r
-}\r
+       this.showMaskEvent.subscribe(function() {\r
+               var checkFocusable = function(el) {\r
+                       if (el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") {\r
+                               if (! YAHOO.util.Dom.isAncestor(me.element, el)) {\r
+                                       YAHOO.util.Event.addListener(el, "focus", el.blur);\r
+                                       return true;\r
+                               }\r
+                       } else {\r
+                               return false;\r
+                       }\r
+               };\r
+\r
+               this.focusableElements = YAHOO.util.Dom.getElementsBy(checkFocusable);\r
+       }, this, true);\r
+\r
+       this.hideMaskEvent.subscribe(function() {\r
+               for (var i=0;i<this.focusableElements.length;i++) {\r
+                       var el2 = this.focusableElements[i];\r
+                       YAHOO.util.Event.removeListener(el2, "focus", el2.blur);\r
+               }\r
+       }, this, true);\r
+\r
+       this.beforeShowEvent.subscribe(function() {\r
+               this.cfg.refireEvent("underlay");\r
+       }, this, true);\r
+\r
+       this.initEvent.fire(YAHOO.widget.Panel);\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
@@ -2611,40 +3027,90 @@ YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
 YAHOO.widget.Panel.prototype.initEvents = function() {\r
        YAHOO.widget.Panel.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired after the modality mask is shown\r
+       * @event showMaskEvent\r
+       */\r
        this.showMaskEvent = new YAHOO.util.CustomEvent("showMask");\r
+\r
+       /**\r
+       * CustomEvent fired after the modality mask is hidden\r
+       * @event hideMaskEvent\r
+       */\r
        this.hideMaskEvent = new YAHOO.util.CustomEvent("hideMask");\r
 \r
+       /**\r
+       * CustomEvent when the Panel is dragged\r
+       * @event dragEvent\r
+       */\r
        this.dragEvent = new YAHOO.util.CustomEvent("drag");\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Panel's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Panel.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);\r
 \r
        // Add panel config properties //\r
 \r
+       /**\r
+       * True if the Panel should display a "close" button\r
+       * @config close\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("close", { value:true, handler:this.configClose, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
+\r
+       /**\r
+       * True if the Panel should be draggable\r
+       * @config draggable\r
+       * @type Boolean\r
+       * @default true\r
+       */\r
        this.cfg.addProperty("draggable", { value:true, handler:this.configDraggable, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
 \r
+       /**\r
+       * Sets the type of underlay to display for the Panel. Valid values are "shadow", "matte", and "none".\r
+       * @config underlay\r
+       * @type String\r
+       * @default shadow\r
+       */\r
        this.cfg.addProperty("underlay", { value:"shadow", handler:this.configUnderlay, supercedes:["visible"] } );\r
+\r
+       /**\r
+       * True if the Panel should be displayed in a modal fashion, automatically creating a transparent mask over the document that will not be removed until the Panel is dismissed.\r
+       * @config modal\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("modal",   { value:false, handler:this.configModal, validator:this.cfg.checkBoolean, supercedes:["visible"] } );\r
 \r
+       /**\r
+       * A KeyListener (or array of KeyListeners) that will be enabled when the Panel is shown, and disabled when the Panel is hidden.\r
+       * @config keylisteners\r
+       * @type YAHOO.util.KeyListener[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("keylisteners", { handler:this.configKeyListeners, suppressEvent:true, supercedes:["visible"] } );\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "close" property is changed. The method controls the appending or hiding of the close icon at the top right of the Panel.\r
+* @method configClose\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        var doHide = function(e, obj) {\r
                obj.hide();\r
-       }\r
+       };\r
 \r
        if (val) {\r
                if (! this.close) {\r
@@ -2659,7 +3125,7 @@ YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {
 \r
                        this.close.innerHTML = "&nbsp;";\r
                        this.innerElement.appendChild(this.close);\r
-                       YAHOO.util.Event.addListener(this.close, "click", doHide, this);        \r
+                       YAHOO.util.Event.addListener(this.close, "click", doHide, this);\r
                } else {\r
                        this.close.style.display = "block";\r
                }\r
@@ -2668,10 +3134,14 @@ YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {
                        this.close.style.display = "none";\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "draggable" property is changed.\r
+* @method configDraggable\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configDraggable = function(type, args, obj) {\r
        var val = args[0];\r
@@ -2688,10 +3158,14 @@ YAHOO.widget.Panel.prototype.configDraggable = function(type, args, obj) {
                        YAHOO.util.Dom.setStyle(this.header,"cursor","auto");\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "underlay" property is changed.\r
+* @method configUnderlay\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {\r
        var val = args[0];\r
@@ -2706,7 +3180,7 @@ YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {
                                this.underlay.className = "underlay";\r
                                this.underlay.innerHTML = "&nbsp;";\r
                                this.element.appendChild(this.underlay);\r
-                       } \r
+                       }\r
 \r
                        this.sizeUnderlay();\r
                        break;\r
@@ -2714,16 +3188,19 @@ YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {
                        YAHOO.util.Dom.removeClass(this.element, "shadow");\r
                        YAHOO.util.Dom.addClass(this.element, "matte");\r
                        break;\r
-               case "none":\r
                default:\r
                        YAHOO.util.Dom.removeClass(this.element, "shadow");\r
                        YAHOO.util.Dom.removeClass(this.element, "matte");\r
                        break;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "modal" property is changed. This handler subscribes or unsubscribes to the show and hide events to handle the display or hide of the modality mask.\r
+* @method configModal\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {\r
        var modal = args[0];\r
@@ -2731,8 +3208,8 @@ YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {
        if (modal) {\r
                this.buildMask();\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed( this.showEvent, this.showMask, this ) ) {\r
-                       this.showEvent.subscribe(this.showMask, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed( this.beforeShowEvent, this.showMask, this ) ) {\r
+                       this.beforeShowEvent.subscribe(this.showMask, this, true);\r
                }\r
                if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {\r
                        this.hideEvent.subscribe(this.hideMask, this, true);\r
@@ -2740,19 +3217,38 @@ YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {
                if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowScrollEvent, this.sizeMask, this ) ) {\r
-                       YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.sizeMask, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {\r
+                       this.destroyEvent.subscribe(this.removeMask, this, true);\r
                }\r
+\r
+               this.cfg.refireEvent("zIndex");\r
        } else {\r
                this.beforeShowEvent.unsubscribe(this.showMask, this);\r
                this.hideEvent.unsubscribe(this.hideMask, this);\r
-               YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);\r
-               YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.sizeMask);\r
+               YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);\r
+               this.destroyEvent.unsubscribe(this.removeMask, this);\r
        }\r
-}\r
+};\r
+\r
+/**\r
+* Removes the modality mask.\r
+* @method removeMask\r
+*/\r
+YAHOO.widget.Panel.prototype.removeMask = function() {\r
+       if (this.mask) {\r
+               if (this.mask.parentNode) {\r
+                       this.mask.parentNode.removeChild(this.mask);\r
+               }\r
+               this.mask = null;\r
+       }\r
+};\r
 \r
 /**\r
-* The default event handler fired when the "keylisteners" property is changed. \r
+* The default event handler fired when the "keylisteners" property is changed.\r
+* @method configKeyListeners\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Panel.prototype.configKeyListeners = function(type, args, obj) {\r
        var listeners = args[0];\r
@@ -2771,81 +3267,119 @@ YAHOO.widget.Panel.prototype.configKeyListeners = function(type, args, obj) {
                                }\r
                        }\r
                } else {\r
-                       if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) {\r
-                               this.showEvent.subscribe(listeners.enable, listeners, true);\r
-                       }\r
-                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {\r
-                               this.hideEvent.subscribe(listeners.disable, listeners, true);\r
-                               this.destroyEvent.subscribe(listeners.disable, listeners, true); \r
-                       }\r
+                       if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) {\r
+                               this.showEvent.subscribe(listeners.enable, listeners, true);\r
+                       }\r
+                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {\r
+                               this.hideEvent.subscribe(listeners.disable, listeners, true);\r
+                               this.destroyEvent.subscribe(listeners.disable, listeners, true);\r
+                       }\r
+               }\r
+       }\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configHeight = function(type, args, obj) {\r
+       var height = args[0];\r
+       var el = this.innerElement;\r
+       YAHOO.util.Dom.setStyle(el, "height", height);\r
+       this.cfg.refireEvent("underlay");\r
+       this.cfg.refireEvent("iframe");\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configWidth = function(type, args, obj) {\r
+       var width = args[0];\r
+       var el = this.innerElement;\r
+       YAHOO.util.Dom.setStyle(el, "width", width);\r
+       this.cfg.refireEvent("underlay");\r
+       this.cfg.refireEvent("iframe");\r
+};\r
+\r
+/**\r
+* The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Panel.prototype.configzIndex = function(type, args, obj) {\r
+       YAHOO.widget.Panel.superclass.configzIndex.call(this, type, args, obj);\r
+\r
+       var maskZ = 0;\r
+       var currentZ = YAHOO.util.Dom.getStyle(this.element, "zIndex");\r
+\r
+       if (this.mask) {\r
+               if (! currentZ || isNaN(currentZ)) {\r
+                       currentZ = 0;\r
+               }\r
+\r
+               if (currentZ === 0) {\r
+                       this.cfg.setProperty("zIndex", 1);\r
+               } else {\r
+                       maskZ = currentZ - 1;\r
+                       YAHOO.util.Dom.setStyle(this.mask, "zIndex", maskZ);\r
                }\r
-       } \r
-}\r
 \r
-// END BUILT-IN PROPERTY EVENT HANDLERS //\r
+       }\r
+};\r
 \r
+// END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a  local instance variable called container, and the element is reinserted inside of it.\r
+* @method buildWrapper\r
 */\r
 YAHOO.widget.Panel.prototype.buildWrapper = function() {\r
        var elementParent = this.element.parentNode;\r
-\r
-       var elementClone = this.element.cloneNode(true);\r
-       this.innerElement = elementClone;\r
-       this.innerElement.style.visibility = "inherit";\r
-\r
-       YAHOO.util.Dom.addClass(this.innerElement, YAHOO.widget.Panel.CSS_PANEL);\r
+       var originalElement = this.element;\r
 \r
        var wrapper = document.createElement("DIV");\r
        wrapper.className = YAHOO.widget.Panel.CSS_PANEL_CONTAINER;\r
-       wrapper.id = elementClone.id + "_c";\r
-       \r
-       wrapper.appendChild(elementClone);\r
-       \r
+       wrapper.id = originalElement.id + "_c";\r
+\r
        if (elementParent) {\r
-               elementParent.replaceChild(wrapper, this.element);\r
+               elementParent.insertBefore(wrapper, originalElement);\r
        }\r
 \r
-       this.element = wrapper;\r
-\r
-       // Resynchronize the local field references\r
+       wrapper.appendChild(originalElement);\r
 \r
-       var childNodes = this.innerElement.childNodes;\r
-       if (childNodes) {\r
-               for (var i=0;i<childNodes.length;i++) {\r
-                       var child = childNodes[i];\r
-                       switch (child.className) {\r
-                               case YAHOO.widget.Module.CSS_HEADER:\r
-                                       this.header = child;\r
-                                       break;\r
-                               case YAHOO.widget.Module.CSS_BODY:\r
-                                       this.body = child;\r
-                                       break;\r
-                               case YAHOO.widget.Module.CSS_FOOTER:\r
-                                       this.footer = child;\r
-                                       break;\r
-                       }\r
-               }\r
-       }\r
+       this.element = wrapper;\r
+       this.innerElement = originalElement;\r
 \r
-       this.initDefaultConfig(); // We've changed the DOM, so the configuration must be re-tooled to get the DOM references right\r
-}\r
+       YAHOO.util.Dom.setStyle(this.innerElement, "visibility", "inherit");\r
+};\r
 \r
 /**\r
 * Adjusts the size of the shadow based on the size of the element.\r
+* @method sizeUnderlay\r
 */\r
 YAHOO.widget.Panel.prototype.sizeUnderlay = function() {\r
        if (this.underlay && this.browser != "gecko" && this.browser != "safari") {\r
                this.underlay.style.width = this.innerElement.offsetWidth + "px";\r
                this.underlay.style.height = this.innerElement.offsetHeight + "px";\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) { \r
+YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Panel.superclass.onDomResize.call(this, e, obj);\r
        var me = this;\r
        setTimeout(function() {\r
@@ -2855,6 +3389,7 @@ YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) {
 \r
 /**\r
 * Registers the Panel's header for drag & drop capability.\r
+* @method registerDragDrop\r
 */\r
 YAHOO.widget.Panel.prototype.registerDragDrop = function() {\r
        if (this.header) {\r
@@ -2863,7 +3398,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                if (! this.header.id) {\r
                        this.header.id = this.id + "_h";\r
                }\r
-               \r
+\r
                var me = this;\r
 \r
                this.dd.startDrag = function() {\r
@@ -2887,7 +3422,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
                                var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
 \r
-                               this.minX = leftConstraint\r
+                               this.minX = leftConstraint;\r
                                this.maxX = rightConstraint;\r
                                this.constrainX = true;\r
 \r
@@ -2900,8 +3435,8 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("startDrag", arguments);\r
-               }\r
-               \r
+               };\r
+\r
                this.dd.onDrag = function() {\r
                        me.syncPosition();\r
                        me.cfg.refireEvent("iframe");\r
@@ -2910,7 +3445,7 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("onDrag", arguments);\r
-               }\r
+               };\r
 \r
                this.dd.endDrag = function() {\r
                        if (me.browser == "ie") {\r
@@ -2918,17 +3453,18 @@ YAHOO.widget.Panel.prototype.registerDragDrop = function() {
                        }\r
 \r
                        me.dragEvent.fire("endDrag", arguments);\r
-               }\r
+               };\r
 \r
                this.dd.setHandleElId(this.header.id);\r
                this.dd.addInvalidHandleType("INPUT");\r
                this.dd.addInvalidHandleType("SELECT");\r
                this.dd.addInvalidHandleType("TEXTAREA");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Builds the mask that is laid over the document when the Panel is configured to be modal.\r
+* @method buildMask\r
 */\r
 YAHOO.widget.Panel.prototype.buildMask = function() {\r
        if (! this.mask) {\r
@@ -2939,16 +3475,20 @@ YAHOO.widget.Panel.prototype.buildMask = function() {
 \r
                var maskClick = function(e, obj) {\r
                        YAHOO.util.Event.stopEvent(e);\r
-               }\r
-\r
-               YAHOO.util.Event.addListener(this.mask, maskClick, this);\r
+               };\r
 \r
-               document.body.appendChild(this.mask);\r
+               var firstChild = document.body.firstChild;\r
+               if (firstChild) {\r
+                       document.body.insertBefore(this.mask, document.body.firstChild);\r
+               } else {\r
+                       document.body.appendChild(this.mask);\r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Hides the modality mask.\r
+* @method hideMask\r
 */\r
 YAHOO.widget.Panel.prototype.hideMask = function() {\r
        if (this.cfg.getProperty("modal") && this.mask) {\r
@@ -2956,10 +3496,11 @@ YAHOO.widget.Panel.prototype.hideMask = function() {
                this.hideMaskEvent.fire();\r
                YAHOO.util.Dom.removeClass(document.body, "masked");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Shows the modality mask.\r
+* @method showMask\r
 */\r
 YAHOO.widget.Panel.prototype.showMask = function() {\r
        if (this.cfg.getProperty("modal") && this.mask) {\r
@@ -2968,157 +3509,106 @@ YAHOO.widget.Panel.prototype.showMask = function() {
                this.mask.style.display = "block";\r
                this.showMaskEvent.fire();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the size of the modality mask to cover the entire scrollable area of the document\r
+* @method sizeMask\r
 */\r
 YAHOO.widget.Panel.prototype.sizeMask = function() {\r
        if (this.mask) {\r
                this.mask.style.height = YAHOO.util.Dom.getDocumentHeight()+"px";\r
                this.mask.style.width = YAHOO.util.Dom.getDocumentWidth()+"px";\r
        }\r
-}\r
-\r
-/**\r
-* The default event handler fired when the "height" property is changed.\r
-*/\r
-YAHOO.widget.Panel.prototype.configHeight = function(type, args, obj) {\r
-       var height = args[0];\r
-       var el = this.innerElement;\r
-       YAHOO.util.Dom.setStyle(el, "height", height);\r
-       this.cfg.refireEvent("underlay");\r
-       this.cfg.refireEvent("iframe");\r
-}\r
-\r
-/**\r
-* The default event handler fired when the "width" property is changed.\r
-*/\r
-YAHOO.widget.Panel.prototype.configWidth = function(type, args, obj) {\r
-       var width = args[0];\r
-       var el = this.innerElement;\r
-       YAHOO.util.Dom.setStyle(el, "width", width);\r
-       this.cfg.refireEvent("underlay");\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Renders the Panel by inserting the elements that are not already in the main Panel into their correct places. Optionally appends the Panel to the specified node prior to the render's execution. NOTE: For Panels 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.\r
-* @param {string}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-* @param {Element}     appendToNode    The element to which the Module should be appended to prior to rendering        \r
+* @method render\r
+* @param {String}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+* @param {HTMLElement} appendToNode    The element to which the Module should be appended to prior to rendering\r
 * @return {boolean} Success or failure of the render\r
 */\r
 YAHOO.widget.Panel.prototype.render = function(appendToNode) {\r
        return YAHOO.widget.Panel.superclass.render.call(this, appendToNode, this.innerElement);\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Panel.\r
+*/\r
 YAHOO.widget.Panel.prototype.toString = function() {\r
        return "Panel " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * 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.\r
-* @param {string}      el      The element ID representing the Dialog <em>OR</em>\r
-* @param {Element}     el      The element representing the Dialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class Dialog\r
+* @extends YAHOO.widget.Panel\r
 * @constructor\r
+* @param {String}      el      The element ID representing the Dialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Dialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Dialog = function(el, userConfig) {\r
        YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Dialog, YAHOO.widget.Panel);\r
 \r
 /**\r
 * Constant representing the default CSS class used for a Dialog\r
-* @type string\r
+* @property YAHOO.widget.Dialog.CSS_DIALOG\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Dialog.CSS_DIALOG = "dialog";\r
 \r
-\r
-/**\r
-* CustomEvent fired prior to submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.beforeSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.submitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to manual submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.manualSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to asynchronous submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.asyncSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired prior to form-based submission\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.formSubmitEvent = null;\r
-\r
-/**\r
-* CustomEvent fired after cancel\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Dialog.prototype.cancelEvent = null;\r
-\r
-\r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);\r
 \r
        /**\r
        * The internally maintained callback object for use with the Connection utility\r
-       * @type object\r
-       * @private\r
+       * @property callback\r
+       * @type Object\r
        */\r
        this.callback = {\r
+               /**\r
+               * The function to execute upon success of the Connection submission\r
+               * @property callback.success\r
+               * @type Function\r
+               */\r
                success : null,\r
+               /**\r
+               * The function to execute upon failure of the Connection submission\r
+               * @property callback.failure\r
+               * @type Function\r
+               */\r
                failure : null,\r
-               argument: null,\r
-               scope : this\r
-       }\r
-\r
-       this.doSubmit = function() {\r
-               var method = this.cfg.getProperty("postmethod");\r
-               switch (method) {\r
-                       case "async":\r
-                               YAHOO.util.Connect.setForm(this.form.name);\r
-                               var cObj = YAHOO.util.Connect.asyncRequest('POST', this.form.action, this.callback);\r
-                               this.asyncSubmitEvent.fire();\r
-                               break;\r
-                       case "form":\r
-                               this.form.submit();\r
-                               this.formSubmitEvent.fire();\r
-                               break;\r
-                       case "none":\r
-                       case "manual":\r
-                               this.manualSubmitEvent.fire();\r
-                               break;\r
-               }\r
-       }\r
+               /**\r
+               * The arbitraty argument or arguments to pass to the Connection callback functions\r
+               * @property callback.argument\r
+               * @type Object\r
+               */\r
+               argument: null\r
+       };\r
 \r
        // Add form dialog config properties //\r
-       this.cfg.addProperty("postmethod", { value:"async", validator:function(val) { \r
+\r
+       /**\r
+       * The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual".\r
+       * @config postmethod\r
+       * @type String\r
+       * @default async\r
+       */\r
+       this.cfg.addProperty("postmethod", { value:"async", validator:function(val) {\r
                                                                                                        if (val != "form" && val != "async" && val != "none" && val != "manual") {\r
                                                                                                                return false;\r
                                                                                                        } else {\r
@@ -3126,34 +3616,69 @@ YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {
                                                                                                        }\r
                                                                                                } });\r
 \r
+       /**\r
+       * Object literal(s) defining the buttons for the Dialog's footer.\r
+       * @config buttons\r
+       * @type Object[]\r
+       * @default "none"\r
+       */\r
        this.cfg.addProperty("buttons",         { value:"none", handler:this.configButtons } );\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Dialog.prototype.initEvents = function() {\r
        YAHOO.widget.Dialog.superclass.initEvents.call(this);\r
-       \r
+\r
+       /**\r
+       * CustomEvent fired prior to submission\r
+       * @event beforeSumitEvent\r
+       */\r
        this.beforeSubmitEvent  = new YAHOO.util.CustomEvent("beforeSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired after submission\r
+       * @event submitEvent\r
+       */\r
        this.submitEvent                = new YAHOO.util.CustomEvent("submit");\r
 \r
+       /**\r
+       * CustomEvent fired prior to manual submission\r
+       * @event manualSubmitEvent\r
+       */\r
        this.manualSubmitEvent  = new YAHOO.util.CustomEvent("manualSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired prior to asynchronous submission\r
+       * @event asyncSubmitEvent\r
+       */\r
        this.asyncSubmitEvent   = new YAHOO.util.CustomEvent("asyncSubmit");\r
+\r
+       /**\r
+       * CustomEvent fired prior to form-based submission\r
+       * @event formSubmitEvent\r
+       */\r
        this.formSubmitEvent    = new YAHOO.util.CustomEvent("formSubmit");\r
 \r
+       /**\r
+       * CustomEvent fired after cancel\r
+       * @event cancelEvent\r
+       */\r
        this.cancelEvent                = new YAHOO.util.CustomEvent("cancel");\r
-}\r
+};\r
 \r
 /**\r
 * The Dialog initialization method, which is executed for Dialog and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Dialog <em>OR</em>\r
-* @param {Element}     el      The element representing the Dialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Dialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Dialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.Dialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
+\r
        this.beforeInitEvent.fire(YAHOO.widget.Dialog);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Dialog.CSS_DIALOG);\r
@@ -3179,10 +3704,36 @@ YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {
        }, this, true);\r
 \r
        this.initEvent.fire(YAHOO.widget.Dialog);\r
-}\r
+};\r
+\r
+/**\r
+* Performs the submission of the Dialog form depending on the value of "postmethod" property.\r
+* @method doSubmit\r
+*/\r
+YAHOO.widget.Dialog.prototype.doSubmit = function() {\r
+       var pm = this.cfg.getProperty("postmethod");\r
+       switch (pm) {\r
+               case "async":\r
+                       var method = this.form.getAttribute("method") || 'POST';\r
+                       method = method.toUpperCase();\r
+                       YAHOO.util.Connect.setForm(this.form);\r
+                       var cObj = YAHOO.util.Connect.asyncRequest(method, this.form.getAttribute("action"), this.callback);\r
+                       this.asyncSubmitEvent.fire();\r
+                       break;\r
+               case "form":\r
+                       this.form.submit();\r
+                       this.formSubmitEvent.fire();\r
+                       break;\r
+               case "none":\r
+               case "manual":\r
+                       this.manualSubmitEvent.fire();\r
+                       break;\r
+       }\r
+};\r
 \r
 /**\r
 * Prepares the Dialog's internal FORM object, creating one if one is not currently present.\r
+* @method registerForm\r
 */\r
 YAHOO.widget.Dialog.prototype.registerForm = function() {\r
        var form = this.element.getElementsByTagName("FORM")[0];\r
@@ -3199,7 +3750,6 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        if (el.focus) {\r
                                if (el.type && el.type != "hidden") {\r
                                        return el;\r
-                                       break;\r
                                }\r
                        }\r
                }\r
@@ -3212,7 +3762,6 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        if (el.focus) {\r
                                if (el.type && el.type != "hidden") {\r
                                        return el;\r
-                                       break;\r
                                }\r
                        }\r
                }\r
@@ -3224,7 +3773,7 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
        if (this.cfg.getProperty("modal") && this.form) {\r
 \r
                var me = this;\r
-               \r
+\r
                var firstElement = this.firstFormElement || this.firstButton;\r
                if (firstElement) {\r
                        this.preventBackTab = new YAHOO.util.KeyListener(firstElement, { shift:true, keys:9 }, {fn:me.focusLast, scope:me, correctScope:true} );\r
@@ -3239,12 +3788,16 @@ YAHOO.widget.Dialog.prototype.registerForm = function() {
                        this.hideEvent.subscribe(this.preventTabOut.disable, this.preventTabOut, true);\r
                }\r
        }\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler for the "buttons" configuration property\r
+* @method configButtons\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {\r
        var buttons = args[0];\r
@@ -3257,6 +3810,7 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        var button = buttons[b];\r
 \r
                        var htmlButton = document.createElement("BUTTON");\r
+                       htmlButton.setAttribute("type", "button");\r
 \r
                        if (button.isDefault) {\r
                                htmlButton.className = "default";\r
@@ -3266,10 +3820,10 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        htmlButton.appendChild(document.createTextNode(button.text));\r
                        YAHOO.util.Event.addListener(htmlButton, "click", button.handler, this, true);\r
 \r
-                       this.buttonSpan.appendChild(htmlButton);                \r
+                       this.buttonSpan.appendChild(htmlButton);\r
                        button.htmlButton = htmlButton;\r
 \r
-                       if (b == 0) {\r
+                       if (b === 0) {\r
                                this.firstButton = button.htmlButton;\r
                        }\r
 \r
@@ -3290,30 +3844,17 @@ YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
                        }\r
 \r
                        this.buttonSpan = null;\r
-                       this.firstButtom = null;\r
+                       this.firstButton = null;\r
                        this.lastButton = null;\r
                        this.defaultHtmlButton = null;\r
                }\r
        }\r
-}\r
-\r
-/**\r
-* The default handler fired when the "success" property is changed. Used for asynchronous submission only.\r
-*/ \r
-YAHOO.widget.Dialog.prototype.configOnSuccess = function(type,args,obj){};\r
-\r
-/**\r
-* The default handler fired when the "failure" property is changed. Used for asynchronous submission only.\r
-*/ \r
-YAHOO.widget.Dialog.prototype.configOnFailure = function(type,args,obj){};\r
+};\r
 \r
-/**\r
-* Executes a submission of the form based on the value of the postmethod property.\r
-*/\r
-YAHOO.widget.Dialog.prototype.doSubmit = function() {};\r
 \r
 /**\r
 * The default event handler used to focus the first field of the form when the Dialog is shown.\r
+* @method focusFirst\r
 */\r
 YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {\r
        if (args) {\r
@@ -3328,10 +3869,11 @@ YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {
        } else {\r
                this.focusDefaultButton();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the last button in the button or form element in the Dialog\r
+* @method focusLast\r
 */\r
 YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {\r
        if (args) {\r
@@ -3349,19 +3891,21 @@ YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {
                        this.lastFormElement.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.\r
+* @method focusDefaultButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusDefaultButton = function() {\r
        if (this.defaultHtmlButton) {\r
                this.defaultHtmlButton.focus();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Blurs all the html buttons\r
+* @method blurButtons\r
 */\r
 YAHOO.widget.Dialog.prototype.blurButtons = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3371,10 +3915,11 @@ YAHOO.widget.Dialog.prototype.blurButtons = function() {
                        html.blur();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the first button in the button list\r
+* @method focusFirstButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusFirstButton = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3384,10 +3929,11 @@ YAHOO.widget.Dialog.prototype.focusFirstButton = function() {
                        html.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Sets the focus to the first button in the button list\r
+* @method focusLastButton\r
 */\r
 YAHOO.widget.Dialog.prototype.focusLastButton = function() {\r
        var buttons = this.cfg.getProperty("buttons");\r
@@ -3397,19 +3943,21 @@ YAHOO.widget.Dialog.prototype.focusLastButton = function() {
                        html.focus();\r
                }\r
        }\r
-}\r
+};\r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Built-in function hook for writing a validation function that will be checked for a "true" value prior to a submit. This function, as implemented by default, always returns true, so it should be overridden if validation is necessary.\r
+* @method validate\r
 */\r
 YAHOO.widget.Dialog.prototype.validate = function() {\r
        return true;\r
-}\r
+};\r
 \r
 /**\r
 * Executes a submit of the Dialog followed by a hide, if validation is successful.\r
+* @method submit\r
 */\r
 YAHOO.widget.Dialog.prototype.submit = function() {\r
        if (this.validate()) {\r
@@ -3421,19 +3969,21 @@ YAHOO.widget.Dialog.prototype.submit = function() {
        } else {\r
                return false;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Executes the cancel of the Dialog followed by a hide.\r
+* @method cancel\r
 */\r
 YAHOO.widget.Dialog.prototype.cancel = function() {\r
        this.cancelEvent.fire();\r
-       this.hide();    \r
-}\r
+       this.hide();\r
+};\r
 \r
 /**\r
 * Returns a JSON-compatible data structure representing the data currently contained in the form.\r
-* @return {object} A JSON object reprsenting the data of the current form.\r
+* @method getData\r
+* @return {Object} A JSON object reprsenting the data of the current form.\r
 */\r
 YAHOO.widget.Dialog.prototype.getData = function() {\r
        var form = this.form;\r
@@ -3447,7 +3997,7 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                        switch (formItem.tagName) {\r
                                                case "INPUT":\r
                                                        switch (formItem.type) {\r
-                                                               case "checkbox": \r
+                                                               case "checkbox":\r
                                                                        data[i] = formItem.checked;\r
                                                                        break;\r
                                                                case "textbox":\r
@@ -3461,12 +4011,12 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                                        data[i] = formItem.value;\r
                                                        break;\r
                                                case "SELECT":\r
-                                                       var val = new Array();\r
+                                                       var val = [];\r
                                                        for (var x=0;x<formItem.options.length;x++)     {\r
                                                                var option = formItem.options[x];\r
                                                                if (option.selected) {\r
                                                                        var selval = option.value;\r
-                                                                       if (! selval || selval == "") {\r
+                                                                       if (! selval || selval === "") {\r
                                                                                selval = option.text;\r
                                                                        }\r
                                                                        val[val.length] = selval;\r
@@ -3476,126 +4026,157 @@ YAHOO.widget.Dialog.prototype.getData = function() {
                                                        break;\r
                                        }\r
                                } else if (formItem[0] && formItem[0].tagName) { // this is an array of form items\r
-                                       switch (formItem[0].tagName) {\r
-                                               case "INPUT" :\r
-                                                       switch (formItem[0].type) {\r
-                                                               case "radio":\r
-                                                                       for (var r=0; r<formItem.length; r++) {\r
-                                                                               var radio = formItem[r];\r
-                                                                               if (radio.checked) {\r
-                                                                                       data[radio.name] = radio.value;\r
-                                                                                       break;\r
-                                                                               }\r
+                                       if (formItem[0].tagName == "INPUT") {\r
+                                               switch (formItem[0].type) {\r
+                                                       case "radio":\r
+                                                               for (var r=0; r<formItem.length; r++) {\r
+                                                                       var radio = formItem[r];\r
+                                                                       if (radio.checked) {\r
+                                                                               data[radio.name] = radio.value;\r
+                                                                               break;\r
                                                                        }\r
-                                                                       break;\r
-                                                               case "checkbox":\r
-                                                                       var cbArray = new Array();\r
-                                                                       for (var c=0; c<formItem.length; c++) {\r
-                                                                               var check = formItem[c];\r
-                                                                               if (check.checked) {\r
-                                                                                       cbArray[cbArray.length] = check.value;\r
-                                                                               }\r
+                                                               }\r
+                                                               break;\r
+                                                       case "checkbox":\r
+                                                               var cbArray = [];\r
+                                                               for (var c=0; c<formItem.length; c++) {\r
+                                                                       var check = formItem[c];\r
+                                                                       if (check.checked) {\r
+                                                                               cbArray[cbArray.length] = check.value;\r
                                                                        }\r
-                                                                       data[formItem[0].name] = cbArray;\r
-                                                                       break;\r
-                                                       }\r
+                                                               }\r
+                                                               data[formItem[0].name] = cbArray;\r
+                                                               break;\r
+                                               }\r
                                        }\r
                                }\r
                        }\r
-               }       \r
+               }\r
        }\r
        return data;\r
-}\r
+};\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the Dialog\r
+*/\r
 YAHOO.widget.Dialog.prototype.toString = function() {\r
        return "Dialog " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * SimpleDialog is a simple implementation of Dialog that can be used to submit a single value. Forms can be processed in 3 ways -- via an asynchronous Connection utility call, a simple form POST or GET, or manually.\r
-* @param {string}      el      The element ID representing the SimpleDialog <em>OR</em>\r
-* @param {Element}     el      The element representing the SimpleDialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
+* @namespace YAHOO.widget\r
+* @class SimpleDialog\r
+* @extends YAHOO.widget.Dialog\r
 * @constructor\r
+* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the SimpleDialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.SimpleDialog = function(el, userConfig) {\r
        YAHOO.widget.SimpleDialog.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.SimpleDialog, YAHOO.widget.Dialog);\r
 \r
 /**\r
 * Constant for the standard network icon for a blocking action\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_BLOCK\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_BLOCK = "nt/ic/ut/bsc/blck16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for alarm\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_ALARM\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_ALARM = "nt/ic/ut/bsc/alrt16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for help\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_HELP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_HELP  = "nt/ic/ut/bsc/hlp16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for info\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_INFO\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_INFO  = "nt/ic/ut/bsc/info16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for warn\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_WARN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_WARN  = "nt/ic/ut/bsc/warn16_1.gif";\r
 \r
 /**\r
 * Constant for the standard network icon for a tip\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.ICON_TIP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.ICON_TIP   = "nt/ic/ut/bsc/tip16_1.gif";\r
 \r
 /**\r
 * Constant representing the default CSS class used for a SimpleDialog\r
-* @type string\r
+* @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG = "simple-dialog";\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the SimpleDialog's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);\r
 \r
        // Add dialog config properties //\r
+\r
+       /**\r
+       * Sets the informational icon for the SimpleDialog\r
+       * @config icon\r
+       * @type String\r
+       * @default "none"\r
+       */\r
        this.cfg.addProperty("icon",    { value:"none", handler:this.configIcon, suppressEvent:true } );\r
+\r
+       /**\r
+       * Sets the text for the SimpleDialog\r
+       * @config text\r
+       * @type String\r
+       * @default ""\r
+       */\r
        this.cfg.addProperty("text",    { value:"", handler:this.configText, suppressEvent:true, supercedes:["icon"] } );\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The SimpleDialog initialization method, which is executed for SimpleDialog and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the SimpleDialog <em>OR</em>\r
-* @param {Element}     el      The element representing the SimpleDialog\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
+* @method init\r
+* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the SimpleDialog\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {\r
        YAHOO.widget.SimpleDialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
@@ -3618,19 +4199,24 @@ YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {
 \r
        this.initEvent.fire(YAHOO.widget.SimpleDialog);\r
 \r
-}\r
+};\r
 /**\r
 * Prepares the SimpleDialog's internal FORM object, creating one if one is not currently present, and adding the value hidden field.\r
+* @method registerForm\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.registerForm = function() {\r
        YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);\r
        this.form.innerHTML += "<input type=\"hidden\" name=\"" + this.id + "\" value=\"\"/>";\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Fired when the "icon" property is set.\r
+* @method configIcon\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.configIcon = function(type,args,obj) {\r
        var icon = args[0];\r
@@ -3638,10 +4224,14 @@ YAHOO.widget.SimpleDialog.prototype.configIcon = function(type,args,obj) {
                var iconHTML = "<img src=\"" + this.imageRoot + icon + "\" class=\"icon\" />";\r
                this.body.innerHTML = iconHTML + this.body.innerHTML;\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Fired when the "text" property is set.\r
+* @method configText\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {\r
        var text = args[0];\r
@@ -3649,27 +4239,28 @@ YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {
                this.setBody(text);\r
                this.cfg.refireEvent("icon");\r
        }\r
-}\r
+};\r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the SimpleDialog\r
+*/\r
 YAHOO.widget.SimpleDialog.prototype.toString = function() {\r
        return "SimpleDialog " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
+};\r
+\r
+/**\r
 * ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.\r
-* @param {Overlay}     overlay         The Overlay that the animation should be associated with\r
-* @param {object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(float), and method(i.e. YAHOO.util.Easing.easeIn).\r
-* @param {object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(float), and method(i.e. YAHOO.util.Easing.easeIn).\r
-* @param {Element}     targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
+* @namespace YAHOO.widget\r
+* @class ContainerEffect\r
 * @constructor\r
+* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with\r
+* @param {Object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {Object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
+* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
 */\r
 YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {\r
        if (! animClass) {\r
@@ -3678,28 +4269,39 @@ YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement,
 \r
        /**\r
        * The overlay to animate\r
+       * @property overlay\r
+       * @type YAHOO.widget.Overlay\r
        */\r
        this.overlay = overlay;\r
        /**\r
        * The animation attributes to use when transitioning into view\r
+       * @property attrIn\r
+       * @type Object\r
        */\r
        this.attrIn = attrIn;\r
        /**\r
        * The animation attributes to use when transitioning out of view\r
+       * @property attrOut\r
+       * @type Object\r
        */\r
        this.attrOut = attrOut;\r
        /**\r
        * The target element to be animated\r
+       * @property targetElement\r
+       * @type HTMLElement\r
        */\r
        this.targetElement = targetElement || overlay.element;\r
        /**\r
        * The animation class to use for animating the overlay\r
+       * @property animClass\r
+       * @type class\r
        */\r
        this.animClass = animClass;\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the animation classes and events.\r
+* @method init\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.init = function() {\r
        this.beforeAnimateInEvent = new YAHOO.util.CustomEvent("beforeAnimateIn");\r
@@ -3717,74 +4319,103 @@ YAHOO.widget.ContainerEffect.prototype.init = function() {
        this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);\r
        this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);\r
        this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, this);\r
-}\r
+};\r
 \r
 /**\r
 * Triggers the in-animation.\r
+* @method animateIn\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.animateIn = function() {\r
        this.beforeAnimateInEvent.fire();\r
        this.animIn.animate();\r
-}\r
+};\r
 \r
 /**\r
 * Triggers the out-animation.\r
+* @method animateOut\r
 */\r
 YAHOO.widget.ContainerEffect.prototype.animateOut = function() {\r
        this.beforeAnimateOutEvent.fire();\r
        this.animOut.animate();\r
-}\r
+};\r
 \r
 /**\r
 * The default onStart handler for the in-animation.\r
+* @method handleStartAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };\r
 /**\r
 * The default onTween handler for the in-animation.\r
+* @method handleTweenAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };\r
 /**\r
 * The default onComplete handler for the in-animation.\r
+* @method handleCompleteAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };\r
 \r
 /**\r
 * The default onStart handler for the out-animation.\r
+* @method handleStartAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };\r
 /**\r
 * The default onTween handler for the out-animation.\r
+* @method handleTweenAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };\r
 /**\r
 * The default onComplete handler for the out-animation.\r
+* @method handleCompleteAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { }\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };\r
 \r
 /**\r
 * Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* @method toString\r
+* @return {String}     The string representation of the ContainerEffect\r
+*/\r
 YAHOO.widget.ContainerEffect.prototype.toString = function() {\r
        var output = "ContainerEffect";\r
        if (this.overlay) {\r
                output += " [" + this.overlay.toString() + "]";\r
        }\r
        return output;\r
-}\r
+};\r
 \r
 /**\r
 * A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
+* @method FADE\r
+* @static\r
 * @param {Overlay}     The Overlay object to animate\r
-* @param {float}       The duration of the animation\r
-* @type ContainerEffect\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
 */\r
 YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
        var fade = new YAHOO.widget.ContainerEffect(overlay, { attributes:{opacity: {from:0, to:1}}, duration:dur, method:YAHOO.util.Easing.easeIn }, { attributes:{opacity: {to:0}}, duration:dur, method:YAHOO.util.Easing.easeOut}, overlay.element );\r
 \r
        fade.handleStartAnimateIn = function(type,args,obj) {\r
                YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
-               \r
+\r
                if (! obj.overlay.underlay) {\r
                        obj.overlay.cfg.refireEvent("underlay");\r
                }\r
@@ -3794,24 +4425,24 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
                        obj.overlay.underlay.style.filter = null;\r
                }\r
 \r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible"); \r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
                YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 0);\r
-       }\r
+       };\r
 \r
        fade.handleCompleteAnimateIn = function(type,args,obj) {\r
                YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
 \r
                if (obj.overlay.element.style.filter) {\r
                        obj.overlay.element.style.filter = null;\r
-               }                       \r
-               \r
+               }\r
+\r
                if (obj.overlay.underlay) {\r
                        YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);\r
                }\r
 \r
                obj.overlay.cfg.refireEvent("iframe");\r
                obj.animateInCompleteEvent.fire();\r
-       }\r
+       };\r
 \r
        fade.handleStartAnimateOut = function(type, args, obj) {\r
                YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
@@ -3819,20 +4450,20 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
                if (obj.overlay.underlay) {\r
                        obj.overlay.underlay.style.filter = null;\r
                }\r
-       }\r
+       };\r
 \r
-       fade.handleCompleteAnimateOut =  function(type, args, obj) { \r
+       fade.handleCompleteAnimateOut =  function(type, args, obj) {\r
                YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
                if (obj.overlay.element.style.filter) {\r
                        obj.overlay.element.style.filter = null;\r
-               }                               \r
+               }\r
                YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1); \r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1);\r
 \r
                obj.overlay.cfg.refireEvent("iframe");\r
 \r
                obj.animateOutCompleteEvent.fire();\r
-       };      \r
+       };\r
 \r
        fade.init();\r
        return fade;\r
@@ -3841,9 +4472,11 @@ YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
 \r
 /**\r
 * A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
+* @method SLIDE\r
+* @static\r
 * @param {Overlay}     The Overlay object to animate\r
-* @param {float}       The duration of the animation\r
-* @type ContainerEffect\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
 */\r
 YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
        var x = overlay.cfg.getProperty("x") || YAHOO.util.Dom.getX(overlay.element);\r
@@ -3852,25 +4485,25 @@ YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {
        var clientWidth = YAHOO.util.Dom.getClientWidth();\r
        var offsetWidth = overlay.element.offsetWidth;\r
 \r
-       var slide = new YAHOO.widget.ContainerEffect(overlay, { \r
-                                                                                                                       attributes:{ points: { to:[x, y] } }, \r
-                                                                                                                       duration:dur, \r
-                                                                                                                       method:YAHOO.util.Easing.easeIn \r
-                                                                                                               }, \r
-                                                                                                               { \r
+       var slide = new YAHOO.widget.ContainerEffect(overlay, {\r
+                                                                                                                       attributes:{ points: { to:[x, y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeIn\r
+                                                                                                               },\r
+                                                                                                               {\r
                                                                                                                        attributes:{ points: { to:[(clientWidth+25), y] } },\r
-                                                                                                                       duration:dur, \r
+                                                                                                                       duration:dur,\r
                                                                                                                        method:YAHOO.util.Easing.easeOut\r
                                                                                                                },\r
                                                                                                                overlay.element,\r
-                                                                                                               YAHOO.util.Motion\r
-                                                                                               );\r
+                                                                                                               YAHOO.util.Motion);\r
+\r
 \r
        slide.handleStartAnimateIn = function(type,args,obj) {\r
                obj.overlay.element.style.left = (-25-offsetWidth) + "px";\r
                obj.overlay.element.style.top  = y + "px";\r
-       }\r
-       \r
+       };\r
+\r
        slide.handleTweenAnimateIn = function(type, args, obj) {\r
 \r
 \r
@@ -3885,46 +4518,44 @@ YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {
 \r
                obj.overlay.cfg.setProperty("xy", [currentX,currentY], true);\r
                obj.overlay.cfg.refireEvent("iframe");\r
-       }\r
-       \r
+       };\r
+\r
        slide.handleCompleteAnimateIn = function(type, args, obj) {\r
                obj.overlay.cfg.setProperty("xy", [x,y], true);\r
                obj.startX = x;\r
                obj.startY = y;\r
                obj.overlay.cfg.refireEvent("iframe");\r
                obj.animateInCompleteEvent.fire();\r
-       }\r
+       };\r
 \r
        slide.handleStartAnimateOut = function(type, args, obj) {\r
-               var clientWidth = YAHOO.util.Dom.getViewportWidth();\r
-               \r
+               var vw = YAHOO.util.Dom.getViewportWidth();\r
+\r
                var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
 \r
-               var x = pos[0];\r
-               var y = pos[1];\r
+               var yso = pos[1];\r
 \r
                var currentTo = obj.animOut.attributes.points.to;\r
-               obj.animOut.attributes.points.to = [(clientWidth+25), y];\r
-       }\r
+               obj.animOut.attributes.points.to = [(vw+25), yso];\r
+       };\r
 \r
        slide.handleTweenAnimateOut = function(type, args, obj) {\r
                var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
 \r
-               var x = pos[0];\r
-               var y = pos[1];\r
+               var xto = pos[0];\r
+               var yto = pos[1];\r
 \r
-               obj.overlay.cfg.setProperty("xy", [x,y], true);\r
+               obj.overlay.cfg.setProperty("xy", [xto,yto], true);\r
                obj.overlay.cfg.refireEvent("iframe");\r
-       }\r
+       };\r
 \r
-       slide.handleCompleteAnimateOut = function(type, args, obj) { \r
-               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");           \r
-               var offsetWidth = obj.overlay.element.offsetWidth;\r
+       slide.handleCompleteAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
 \r
                obj.overlay.cfg.setProperty("xy", [x,y]);\r
                obj.animateOutCompleteEvent.fire();\r
-       };      \r
+       };\r
 \r
        slide.init();\r
        return slide;\r
-}
\ No newline at end of file
+};
\ No newline at end of file
index 67d056d2777361d9a260a79d9d3eb313df4b6afc..82a5099b3794b57542a354627269870506c8736b 100755 (executable)
@@ -2,14 +2,14 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
 /**\r
-* @class \r
-* Config is a utility used within an object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
 * @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config = function(owner) {\r
        if (owner) {\r
@@ -17,119 +17,31 @@ YAHOO.util.Config = function(owner) {
        } else {\r
                YAHOO.log("No owner specified for Config object", "error");\r
        }\r
-}\r
+};\r
 \r
 YAHOO.util.Config.prototype = {\r
-       \r
-       /**\r
-       * Object reference to the owner of this Config object\r
-       * @type object\r
-       */\r
-       owner : null,\r
 \r
        /**\r
-       * Object reference to the owner of this Config object\r
-       * args: key, value\r
-       * @type YAHOO.util.CustomEvent\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
        */\r
-       configChangedEvent : null,\r
+       owner : null,\r
 \r
        /**\r
        * Boolean flag that specifies whether a queue is currently being executed\r
-       * @type boolean\r
+       * @property queueInProgress\r
+       * @type Boolean\r
        */\r
        queueInProgress : false,\r
 \r
-       /**\r
-       * Adds a property to the Config object's private config hash. \r
-       * @param {string}       key     The configuration property's name\r
-       * @param {object}       propertyObject  The object containing all of this property's arguments\r
-       */\r
-       addProperty : function(key, propertyObject){},\r
-\r
-       /**\r
-       * Returns a key-value configuration map of the values currently set in the Config object.\r
-       * @return {object} The current config, represented in a key-value map\r
-       */\r
-       getConfig : function(){},\r
-\r
-       /**\r
-       * Returns the value of specified property.\r
-       * @param {key}          The name of the property\r
-       * @return {object}      The value of the specified property\r
-       */\r
-       getProperty : function(key){},\r
-\r
-       /**\r
-       * Resets the specified property's value to its initial value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       resetProperty : function(key){},\r
-\r
-       /**\r
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @param {boolean}      Whether the value should be set silently, without firing the property event.\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */\r
-       setProperty : function(key,value,silent){},\r
-\r
-       /**\r
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
-       * moved from its current position to the end of the queue.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */      \r
-       queueProperty : function(key,value){},\r
-\r
-       /**\r
-       * Fires the event for a property using the property's current value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       refireEvent : function(key){},\r
-\r
-       /**\r
-       * Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.\r
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
-       * @param {object}       userConfig      The configuration object literal\r
-       * @param {boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
-       */\r
-       applyConfig : function(userConfig,init){},\r
-\r
-       /**\r
-       * Refires the events for all configuration properties using their current values.\r
-       */\r
-       refresh : function(){},\r
-\r
-       /**\r
-       * Fires the normalized list of queued property change events\r
-       */\r
-       fireQueue : function(){},\r
-\r
-       /**\r
-       * Subscribes an external handler to the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
-       * @param {boolean}      override        Optional. If true, will override "this" within the handler to map to the scope object passed into the method.\r
-       */      \r
-       subscribeToConfigEvent : function(key,handler,obj,override){},\r
 \r
        /**\r
-       * Unsubscribes an external handler from the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
-       unsubscribeFromConfigEvent: function(key,handler,obj){},\r
-\r
-       /**\r
-       * Validates that the value passed in is a boolean.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
-       */      \r
        checkBoolean: function(val) {\r
                if (typeof val == 'boolean') {\r
                        return true;\r
@@ -140,8 +52,9 @@ YAHOO.util.Config.prototype = {
 \r
        /**\r
        * Validates that the value passed in is a number.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
        checkNumber: function(val) {\r
                if (isNaN(val)) {\r
@@ -150,47 +63,81 @@ YAHOO.util.Config.prototype = {
                        return true;\r
                }\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
-* Initializes the configuration object and all of its local members.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config.prototype.init = function(owner) {\r
 \r
        this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
        this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
        this.queueInProgress = false;\r
 \r
        /* Private Members */\r
 \r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
        var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
        var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
        var eventQueue = [];\r
 \r
        /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
        * @private\r
-       * Fires a configuration property event using the specified value. \r
-       * @param {string}       key                     The configuration property's name\r
-       * @param {value}        object          The value of the correct type for the property\r
-       */ \r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
        var fireEvent = function( key, value ) {\r
                YAHOO.log("Firing Config event: " + key + "=" + value, "info");\r
-               \r
+\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
 \r
                if (typeof property != 'undefined' && property.event) {\r
                        property.event.fire(value);\r
-               }       \r
-       }\r
+               }\r
+       };\r
        /* End Private Members */\r
 \r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
        this.addProperty = function( key, propertyObject ) {\r
                key = key.toLowerCase();\r
-               \r
+\r
                YAHOO.log("Added property: " + key, "info");\r
 \r
                config[key] = propertyObject;\r
@@ -203,25 +150,36 @@ YAHOO.util.Config.prototype.init = function(owner) {
                }\r
 \r
                this.setProperty(key, propertyObject.value, true);\r
-               \r
+\r
                if (! propertyObject.suppressEvent) {\r
                        this.queueProperty(key, propertyObject.value);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
        this.getConfig = function() {\r
                var cfg = {};\r
-                       \r
+\r
                for (var prop in config) {\r
-                       var property = config[prop]\r
+                       var property = config[prop];\r
                        if (typeof property != 'undefined' && property.event) {\r
                                cfg[prop] = property.value;\r
                        }\r
                }\r
-               \r
+\r
                return cfg;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
        this.getProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -231,26 +189,43 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return undefined;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
        this.resetProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
                if (typeof property != 'undefined' && property.event) {\r
-                       this.setProperty(key, initialConfig[key].value);\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
                } else {\r
-                       return undefined;\r
+                       return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
        this.setProperty = function(key, value, silent) {\r
                key = key.toLowerCase();\r
-               \r
+\r
                YAHOO.log("setProperty: " + key + "=" + value, "info");\r
 \r
                if (this.queueInProgress && ! silent) {\r
-                       this.queueProperty(key,value); // Currently running through a queue... \r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
                        return true;\r
                } else {\r
                        var property = config[key];\r
@@ -269,15 +244,23 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                return false;\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
        this.queueProperty = function(key, value) {\r
                key = key.toLowerCase();\r
 \r
                YAHOO.log("queueProperty: " + key + "=" + value, "info");\r
 \r
                var property = config[key];\r
-                                                       \r
+\r
                if (typeof property != 'undefined' && property.event) {\r
                        if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
                                return false;\r
@@ -297,7 +280,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        if (queueItem) {\r
                                                var queueItemKey = queueItem[0];\r
                                                var queueItemValue = queueItem[1];\r
-                                               \r
+\r
                                                if (queueItemKey.toLowerCase() == key) {\r
                                                        // found a dupe... push to end of queue, null current item, and break\r
                                                        eventQueue[i] = null;\r
@@ -307,7 +290,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                }\r
                                        }\r
                                }\r
-                               \r
+\r
                                if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
                                        eventQueue.push([key, value]);\r
                                }\r
@@ -323,7 +306,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                if (queueItemCheck) {\r
                                                        var queueItemCheckKey = queueItemCheck[0];\r
                                                        var queueItemCheckValue = queueItemCheck[1];\r
-                                                       \r
+\r
                                                        if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
                                                                eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
                                                                eventQueue[q] = null;\r
@@ -333,15 +316,20 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        }\r
                                }\r
                        }\r
-       \r
+\r
                        YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");\r
 \r
                        return true;\r
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
        this.refireEvent = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -353,8 +341,15 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                fireEvent(key, property.value);\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
        this.applyConfig = function(userConfig, init) {\r
                if (init) {\r
                        initialConfig = userConfig;\r
@@ -362,14 +357,22 @@ YAHOO.util.Config.prototype.init = function(owner) {
                for (var prop in userConfig) {\r
                        this.queueProperty(prop, userConfig[prop]);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
        this.refresh = function() {\r
                for (var prop in config) {\r
                        this.refireEvent(prop);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
        this.fireQueue = function() {\r
                this.queueInProgress = true;\r
                for (var i=0;i<eventQueue.length;i++) {\r
@@ -377,18 +380,27 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        if (queueItem) {\r
                                var key = queueItem[0];\r
                                var value = queueItem[1];\r
-                               \r
+\r
                                var property = config[key];\r
                                property.value = value;\r
 \r
                                fireEvent(key,value);\r
                        }\r
                }\r
-               \r
+\r
                this.queueInProgress = false;\r
-               eventQueue = new Array();\r
-       }\r
+               eventQueue = [];\r
+       };\r
 \r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
        this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
                key = key.toLowerCase();\r
 \r
@@ -401,9 +413,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
-\r
+       };\r
 \r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
        this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
                key = key.toLowerCase();\r
 \r
@@ -413,16 +432,26 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
        this.toString = function() {\r
                var output = "Config";\r
                if (this.owner) {\r
                        output += " [" + this.owner.toString() + "]";\r
                }\r
                return output;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
        this.outputEventQueue = function() {\r
                var output = "";\r
                for (var q=0;q<eventQueue.length;q++) {\r
@@ -432,268 +461,265 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        }\r
                }\r
                return output;\r
-       }\r
-}\r
+       };\r
+};\r
 \r
 /**\r
-* Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
 * @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
 * @param {Function}    fn      The function to look for in the subscribers list\r
-* @param {object}      obj     The execution scope object for the subscription\r
-* @return {boolean}    true, if the function/object pair is already subscribed to the CustomEvent passed in\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
 YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
        for (var e=0;e<evt.subscribers.length;e++) {\r
                var subsc = evt.subscribers[e];\r
                if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
                        return true;\r
-                       break;\r
                }\r
        }\r
        return false;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class \r
+};\r
+\r
+/**\r
+*  The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
+* @module Container\r
+* @requires yahoo,dom,event,dragdrop,animation\r
+*/\r
+\r
+/**\r
 * Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @param {string}      el      The element ID representing the Module <em>OR</em>\r
-* @param {Element}     el      The element representing the Module\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+* @class Module\r
+* @namespace YAHOO.widget\r
 * @constructor\r
+* @param {String} el                   The element ID representing the Module <em>OR</em>\r
+* @param {HTMLElement} el              The element representing the Module\r
+* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Module = function(el, userConfig) {\r
-       if (el) { \r
-               this.init(el, userConfig); \r
+       if (el) {\r
+               this.init(el, userConfig);\r
        } else {\r
                YAHOO.log("No element or element ID specified for Module instantiation", "error");\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the prefix path to use for non-secure images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";\r
 \r
 /**\r
 * Constant representing the prefix path to use for securely served images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT_SSL\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";\r
 \r
 /**\r
 * Constant for the default CSS class name that represents a Module\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_MODULE\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_MODULE = "module";\r
 \r
 /**\r
 * Constant representing the module header\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_HEADER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_HEADER = "hd";\r
 \r
 /**\r
 * Constant representing the module body\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_BODY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_BODY = "bd";\r
 \r
 /**\r
 * Constant representing the module footer\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_FOOTER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_FOOTER = "ft";\r
 \r
 /**\r
 * Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size\r
-* @type string\r
+* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = null;\r
+YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
 \r
 YAHOO.widget.Module.prototype = {\r
 \r
        /**\r
        * The class's constructor function\r
-       * @type function\r
+       * @property contructor\r
+       * @type Function\r
        */\r
        constructor : YAHOO.widget.Module,\r
 \r
        /**\r
        * The main module element that contains the header, body, and footer\r
-       * @type Element\r
+       * @property element\r
+       * @type HTMLElement\r
        */\r
-       element : null, \r
+       element : null,\r
 \r
        /**\r
        * The header element, denoted with CSS class "hd"\r
-       * @type Element\r
+       * @property header\r
+       * @type HTMLElement\r
        */\r
        header : null,\r
 \r
        /**\r
        * The body element, denoted with CSS class "bd"\r
-       * @type Element\r
+       * @property body\r
+       * @type HTMLElement\r
        */\r
        body : null,\r
 \r
        /**\r
        * The footer element, denoted with CSS class "ft"\r
-       * @type Element\r
+       * @property footer\r
+       * @type HTMLElement\r
        */\r
        footer : null,\r
 \r
        /**\r
        * The id of the element\r
-       * @type string\r
+       * @property id\r
+       * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
-       * Array of elements\r
-       * @type Element[]\r
-       */\r
-       childNodesInDOM : null,\r
-\r
-       /**\r
-       * The string representing the image root\r
-       * @type string\r
+       * The String representing the image root\r
+       * @property imageRoot\r
+       * @type String\r
        */\r
        imageRoot : YAHOO.widget.Module.IMG_ROOT,\r
 \r
-       /**\r
-       * CustomEvent fired prior to class initalization.\r
-       * args: class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeInitEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after class initalization.\r
-       * args: class reference of the initializing class, such as this.initEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       initEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is appended to the DOM\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       appendEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeRenderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       renderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the header content of the Module is modified\r
-       * args: string/element representing the new header content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeHeaderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the body content of the Module is modified\r
-       * args: string/element representing the new body content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeBodyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the footer content of the Module is modified\r
-       * args: string/element representing the new footer content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeFooterEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the content of the Module is modified\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeContentEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is destroyed\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       destroyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeShowEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       showEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeHideEvent : null,\r
-       \r
-       /**\r
-       * CustomEvent fired after the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       hideEvent : null,\r
-               \r
        /**\r
        * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
+       * @method initEvents\r
        */\r
        initEvents : function() {\r
 \r
-               this.beforeInitEvent            = new YAHOO.util.CustomEvent("beforeInit");\r
-               this.initEvent                          = new YAHOO.util.CustomEvent("init");\r
-\r
-               this.appendEvent                        = new YAHOO.util.CustomEvent("append");\r
-\r
-               this.beforeRenderEvent          = new YAHOO.util.CustomEvent("beforeRender");\r
-               this.renderEvent                        = new YAHOO.util.CustomEvent("render");\r
-\r
-               this.changeHeaderEvent          = new YAHOO.util.CustomEvent("changeHeader");\r
-               this.changeBodyEvent            = new YAHOO.util.CustomEvent("changeBody");\r
-               this.changeFooterEvent          = new YAHOO.util.CustomEvent("changeFooter");\r
-\r
-               this.changeContentEvent         = new YAHOO.util.CustomEvent("changeContent");\r
-\r
-               this.destroyEvent                       = new YAHOO.util.CustomEvent("destroy");\r
-               this.beforeShowEvent            = new YAHOO.util.CustomEvent("beforeShow");\r
-               this.showEvent                          = new YAHOO.util.CustomEvent("show");\r
-               this.beforeHideEvent            = new YAHOO.util.CustomEvent("beforeHide");\r
-               this.hideEvent                          = new YAHOO.util.CustomEvent("hide");\r
-       }, \r
+               /**\r
+               * CustomEvent fired prior to class initalization.\r
+               * @event beforeInitEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");\r
+\r
+               /**\r
+               * CustomEvent fired after class initalization.\r
+               * @event initEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.initEvent = new YAHOO.util.CustomEvent("init");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is appended to the DOM\r
+               * @event appendEvent\r
+               */\r
+               this.appendEvent = new YAHOO.util.CustomEvent("append");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is rendered\r
+               * @event beforeRenderEvent\r
+               */\r
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is rendered\r
+               * @event renderEvent\r
+               */\r
+               this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+\r
+               /**\r
+               * CustomEvent fired when the header content of the Module is modified\r
+               * @event changeHeaderEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new header content\r
+               */\r
+               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");\r
+\r
+               /**\r
+               * CustomEvent fired when the body content of the Module is modified\r
+               * @event changeBodyEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new body content\r
+               */\r
+               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");\r
+\r
+               /**\r
+               * CustomEvent fired when the footer content of the Module is modified\r
+               * @event changeFooterEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new footer content\r
+               */\r
+               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");\r
+\r
+               /**\r
+               * CustomEvent fired when the content of the Module is modified\r
+               * @event changeContentEvent\r
+               */\r
+               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is destroyed\r
+               * @event destroyEvent\r
+               */\r
+               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is shown\r
+               * @event beforeShowEvent\r
+               */\r
+               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is shown\r
+               * @event showEvent\r
+               */\r
+               this.showEvent = new YAHOO.util.CustomEvent("show");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is hidden\r
+               * @event beforeHideEvent\r
+               */\r
+               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is hidden\r
+               * @event hideEvent\r
+               */\r
+               this.hideEvent = new YAHOO.util.CustomEvent("hide");\r
+       },\r
 \r
        /**\r
        * String representing the current user-agent platform\r
-       * @type string\r
+       * @property platform\r
+       * @type String\r
        */\r
        platform : function() {\r
                                        var ua = navigator.userAgent.toLowerCase();\r
@@ -708,7 +734,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * String representing the current user-agent browser\r
-       * @type string\r
+       * @property browser\r
+       * @type String\r
        */\r
        browser : function() {\r
                        var ua = navigator.userAgent.toLowerCase();\r
@@ -729,10 +756,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Boolean representing whether or not the current browsing context is secure (https)\r
-       * @type boolean\r
+       * @property isSecure\r
+       * @type Boolean\r
        */\r
        isSecure : function() {\r
-               if (window.location.href.toLowerCase().indexOf("https") == 0) {\r
+               if (window.location.href.toLowerCase().indexOf("https") === 0) {\r
                        return true;\r
                } else {\r
                        return false;\r
@@ -745,16 +773,37 @@ YAHOO.widget.Module.prototype = {
        initDefaultConfig : function() {\r
                // Add properties //\r
 \r
+               /**\r
+               * Specifies whether the Module is visible on the page.\r
+               * @config visible\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );\r
+\r
+               /**\r
+               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.\r
+               * @config effect\r
+               * @type Object\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );\r
+\r
+               /**\r
+               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document\r
+               * @config monitorresize\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );\r
        },\r
 \r
        /**\r
        * The Module class's initialization method, which is executed for Module and all of its subclasses. 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.\r
-       * @param {string}       el      The element ID representing the Module <em>OR</em>\r
-       * @param {Element}      el      The element representing the Module\r
-       * @param {object}       userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+       * @method init\r
+       * @param {String}       el      The element ID representing the Module <em>OR</em>\r
+       * @param {HTMLElement}  el      The element representing the Module\r
+       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
        */\r
        init : function(el, userConfig) {\r
 \r
@@ -762,8 +811,13 @@ YAHOO.widget.Module.prototype = {
 \r
                this.beforeInitEvent.fire(YAHOO.widget.Module);\r
 \r
+               /**\r
+               * The Module's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
-               \r
+\r
                if (this.isSecure) {\r
                        this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;\r
                }\r
@@ -779,10 +833,10 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                this.element = el;\r
-               \r
+\r
                if (el.id) {\r
                        this.id = el.id;\r
-               } \r
+               }\r
 \r
                var childNodes = this.element.childNodes;\r
 \r
@@ -821,93 +875,101 @@ YAHOO.widget.Module.prototype = {
        },\r
 \r
        /**\r
-       * Initialized an empty DOM element that is placed out of the visible area that can be used to detect text resize.\r
+       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.\r
+       * @method initResizeMonitor\r
        */\r
        initResizeMonitor : function() {\r
 \r
         if(this.browser != "opera") {\r
 \r
             var resizeMonitor = document.getElementById("_yuiResizeMonitor");\r
-    \r
+\r
             if (! resizeMonitor) {\r
-    \r
+\r
                 resizeMonitor = document.createElement("iframe");\r
-    \r
+\r
                 var bIE = (this.browser.indexOf("ie") === 0);\r
-    \r
-                if(this.isSecure && this.RESIZE_MONITOR_SECURE_URL && bIE) {\r
-    \r
-                    resizeMonitor.src = this.RESIZE_MONITOR_SECURE_URL;\r
-    \r
+\r
+                if(this.isSecure &&\r
+                   YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL &&\r
+                   bIE) {\r
+\r
+                  resizeMonitor.src =\r
+                       YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;\r
+\r
                 }\r
-                \r
+\r
                 resizeMonitor.id = "_yuiResizeMonitor";\r
                 resizeMonitor.style.visibility = "hidden";\r
-                \r
+\r
                 document.body.appendChild(resizeMonitor);\r
-    \r
+\r
                 resizeMonitor.style.width = "10em";\r
                 resizeMonitor.style.height = "10em";\r
                 resizeMonitor.style.position = "absolute";\r
-                \r
+\r
                 var nLeft = -1 * resizeMonitor.offsetWidth,\r
                     nTop = -1 * resizeMonitor.offsetHeight;\r
-    \r
+\r
                 resizeMonitor.style.top = nTop + "px";\r
                 resizeMonitor.style.left =  nLeft + "px";\r
                 resizeMonitor.style.borderStyle = "none";\r
                 resizeMonitor.style.borderWidth = "0";\r
                 YAHOO.util.Dom.setStyle(resizeMonitor, "opacity", "0");\r
-                \r
+\r
                 resizeMonitor.style.visibility = "visible";\r
-    \r
+\r
                 if(!bIE) {\r
-    \r
+\r
                     var doc = resizeMonitor.contentWindow.document;\r
-    \r
+\r
                     doc.open();\r
                     doc.close();\r
-                \r
+\r
                 }\r
-    \r
+\r
             }\r
-    \r
+\r
             if(resizeMonitor && resizeMonitor.contentWindow) {\r
-    \r
+\r
                 this.resizeMonitor = resizeMonitor;\r
-    \r
+\r
                 YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
-    \r
+\r
             }\r
-        \r
+\r
         }\r
 \r
        },\r
 \r
        /**\r
        * Event handler fired when the resize monitor element is resized.\r
+       * @method onDomResize\r
+       * @param {DOMEvent} e   The DOM resize event\r
+       * @param {Object} obj   The scope object passed to the handler\r
        */\r
-       onDomResize : function(e, obj) { \r
+       onDomResize : function(e, obj) {\r
 \r
         var nLeft = -1 * this.resizeMonitor.offsetWidth,\r
             nTop = -1 * this.resizeMonitor.offsetHeight;\r
-        \r
+\r
         this.resizeMonitor.style.top = nTop + "px";\r
         this.resizeMonitor.style.left =  nLeft + "px";\r
-       \r
+\r
        },\r
 \r
        /**\r
        * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {string}       headerContent   The HTML used to set the header <em>OR</em>\r
-       * @param {Element}      headerContent   The Element to append to the header\r
-       */      \r
+       * @method setHeader\r
+       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>\r
+       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header\r
+       */\r
        setHeader : function(headerContent) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                if (typeof headerContent == "string") {\r
                        this.header.innerHTML = headerContent;\r
                } else {\r
@@ -921,14 +983,15 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the header\r
-       */      \r
+       * @method appendToHeader\r
+       * @param {HTMLElement}  element The element to append to the header\r
+       */\r
        appendToHeader : function(element) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                this.header.appendChild(element);\r
                this.changeHeaderEvent.fire(element);\r
                this.changeContentEvent.fire();\r
@@ -936,9 +999,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       bodyContent     The HTML used to set the body <em>OR</em>\r
-       * @param {Element}      bodyContent     The Element to append to the body\r
-       */              \r
+       * @method setBody\r
+       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>\r
+       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body\r
+       */\r
        setBody : function(bodyContent) {\r
                if (! this.body) {\r
                        this.body = document.createElement("DIV");\r
@@ -959,7 +1023,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the body. If no body is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the body\r
+       * @method appendToBody\r
+       * @param {HTMLElement}  element The element to append to the body\r
        */\r
        appendToBody : function(element) {\r
                if (! this.body) {\r
@@ -974,9 +1039,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       footerContent   The HTML used to set the footer <em>OR</em>\r
-       * @param {Element}      footerContent   The Element to append to the footer\r
-       */      \r
+       * @method setFooter\r
+       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>\r
+       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer\r
+       */\r
        setFooter : function(footerContent) {\r
                if (! this.footer) {\r
                        this.footer = document.createElement("DIV");\r
@@ -996,7 +1062,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the footer. If no footer is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the footer\r
+       * @method appendToFooter\r
+       * @param {HTMLElement}  element The element to append to the footer\r
        */\r
        appendToFooter : function(element) {\r
                if (! this.footer) {\r
@@ -1011,10 +1078,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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 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.\r
-       * @param {string}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-       * @param {Element}      appendToNode    The element to which the Module should be appended to prior to rendering        \r
-       * @param {Element}      moduleElement   OPTIONAL. The element that represents the actual Standard Module container. \r
-       * @return {boolean} Success or failure of the render\r
+       * @method render\r
+       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering\r
+       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container.\r
+       * @return {Boolean} Success or failure of the render\r
        */\r
        render : function(appendToNode, moduleElement) {\r
                this.beforeRenderEvent.fire();\r
@@ -1028,12 +1096,12 @@ YAHOO.widget.Module.prototype = {
                        if (typeof element == "string") {\r
                                element = document.getElementById(element);\r
                        }\r
-                       \r
+\r
                        if (element) {\r
                                element.appendChild(me.element);\r
                                me.appendEvent.fire();\r
                        }\r
-               }\r
+               };\r
 \r
                if (appendToNode) {\r
                        appendTo(appendToNode);\r
@@ -1045,7 +1113,7 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                // Need to get everything into the DOM if it isn't already\r
-               \r
+\r
                if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {\r
                        // There is a header, but it's not in the DOM yet... need to add it\r
                        var firstChild = moduleElement.firstChild;\r
@@ -1076,6 +1144,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Removes the Module element from the DOM and sets all child elements to null.\r
+       * @method destroy\r
        */\r
        destroy : function() {\r
                if (this.element) {\r
@@ -1095,6 +1164,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Shows the Module element by setting the visible configuration property to true. Also fires two events: beforeShowEvent prior to the visibility change, and showEvent after.\r
+       * @method show\r
        */\r
        show : function() {\r
                this.cfg.setProperty("visible", true);\r
@@ -1102,6 +1172,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Hides the Module element by setting the visible configuration property to false. Also fires two events: beforeHideEvent prior to the visibility change, and hideEvent after.\r
+       * @method hide\r
        */\r
        hide : function() {\r
                this.cfg.setProperty("visible", false);\r
@@ -1112,6 +1183,10 @@ YAHOO.widget.Module.prototype = {
        /**\r
        * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".\r
        * This method is responsible for firing showEvent and hideEvent.\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configVisible\r
        */\r
        configVisible : function(type, args, obj) {\r
                var visible = args[0];\r
@@ -1128,6 +1203,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Default event handler for the "monitorresize" configuration property\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configMonitorResize\r
        */\r
        configMonitorResize : function(type, args, obj) {\r
                var monitor = args[0];\r
@@ -1138,95 +1217,97 @@ YAHOO.widget.Module.prototype = {
                        this.resizeMonitor = null;\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the Object.\r
+* @method toString\r
+* @return {String}     The string representation of the Module\r
+*/\r
 YAHOO.widget.Module.prototype.toString = function() {\r
        return "Module " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+};\r
+\r
+/**\r
+* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
+* @class Overlay\r
+* @namespace YAHOO.widget\r
+* @extends YAHOO.widget.Module\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 * @constructor\r
 */\r
 YAHOO.widget.Overlay = function(el, userConfig) {\r
        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);\r
 \r
 /**\r
-* The URL of the blank image that will be placed in the iframe\r
-* @type string\r
+* The URL that will be placed in the iframe\r
+* @property YAHOO.widget.Overlay.IFRAME_SRC\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Overlay.IFRAME_SRC = "promo/m/irs/blank.gif";\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
 \r
 /**\r
 * Constant representing the top left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_LEFT = "tl";\r
 \r
 /**\r
 * Constant representing the top right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_RIGHT = "tr";\r
 \r
 /**\r
 * Constant representing the top bottom left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";\r
 \r
 /**\r
 * Constant representing the bottom right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";\r
 \r
 /**\r
 * Constant representing the default CSS class used for an Overlay\r
-* @type string\r
+* @property YAHOO.widget.Overlay.CSS_OVERLAY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";\r
 \r
 /**\r
-* CustomEvent fired before the Overlay is moved.\r
-* args: x,y that the Overlay will be moved to\r
-* @type YAHOO.util.CustomEvent\r
+* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
-YAHOO.widget.Overlay.prototype.beforeMoveEvent = null;\r
+YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
+       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
 \r
-/**\r
-* CustomEvent fired after the Overlay is moved.\r
-* args: x,y that the Overlay was moved to\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Overlay.prototype.moveEvent = null;\r
-\r
-/**\r
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
-*/\r
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
-       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
        this.beforeInitEvent.fire(YAHOO.widget.Overlay);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);\r
@@ -1246,80 +1327,180 @@ YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
 \r
        this.initEvent.fire(YAHOO.widget.Overlay);\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Overlay.prototype.initEvents = function() {\r
        YAHOO.widget.Overlay.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired before the Overlay is moved.\r
+       * @event beforeMoveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);\r
+\r
+       /**\r
+       * CustomEvent fired after the Overlay is moved.\r
+       * @event moveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.moveEvent = new YAHOO.util.CustomEvent("move", this);\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);\r
 \r
        // Add overlay config properties //\r
+\r
+       /**\r
+       * The absolute x-coordinate position of the Overlay\r
+       * @config x\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * The absolute y-coordinate position of the Overlay\r
+       * @config y\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * An array with the absolute x and y positions of the Overlay\r
+       * @config xy\r
+       * @type Number[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * The 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 Overlay's top left corner to the context element's bottom left corner.\r
+       * @config context\r
+       * @type Array\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * True if the Overlay should be anchored to the center of the viewport.\r
+       * @config fixedcenter\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );\r
 \r
+       /**\r
+       * CSS width of the Overlay.\r
+       * @config width\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * CSS height of the Overlay.\r
+       * @config height\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * CSS z-index of the Overlay.\r
+       * @config zIndex\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );\r
 \r
+       /**\r
+       * True if the Overlay should be prevented from being positioned out of the viewport.\r
+       * @config constraintoviewport\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );\r
+\r
+       /**\r
+       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true for IE6 and below, false for all others\r
+       */\r
        this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );\r
-}\r
+};\r
 \r
 /**\r
 * Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);\r
-* @param {int} x       The Overlay's new x position\r
-* @param {int} y       The Overlay's new y position\r
+* @method moveTo\r
+* @param {Number}      x       The Overlay's new x position\r
+* @param {Number}      y       The Overlay's new y position\r
 */\r
 YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {\r
        this.cfg.setProperty("xy",[x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method hideMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");\r
-}\r
+};\r
 \r
 /**\r
 * Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method showMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "show-scrollbars");\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.\r
+* @method configVisible\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {\r
        var visible = args[0];\r
        var currentVis = YAHOO.util.Dom.getStyle(this.element, "visibility");\r
 \r
+       if (currentVis == "inherit") {\r
+               var e = this.element.parentNode;\r
+               while (e.nodeType != 9 && e.nodeType != 11) {\r
+                       currentVis = YAHOO.util.Dom.getStyle(e, "visibility");\r
+                       if (currentVis != "inherit") { break; }\r
+                       e = e.parentNode;\r
+               }\r
+               if (currentVis == "inherit") {\r
+                       currentVis = "visible";\r
+               }\r
+       }\r
+\r
        var effect = this.cfg.getProperty("effect");\r
 \r
-       var effectInstances = new Array();\r
+       var effectInstances = [];\r
        if (effect) {\r
                if (effect instanceof Array) {\r
                        for (var i=0;i<effect.length;i++) {\r
@@ -1336,23 +1517,23 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        if (visible) { // Show\r
                if (isMacGecko) {\r
                        this.showMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate in\r
                        if (visible) { // Animate in if not showing\r
-                               if (currentVis != "visible") {\r
+                               if (currentVis != "visible" || currentVis === "") {\r
                                        this.beforeShowEvent.fire();\r
-                                       for (var i=0;i<effectInstances.length;i++) {\r
-                                               var e = effectInstances[i];\r
-                                               if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
-                                                       e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
+                                       for (var j=0;j<effectInstances.length;j++) {\r
+                                               var ei = effectInstances[j];\r
+                                               if (j === 0 && ! YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
+                                                       ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
                                                }\r
-                                               e.animateIn();\r
+                                               ei.animateIn();\r
                                        }\r
                                }\r
                        }\r
                } else { // Show\r
-                       if (currentVis != "visible") {\r
+                       if (currentVis != "visible" || currentVis === "") {\r
                                this.beforeShowEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");\r
                                this.cfg.refireEvent("iframe");\r
@@ -1363,52 +1544,59 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        } else { // Hide\r
                if (isMacGecko) {\r
                        this.hideMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate out if showing\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible") {\r
                                this.beforeHideEvent.fire();\r
-                               for (var i=0;i<effectInstances.length;i++) {\r
-                                       var e = effectInstances[i];\r
-                                       if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {                            \r
-                                               e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
+                               for (var k=0;k<effectInstances.length;k++) {\r
+                                       var h = effectInstances[k];\r
+                                       if (k === 0 && ! YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {\r
+                                               h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
                                        }\r
-                                       e.animateOut();\r
+                                       h.animateOut();\r
                                }\r
+                       } else if (currentVis === "") {\r
+                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                        }\r
                } else { // Simple hide\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible" || currentVis === "") {\r
                                this.beforeHideEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                                this.cfg.refireEvent("iframe");\r
                                this.hideEvent.fire();\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Center event handler used for centering on scroll/resize, but only if the Overlay is visible\r
+* @method doCenterOnDOMEvent\r
 */\r
 YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {\r
        if (this.cfg.getProperty("visible")) {\r
                this.center();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "fixedcenter" property is changed.\r
+* @method configFixedCenter\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        if (val) {\r
                this.center();\r
-                       \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent, this.center, this)) {\r
                        this.beforeShowEvent.subscribe(this.center, this, true);\r
                }\r
-               \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);\r
                }\r
@@ -1420,30 +1608,42 @@ YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {
                YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
                YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configHeight = function(type, args, obj) {\r
        var height = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "height", height);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configWidth = function(type, args, obj) {\r
        var width = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "width", width);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {\r
        var zIndex = args[0];\r
@@ -1466,10 +1666,14 @@ YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {
 \r
        YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);\r
        this.cfg.setProperty("zIndex", zIndex, true);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "xy" property is changed.\r
+* @method configXY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1488,10 +1692,14 @@ YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "x" property is changed.\r
+* @method configX\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {\r
        var x = args[0];\r
@@ -1506,15 +1714,19 @@ YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
        y = this.cfg.getProperty("y");\r
 \r
        YAHOO.util.Dom.setX(this.element, x, true);\r
-       \r
+\r
        this.cfg.setProperty("xy", [x, y], true);\r
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "y" property is changed.\r
+* @method configY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {\r
        var x = this.cfg.getProperty("x");\r
@@ -1534,43 +1746,52 @@ YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
+\r
+/**\r
+* Shows the iframe shim, if it has been enabled\r
+* @method showIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.showIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "block";\r
+       }\r
+};\r
+\r
+/**\r
+* Hides the iframe shim, if it has been enabled\r
+* @method hideIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.hideIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "none";\r
+       }\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "iframe" property is changed.\r
+* @method configIframe\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {\r
 \r
        var val = args[0];\r
 \r
-       var el = this.element;\r
-       \r
-       var showIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "block";\r
-               }\r
-       }\r
-\r
-       var hideIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "none";\r
-               }\r
-       }\r
-\r
        if (val) { // IFRAME shim is enabled\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, showIframe, this)) {\r
-                       this.showEvent.subscribe(showIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {\r
+                       this.showEvent.subscribe(this.showIframe, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, hideIframe, this)) {\r
-                       this.hideEvent.subscribe(hideIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {\r
+                       this.hideEvent.subscribe(this.hideIframe, this, true);\r
                }\r
 \r
                var x = this.cfg.getProperty("x");\r
                var y = this.cfg.getProperty("y");\r
 \r
                if (! x || ! y) {\r
-                       YAHOO.log("syncPosition needed for iframe", "iframe");\r
                        this.syncPosition();\r
                        x = this.cfg.getProperty("x");\r
                        y = this.cfg.getProperty("y");\r
@@ -1584,8 +1805,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                if (this.isSecure) {\r
                                        this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
                                }\r
-                               \r
-                               var parent = el.parentNode;\r
+\r
+                               var parent = this.element.parentNode;\r
                                if (parent) {\r
                                        parent.appendChild(this.iframe);\r
                                } else {\r
@@ -1598,12 +1819,12 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                YAHOO.util.Dom.setStyle(this.iframe, "padding", "0");\r
                                YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
                                if (this.cfg.getProperty("visible")) {\r
-                                       showIframe.call(this);\r
+                                       this.showIframe();\r
                                } else {\r
-                                       hideIframe.call(this);\r
+                                       this.hideIframe();\r
                                }\r
                        }\r
-                       \r
+\r
                        var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");\r
 \r
                        if (iframeDisplay == "none") {\r
@@ -1612,8 +1833,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
 \r
                        YAHOO.util.Dom.setXY(this.iframe, [x,y]);\r
 \r
-                       var width = el.clientWidth;\r
-                       var height = el.clientHeight;\r
+                       var width = this.element.clientWidth;\r
+                       var height = this.element.clientHeight;\r
 \r
                        YAHOO.util.Dom.setStyle(this.iframe, "width", (width+2) + "px");\r
                        YAHOO.util.Dom.setStyle(this.iframe, "height", (height+2) + "px");\r
@@ -1626,14 +1847,18 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                if (this.iframe) {\r
                        this.iframe.style.display = "none";\r
                }\r
-               this.showEvent.unsubscribe(showIframe, this);\r
-               this.hideEvent.unsubscribe(hideIframe, this);\r
+               this.showEvent.unsubscribe(this.showIframe, this);\r
+               this.hideEvent.unsubscribe(this.hideIframe, this);\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The default event handler fired when the "constraintoviewport" property is changed.\r
+* @method configConstrainToViewport\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args, obj) {\r
        var val = args[0];\r
@@ -1644,10 +1869,14 @@ YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args,
        } else {\r
                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {\r
        var contextArgs = args[0];\r
@@ -1661,27 +1890,28 @@ YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {
                        if (typeof contextEl == "string") {\r
                                this.cfg.setProperty("context", [document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner], true);\r
                        }\r
-                       \r
+\r
                        if (elementMagnetCorner && contextMagnetCorner) {\r
                                this.align(elementMagnetCorner, contextMagnetCorner);\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.\r
-* @param {string} elementAlign         The string representing the corner of the Overlay that should be aligned to the context element\r
-* @param {string} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
+* @method align\r
+* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element\r
+* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
 */\r
 YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {\r
        var contextArgs = this.cfg.getProperty("context");\r
        if (contextArgs) {\r
                var context = contextArgs[0];\r
-               \r
+\r
                var element = this.element;\r
                var me = this;\r
 \r
@@ -1712,7 +1942,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                                me.moveTo(h-element.offsetWidth,v-element.offsetHeight);\r
                                                break;\r
                                }\r
-                       }\r
+                       };\r
 \r
                        switch (contextAlign) {\r
                                case YAHOO.widget.Overlay.TOP_LEFT:\r
@@ -1720,7 +1950,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                        break;\r
                                case YAHOO.widget.Overlay.TOP_RIGHT:\r
                                        doAlign(contextRegion.top, contextRegion.right);\r
-                                       break;          \r
+                                       break;\r
                                case YAHOO.widget.Overlay.BOTTOM_LEFT:\r
                                        doAlign(contextRegion.bottom, contextRegion.left);\r
                                        break;\r
@@ -1730,10 +1960,14 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                        }\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.\r
+* @method enforceConstraints\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1741,26 +1975,20 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        var x = pos[0];\r
        var y = pos[1];\r
 \r
-       var width = parseInt(this.cfg.getProperty("width"));\r
-\r
-       if (isNaN(width)) {\r
-               width = 0;\r
-       }\r
-\r
        var offsetHeight = this.element.offsetHeight;\r
-       var offsetWidth = (width>0?width:this.element.offsetWidth); //this.element.offsetWidth;\r
+       var offsetWidth = this.element.offsetWidth;\r
 \r
        var viewPortWidth = YAHOO.util.Dom.getViewportWidth();\r
        var viewPortHeight = YAHOO.util.Dom.getViewportHeight();\r
 \r
-       var scrollX = window.scrollX || document.documentElement.scrollLeft;\r
-       var scrollY = window.scrollY || document.documentElement.scrollTop;\r
+       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
+       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;\r
 \r
        var topConstraint = scrollY + 10;\r
        var leftConstraint = scrollX + 10;\r
        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-       \r
+\r
        if (x < leftConstraint) {\r
                x = leftConstraint;\r
        } else if (x > rightConstraint) {\r
@@ -1776,10 +2004,11 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        this.cfg.setProperty("x", x, true);\r
        this.cfg.setProperty("y", y, true);\r
        this.cfg.setProperty("xy", [x,y], true);\r
-}\r
+};\r
 \r
 /**\r
 * Centers the container in the viewport.\r
+* @method center\r
 */\r
 YAHOO.widget.Overlay.prototype.center = function() {\r
        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
@@ -1793,161 +2022,195 @@ YAHOO.widget.Overlay.prototype.center = function() {
 \r
        var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;\r
        var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;\r
-       \r
-       this.element.style.left = parseInt(x) + "px";\r
-       this.element.style.top = parseInt(y) + "px";\r
-       this.syncPosition();\r
+\r
+       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);\r
 \r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.\r
+* @method syncPosition\r
 */\r
 YAHOO.widget.Overlay.prototype.syncPosition = function() {\r
        var pos = YAHOO.util.Dom.getXY(this.element);\r
        this.cfg.setProperty("x", pos[0], true);\r
        this.cfg.setProperty("y", pos[1], true);\r
        this.cfg.setProperty("xy", pos, true);\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
 YAHOO.widget.Overlay.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Overlay.superclass.onDomResize.call(this, e, obj);\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+       var me = this;\r
+       setTimeout(function() {\r
+               me.syncPosition();\r
+               me.cfg.refireEvent("iframe");\r
+               me.cfg.refireEvent("context");\r
+       }, 0);\r
+};\r
 \r
 /**\r
 * Removes the Overlay element from the DOM and sets all child elements to null.\r
+* @method destroy\r
 */\r
 YAHOO.widget.Overlay.prototype.destroy = function() {\r
        if (this.iframe) {\r
                this.iframe.parentNode.removeChild(this.iframe);\r
        }\r
-       \r
+\r
        this.iframe = null;\r
 \r
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  \r
+       YAHOO.widget.Overlay.superclass.destroy.call(this);\r
 };\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Overlay.\r
+*/\r
 YAHOO.widget.Overlay.prototype.toString = function() {\r
        return "Overlay " + this.id;\r
-}\r
+};\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window scroll\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowScrollEvent\r
 */\r
 YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window resize\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowResizeEvent\r
 */\r
 YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window scroll\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowScrollHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM scroll event\r
 */\r
 YAHOO.widget.Overlay.windowScrollHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowScrollEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.scrollEnd) {\r
+                       window.scrollEnd = -1;\r
+               }\r
+               clearTimeout(window.scrollEnd);\r
+               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowScrollEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window resize\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowResizeHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM resize event\r
 */\r
 YAHOO.widget.Overlay.windowResizeHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowResizeEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.resizeEnd) {\r
+                       window.resizeEnd = -1;\r
+               }\r
+               clearTimeout(window.resizeEnd);\r
+               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowResizeEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
+* A boolean that indicated whether the window resize and scroll events have already been subscribed to.\r
+* @property YAHOO.widget.Overlay._initialized\r
 * @private\r
+* @type Boolean\r
 */\r
-YAHOO.widget.Overlay._initialized == null;\r
+YAHOO.widget.Overlay._initialized = null;\r
 \r
-if (YAHOO.widget.Overlay._initialized == null) {\r
+if (YAHOO.widget.Overlay._initialized === null) {\r
        YAHOO.util.Event.addListener(window, "scroll", YAHOO.widget.Overlay.windowScrollHandler);\r
        YAHOO.util.Event.addListener(window, "resize", YAHOO.widget.Overlay.windowResizeHandler);\r
 \r
        YAHOO.widget.Overlay._initialized = true;\r
 }\r
+\r
 /**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
-* OverlayManager is used for maintaining the focus status of multiple Overlays.\r
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
-* @param {object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
+* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget\r
+* @namespace YAHOO.widget\r
+* @class OverlayManager\r
 * @constructor\r
+* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
+* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
 */\r
 YAHOO.widget.OverlayManager = function(userConfig) {\r
        this.init(userConfig);\r
-}\r
+};\r
 \r
 /**\r
 * The CSS class representing a focused Overlay\r
-* @type string\r
+* @property YAHOO.widget.OverlayManager.CSS_FOCUSED\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";\r
 \r
 YAHOO.widget.OverlayManager.prototype = {\r
-\r
+       /**\r
+       * The class's constructor function\r
+       * @property contructor\r
+       * @type Function\r
+       */\r
        constructor : YAHOO.widget.OverlayManager,\r
 \r
        /**\r
        * The array of Overlays that are currently registered\r
-       * @type Array\r
+       * @property overlays\r
+       * @type YAHOO.widget.Overlay[]\r
        */\r
        overlays : null,\r
 \r
        /**\r
        * Initializes the default configuration of the OverlayManager\r
-       */      \r
+       * @method initDefaultConfig\r
+       */\r
        initDefaultConfig : function() {\r
+               /**\r
+               * The collection of registered Overlays in use by the OverlayManager\r
+               * @config overlays\r
+               * @type YAHOO.widget.Overlay[]\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("overlays", { suppressEvent:true } );\r
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
-       }, \r
-\r
-       /**\r
-       * Returns the currently focused Overlay\r
-       * @return {Overlay}     The currently focused Overlay\r
-       */\r
-       getActive : function() {},\r
-\r
-       /**\r
-       * Focuses the specified Overlay\r
-       * @param {Overlay}      The Overlay to focus\r
-       * @param {string}       The id of the Overlay to focus\r
-       */\r
-       focus : function(overlay) {},\r
-\r
-       /**\r
-       * Removes the specified Overlay from the manager\r
-       * @param {Overlay}      The Overlay to remove\r
-       * @param {string}       The id of the Overlay to remove\r
-       */\r
-       remove: function(overlay) {},\r
 \r
-       /**\r
-       * Removes focus from all registered Overlays in the manager\r
-       */\r
-       blurAll : function() {},\r
+               /**\r
+               * The default DOM event that should be used to focus an Overlay\r
+               * @config focusevent\r
+               * @type String\r
+               * @default "mousedown"\r
+               */\r
+               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
+       },\r
 \r
        /**\r
        * Initializes the OverlayManager\r
-       * @param {Array}        overlays        Optional. A collection of Overlays to register with the manager.\r
-       * @param {object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
+       * @method init\r
+       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.\r
+       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
        */\r
        init : function(userConfig) {\r
+               /**\r
+               * The OverlayManager's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
 \r
                this.initDefaultConfig();\r
@@ -1957,12 +2220,29 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
                this.cfg.fireQueue();\r
 \r
+               /**\r
+               * The currently activated Overlay\r
+               * @property activeOverlay\r
+               * @private\r
+               * @type YAHOO.widget.Overlay\r
+               */\r
                var activeOverlay = null;\r
 \r
+               /**\r
+               * Returns the currently focused Overlay\r
+               * @method getActive\r
+               * @return {YAHOO.widget.Overlay}        The currently focused Overlay\r
+               */\r
                this.getActive = function() {\r
                        return activeOverlay;\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Focuses the specified Overlay\r
+               * @method focus\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus\r
+               * @param {String} overlay       The id of the Overlay to focus\r
+               */\r
                this.focus = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1972,12 +2252,18 @@ YAHOO.widget.OverlayManager.prototype = {
                                this.overlays.sort(this.compareZIndexDesc);\r
                                var topZIndex = YAHOO.util.Dom.getStyle(this.overlays[0].element, "zIndex");\r
                                if (! isNaN(topZIndex) && this.overlays[0] != overlay) {\r
-                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex) + 1));\r
+                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex, 10) + 2));\r
                                }\r
                                this.overlays.sort(this.compareZIndexDesc);\r
                        }\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Removes the specified Overlay from the manager\r
+               * @method remove\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove\r
+               * @param {String} overlay       The id of the Overlay to remove\r
+               */\r
                this.remove = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1988,24 +2274,28 @@ YAHOO.widget.OverlayManager.prototype = {
                                o.cfg.setProperty("zIndex", originalZ, true);\r
 \r
                                o.cfg.setProperty("manager", null);\r
-                               o.focusEvent = null\r
+                               o.focusEvent = null;\r
                                o.blurEvent = null;\r
                                o.focus = null;\r
                                o.blur = null;\r
                        }\r
-               }\r
+               };\r
 \r
+               /**\r
+               * Removes focus from all registered Overlays in the manager\r
+               * @method blurAll\r
+               */\r
                this.blurAll = function() {\r
                        activeOverlay = null;\r
                        for (var o=0;o<this.overlays.length;o++) {\r
                                YAHOO.util.Dom.removeClass(this.overlays[o].element, YAHOO.widget.OverlayManager.CSS_FOCUSED);\r
-                       }               \r
-               }\r
+                       }\r
+               };\r
 \r
                var overlays = this.cfg.getProperty("overlays");\r
-               \r
+\r
                if (! this.overlays) {\r
-                       this.overlays = new Array();\r
+                       this.overlays = [];\r
                }\r
 \r
                if (overlays) {\r
@@ -2016,9 +2306,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each.\r
-       * @param {Overlay}      overlay         An Overlay to register with the manager.\r
-       * @param {Overlay[]}    overlay         An array of Overlays to register with the manager.\r
-       * @return       {boolean}       True if any Overlays are registered.\r
+       * @method register\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.\r
+       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.\r
+       * @return       {Boolean}       True if any Overlays are registered.\r
        */\r
        register : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2026,33 +2317,33 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
                        overlay.focusEvent = new YAHOO.util.CustomEvent("focus");\r
                        overlay.blurEvent = new YAHOO.util.CustomEvent("blur");\r
-                       \r
+\r
                        var mgr=this;\r
 \r
                        overlay.focus = function() {\r
                                mgr.focus(this);\r
                                this.focusEvent.fire();\r
-                       } \r
+                       };\r
 \r
                        overlay.blur = function() {\r
                                mgr.blurAll();\r
                                this.blurEvent.fire();\r
-                       }\r
+                       };\r
 \r
                        var focusOnDomEvent = function(e,obj) {\r
                                overlay.focus();\r
-                       }\r
-                       \r
+                       };\r
+\r
                        var focusevent = this.cfg.getProperty("focusevent");\r
                        YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);\r
 \r
                        var zIndex = YAHOO.util.Dom.getStyle(overlay.element, "zIndex");\r
                        if (! isNaN(zIndex)) {\r
-                               overlay.cfg.setProperty("zIndex", parseInt(zIndex));\r
+                               overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));\r
                        } else {\r
                                overlay.cfg.setProperty("zIndex", 0);\r
                        }\r
-                       \r
+\r
                        this.overlays.push(overlay);\r
                        return true;\r
                } else if (overlay instanceof Array) {\r
@@ -2072,9 +2363,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Attempts to locate an Overlay by instance or ID.\r
-       * @param {Overlay}      overlay         An Overlay to locate within the manager\r
-       * @param {string}       overlay         An Overlay id to locate within the manager\r
-       * @return       {Overlay}       The requested Overlay, if found, or null if it cannot be located.\r
+       * @method find\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager\r
+       * @param {String}       overlay         An Overlay id to locate within the manager\r
+       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.\r
        */\r
        find : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2084,18 +2376,20 @@ YAHOO.widget.OverlayManager.prototype = {
                                }\r
                        }\r
                } else if (typeof overlay == "string") {\r
-                       for (var o=0;o<this.overlays.length;o++) {\r
-                               if (this.overlays[o].id == overlay) {\r
-                                       return this.overlays[o];\r
+                       for (var p=0;p<this.overlays.length;p++) {\r
+                               if (this.overlays[p].id == overlay) {\r
+                                       return this.overlays[p];\r
                                }\r
-                       }                       \r
+                       }\r
                }\r
                return null;\r
        },\r
 \r
        /**\r
        * Used for sorting the manager's Overlays by z-index.\r
+       * @method compareZIndexDesc\r
        * @private\r
+       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.\r
        */\r
        compareZIndexDesc : function(o1, o2) {\r
                var zIndex1 = o1.cfg.getProperty("zIndex");\r
@@ -2112,6 +2406,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Shows all Overlays in the manager.\r
+       * @method showAll\r
        */\r
        showAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2121,6 +2416,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Hides all Overlays in the manager.\r
+       * @method hideAll\r
        */\r
        hideAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2130,24 +2426,26 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * @method toString\r
+       * @return {String}      The string representation of the OverlayManager\r
+       */\r
        toString : function() {\r
                return "OverlayManager";\r
        }\r
 \r
-}/**\r
-* Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-* Code licensed under the BSD License:\r
-* http://developer.yahoo.net/yui/license.txt\r
+};\r
+\r
+/**\r
 * KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.\r
-* @param {Element}     attachTo        The element or element ID to which the key event should be attached\r
-* @param {string}      attachTo        The element or element ID to which the key event should be attached\r
-* @param {object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
-* @param {function}    handler         The CustomEvent handler to fire when the key event is detected\r
-* @param {object}      handler         An object literal representing the handler. \r
-* @param {string}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
+* @namespace YAHOO.util\r
+* @class KeyListener\r
 * @constructor\r
+* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached\r
+* @param {String}      attachTo        The element or element ID to which the key event should be attached\r
+* @param {Object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected\r
+* @param {Object}      handler         An object literal representing the handler.\r
+* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
 */\r
 YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {\r
        if (! attachTo) {\r
@@ -2164,9 +2462,26 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
                event = YAHOO.util.KeyListener.KEYDOWN;\r
        }\r
 \r
+       /**\r
+       * The CustomEvent fired internally when a key is pressed\r
+       * @event keyEvent\r
+       * @private\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        var keyEvent = new YAHOO.util.CustomEvent("keyPressed");\r
-       \r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is enabled via the enable() function\r
+       * @event enabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.enabledEvent = new YAHOO.util.CustomEvent("enabled");\r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is disabled via the disable() function\r
+       * @event disabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.disabledEvent = new YAHOO.util.CustomEvent("disabled");\r
 \r
        if (typeof attachTo == 'string') {\r
@@ -2181,99 +2496,416 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
 \r
        /**\r
        * Handles the key event when a key is pressed.\r
+       * @method handleKeyPress\r
+       * @param {DOMEvent} e   The keypress DOM event\r
+       * @param {Object}       obj     The DOM event scope object\r
        * @private\r
        */\r
        function handleKeyPress(e, obj) {\r
-               var keyPressed = e.charCode || e.keyCode;\r
-               \r
-               if (! keyData.shift)    keyData.shift = false;\r
-               if (! keyData.alt)              keyData.alt = false;\r
-               if (! keyData.ctrl)             keyData.ctrl = false;\r
+               if (! keyData.shift) {\r
+                       keyData.shift = false;\r
+               }\r
+               if (! keyData.alt) {\r
+                       keyData.alt = false;\r
+               }\r
+               if (! keyData.ctrl) {\r
+                       keyData.ctrl = false;\r
+               }\r
 \r
                // check held down modifying keys first\r
-               if (e.shiftKey == keyData.shift && \r
+               if (e.shiftKey == keyData.shift &&\r
                        e.altKey   == keyData.alt &&\r
                        e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match\r
 \r
+                       var dataItem;\r
+                       var keyPressed;\r
+\r
                        if (keyData.keys instanceof Array) {\r
                                for (var i=0;i<keyData.keys.length;i++) {\r
-                                       if (keyPressed == keyData.keys[i]) {\r
-                                               keyEvent.fire(keyPressed, e);\r
+                                       dataItem = keyData.keys[i];\r
+\r
+                                       if (dataItem == e.charCode ) {\r
+                                               keyEvent.fire(e.charCode, e);\r
+                                               break;\r
+                                       } else if (dataItem == e.keyCode) {\r
+                                               keyEvent.fire(e.keyCode, e);\r
                                                break;\r
                                        }\r
                                }\r
                        } else {\r
-                               if (keyPressed == keyData.keys) {\r
-                                       keyEvent.fire(keyPressed, e);\r
+                               dataItem = keyData.keys;\r
+                               if (dataItem == e.charCode ) {\r
+                                       keyEvent.fire(e.charCode, e);\r
+                               } else if (dataItem == e.keyCode) {\r
+                                       keyEvent.fire(e.keyCode, e);\r
                                }\r
                        }\r
                }\r
        }\r
 \r
+       /**\r
+       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element\r
+       * @method enable\r
+       */\r
        this.enable = function() {\r
                if (! this.enabled) {\r
                        YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);\r
                        this.enabledEvent.fire(keyData);\r
                }\r
+               /**\r
+               * Boolean indicating the enabled/disabled state of the Tooltip\r
+               * @property enabled\r
+               * @type Boolean\r
+               */\r
                this.enabled = true;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Disables the KeyListener by removing the DOM event listeners from the target DOM element\r
+       * @method disable\r
+       */\r
        this.disable = function() {\r
                if (this.enabled) {\r
                        YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);\r
                        this.disabledEvent.fire(keyData);\r
                }\r
                this.enabled = false;\r
-       }\r
+       };\r
 \r
        /**\r
-       * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * Returns a String representation of the object.\r
+       * @method toString\r
+       * @return {String}      The string representation of the KeyListener\r
+       */\r
        this.toString = function() {\r
                return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");\r
-       }\r
+       };\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the DOM "keydown" event.\r
+* @property YAHOO.util.KeyListener.KEYDOWN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYDOWN = "keydown";\r
 \r
 /**\r
 * Constant representing the DOM "keyup" event.\r
+* @property YAHOO.util.KeyListener.KEYUP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYUP = "keyup";\r
 \r
 /**\r
-* Boolean indicating the enabled/disabled state of the Tooltip\r
-* @type Booleam\r
+* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.\r
+* @namespace YAHOO.widget\r
+* @class ContainerEffect\r
+* @constructor\r
+* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with\r
+* @param {Object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {Object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
+* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
+*/\r
+YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {\r
+       if (! animClass) {\r
+               animClass = YAHOO.util.Anim;\r
+       }\r
+\r
+       /**\r
+       * The overlay to animate\r
+       * @property overlay\r
+       * @type YAHOO.widget.Overlay\r
+       */\r
+       this.overlay = overlay;\r
+       /**\r
+       * The animation attributes to use when transitioning into view\r
+       * @property attrIn\r
+       * @type Object\r
+       */\r
+       this.attrIn = attrIn;\r
+       /**\r
+       * The animation attributes to use when transitioning out of view\r
+       * @property attrOut\r
+       * @type Object\r
+       */\r
+       this.attrOut = attrOut;\r
+       /**\r
+       * The target element to be animated\r
+       * @property targetElement\r
+       * @type HTMLElement\r
+       */\r
+       this.targetElement = targetElement || overlay.element;\r
+       /**\r
+       * The animation class to use for animating the overlay\r
+       * @property animClass\r
+       * @type class\r
+       */\r
+       this.animClass = animClass;\r
+};\r
+\r
+/**\r
+* Initializes the animation classes and events.\r
+* @method init\r
 */\r
-YAHOO.util.KeyListener.prototype.enabled = null;\r
+YAHOO.widget.ContainerEffect.prototype.init = function() {\r
+       this.beforeAnimateInEvent = new YAHOO.util.CustomEvent("beforeAnimateIn");\r
+       this.beforeAnimateOutEvent = new YAHOO.util.CustomEvent("beforeAnimateOut");\r
+\r
+       this.animateInCompleteEvent = new YAHOO.util.CustomEvent("animateInComplete");\r
+       this.animateOutCompleteEvent = new YAHOO.util.CustomEvent("animateOutComplete");\r
+\r
+       this.animIn = new this.animClass(this.targetElement, this.attrIn.attributes, this.attrIn.duration, this.attrIn.method);\r
+       this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);\r
+       this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);\r
+       this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, this);\r
+\r
+       this.animOut = new this.animClass(this.targetElement, this.attrOut.attributes, this.attrOut.duration, this.attrOut.method);\r
+       this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);\r
+       this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);\r
+       this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, this);\r
+};\r
 \r
 /**\r
-* Enables the KeyListener, by dynamically attaching the key event to the appropriate DOM element.\r
+* Triggers the in-animation.\r
+* @method animateIn\r
 */\r
-YAHOO.util.KeyListener.prototype.enable = function() {};\r
+YAHOO.widget.ContainerEffect.prototype.animateIn = function() {\r
+       this.beforeAnimateInEvent.fire();\r
+       this.animIn.animate();\r
+};\r
 \r
 /**\r
-* Disables the KeyListener, by dynamically removing the key event from the appropriate DOM element.\r
+* Triggers the out-animation.\r
+* @method animateOut\r
 */\r
-YAHOO.util.KeyListener.prototype.disable = function() {};\r
+YAHOO.widget.ContainerEffect.prototype.animateOut = function() {\r
+       this.beforeAnimateOutEvent.fire();\r
+       this.animOut.animate();\r
+};\r
 \r
 /**\r
-* CustomEvent fired when the KeyListener is enabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
+* The default onStart handler for the in-animation.\r
+* @method handleStartAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };\r
+/**\r
+* The default onTween handler for the in-animation.\r
+* @method handleTweenAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.util.KeyListener.prototype.enabledEvent = null;\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };\r
+/**\r
+* The default onComplete handler for the in-animation.\r
+* @method handleCompleteAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };\r
 \r
 /**\r
-* CustomEvent fired when the KeyListener is disabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
+* The default onStart handler for the out-animation.\r
+* @method handleStartAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.util.KeyListener.prototype.disabledEvent = null;
\ No newline at end of file
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };\r
+/**\r
+* The default onTween handler for the out-animation.\r
+* @method handleTweenAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };\r
+/**\r
+* The default onComplete handler for the out-animation.\r
+* @method handleCompleteAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };\r
+\r
+/**\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     The string representation of the ContainerEffect\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.toString = function() {\r
+       var output = "ContainerEffect";\r
+       if (this.overlay) {\r
+               output += " [" + this.overlay.toString() + "]";\r
+       }\r
+       return output;\r
+};\r
+\r
+/**\r
+* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
+* @method FADE\r
+* @static\r
+* @param {Overlay}     The Overlay object to animate\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
+*/\r
+YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
+       var fade = new YAHOO.widget.ContainerEffect(overlay, { attributes:{opacity: {from:0, to:1}}, duration:dur, method:YAHOO.util.Easing.easeIn }, { attributes:{opacity: {to:0}}, duration:dur, method:YAHOO.util.Easing.easeOut}, overlay.element );\r
+\r
+       fade.handleStartAnimateIn = function(type,args,obj) {\r
+               YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
+\r
+               if (! obj.overlay.underlay) {\r
+                       obj.overlay.cfg.refireEvent("underlay");\r
+               }\r
+\r
+               if (obj.overlay.underlay) {\r
+                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");\r
+                       obj.overlay.underlay.style.filter = null;\r
+               }\r
+\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 0);\r
+       };\r
+\r
+       fade.handleCompleteAnimateIn = function(type,args,obj) {\r
+               YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
+\r
+               if (obj.overlay.element.style.filter) {\r
+                       obj.overlay.element.style.filter = null;\r
+               }\r
+\r
+               if (obj.overlay.underlay) {\r
+                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);\r
+               }\r
+\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+               obj.animateInCompleteEvent.fire();\r
+       };\r
+\r
+       fade.handleStartAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
+\r
+               if (obj.overlay.underlay) {\r
+                       obj.overlay.underlay.style.filter = null;\r
+               }\r
+       };\r
+\r
+       fade.handleCompleteAnimateOut =  function(type, args, obj) {\r
+               YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
+               if (obj.overlay.element.style.filter) {\r
+                       obj.overlay.element.style.filter = null;\r
+               }\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1);\r
+\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+\r
+               obj.animateOutCompleteEvent.fire();\r
+       };\r
+\r
+       fade.init();\r
+       return fade;\r
+};\r
+\r
+\r
+/**\r
+* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
+* @method SLIDE\r
+* @static\r
+* @param {Overlay}     The Overlay object to animate\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
+*/\r
+YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
+       var x = overlay.cfg.getProperty("x") || YAHOO.util.Dom.getX(overlay.element);\r
+       var y = overlay.cfg.getProperty("y") || YAHOO.util.Dom.getY(overlay.element);\r
+\r
+       var clientWidth = YAHOO.util.Dom.getClientWidth();\r
+       var offsetWidth = overlay.element.offsetWidth;\r
+\r
+       var slide = new YAHOO.widget.ContainerEffect(overlay, {\r
+                                                                                                                       attributes:{ points: { to:[x, y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeIn\r
+                                                                                                               },\r
+                                                                                                               {\r
+                                                                                                                       attributes:{ points: { to:[(clientWidth+25), y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeOut\r
+                                                                                                               },\r
+                                                                                                               overlay.element,\r
+                                                                                                               YAHOO.util.Motion);\r
+\r
+\r
+       slide.handleStartAnimateIn = function(type,args,obj) {\r
+               obj.overlay.element.style.left = (-25-offsetWidth) + "px";\r
+               obj.overlay.element.style.top  = y + "px";\r
+       };\r
+\r
+       slide.handleTweenAnimateIn = function(type, args, obj) {\r
+\r
+\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var currentX = pos[0];\r
+               var currentY = pos[1];\r
+\r
+               if (YAHOO.util.Dom.getStyle(obj.overlay.element, "visibility") == "hidden" && currentX < x) {\r
+                       YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
+               }\r
+\r
+               obj.overlay.cfg.setProperty("xy", [currentX,currentY], true);\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+       };\r
+\r
+       slide.handleCompleteAnimateIn = function(type, args, obj) {\r
+               obj.overlay.cfg.setProperty("xy", [x,y], true);\r
+               obj.startX = x;\r
+               obj.startY = y;\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+               obj.animateInCompleteEvent.fire();\r
+       };\r
+\r
+       slide.handleStartAnimateOut = function(type, args, obj) {\r
+               var vw = YAHOO.util.Dom.getViewportWidth();\r
+\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var yso = pos[1];\r
+\r
+               var currentTo = obj.animOut.attributes.points.to;\r
+               obj.animOut.attributes.points.to = [(vw+25), yso];\r
+       };\r
+\r
+       slide.handleTweenAnimateOut = function(type, args, obj) {\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var xto = pos[0];\r
+               var yto = pos[1];\r
+\r
+               obj.overlay.cfg.setProperty("xy", [xto,yto], true);\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+       };\r
+\r
+       slide.handleCompleteAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
+\r
+               obj.overlay.cfg.setProperty("xy", [x,y]);\r
+               obj.animateOutCompleteEvent.fire();\r
+       };\r
+\r
+       slide.init();\r
+       return slide;\r
+};
\ No newline at end of file
index 1b62d14462ee547d2401699ea996d7c7abb626af..fc368eeb68b89d8075e04cf1b2d203d3394888c8 100755 (executable)
@@ -1,49 +1,25 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}\r
-YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}\r
-YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}\r
-this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}\r
-this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}\r
-this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]\r
-if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
-return cfg;}\r
-this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}\r
-this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}\r
-this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}\r
-return true;}}else{return false;}}}\r
-this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}\r
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
+return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
+return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}\r
+return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}\r
 var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}\r
 if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}\r
 if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}\r
-return true;}else{return false;}}\r
-this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}\r
-this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}\r
-for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}\r
-this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}\r
-this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}\r
-this.queueInProgress=false;eventQueue=new Array();}\r
-this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}\r
-return true;}else{return false;}}\r
-this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}\r
-this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
-return output;}\r
-this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
-return output;}}\r
-YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}\r
-return false;}\r
-YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}\r
-YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},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("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
+return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}\r
+for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}\r
+this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}\r
+return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
+return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
+return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}\r
+return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},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("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
 if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}\r
 this.element=el;if(el.id){this.id=el.id;}\r
 var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}\r
 this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}\r
-this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}\r
+this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}\r
 resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}\r
 if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},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){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
 if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}\r
@@ -57,97 +33,67 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
 this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}\r
 this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}\r
 var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}\r
-if(element){element.appendChild(me.element);me.appendEvent.fire();}}\r
-if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}\r
+if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}\r
 if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}\r
 if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}\r
 if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}\r
 this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}\r
 if(parent){parent.removeChild(this.element);}\r
-this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},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();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}\r
-YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}\r
-YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}\r
-YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},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();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"\r
+YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
 if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}\r
-this.initEvent.fire(YAHOO.widget.Overlay);}\r
-YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}\r
-YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}\r
-YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}\r
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}\r
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}\r
-YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}\r
+this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}\r
+e=e.parentNode;}\r
+if(currentVis=="inherit"){currentVis="visible";}}\r
+var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}\r
 var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}\r
-if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}\r
-e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}\r
-if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}\r
-e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}\r
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}\r
-YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}\r
+if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}\r
+ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}\r
+if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}\r
+h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}\r
 if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}\r
-YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}\r
+if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}\r
 if(this.iframe){if(zIndex<=0){zIndex=1;}\r
 YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}\r
-YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}\r
-YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var 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]);}\r
-YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var 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");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}\r
-YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var 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");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}\r
-YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}\r
-var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}\r
-if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}\r
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}\r
+YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var 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]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var 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");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var 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");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}\r
+if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}\r
 var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}\r
 if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}\r
-var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
-YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}\r
+var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
+YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}\r
 var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}\r
-YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}\r
-this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}\r
-YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}\r
-YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}\r
-if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}\r
-YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}\r
+YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}\r
+this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}\r
+if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}\r
 if(!contextAlign){contextAlign=contextArgs[2];}\r
-if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}\r
-switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}\r
-YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}\r
-var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}\r
+if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}\r
 if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}\r
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}\r
-YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}\r
-YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}\r
-YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
-this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}\r
-YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}\r
-YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}\r
-YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}\r
-YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}\r
-YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}\r
-this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}\r
-this.overlays.sort(this.compareZIndexDesc);}}\r
-this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.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.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null\r
-o.blurEvent=null;o.focus=null;o.blur=null;}}\r
-this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}\r
-var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}\r
-if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}\r
-overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}\r
-var focusOnDomEvent=function(e,obj){overlay.focus();}\r
-var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}\r
+this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
+this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
+clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}\r
+clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}\r
+YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}\r
+this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.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.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}\r
+if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}\r
 this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}\r
-if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}\r
-return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}\r
-YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}\r
+if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}\r
+return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}\r
 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);}\r
 if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}\r
-function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;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){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}\r
+function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}\r
+if(!keyData.alt){keyData.alt=false;}\r
+if(!keyData.ctrl){keyData.ctrl=false;}\r
+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);}}}}\r
 this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}\r
-this.enabled=true;}\r
-this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}\r
-this.enabled=false;}\r
-this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}\r
-YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;\r
+this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}\r
+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.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}\r
+this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");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);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}\r
+return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}\r
+if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}\r
+YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
+if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}\r
+obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}\r
+YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.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=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}\r
+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=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};
\ No newline at end of file
index 834a642133f6bd3ab6594d6b6f19e6e30efb5921..5041a9635377754a50fd33c87700c96a6ceb7735 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version 0.12.0\r
 */\r
 \r
 /**\r
-* Config is a utility used within an object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
+* @class YAHOO.util.Config\r
 * @constructor\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config = function(owner) {\r
        if (owner) {\r
                this.init(owner);\r
        }\r
-}\r
+};\r
 \r
 YAHOO.util.Config.prototype = {\r
-       \r
-       /**\r
-       * Object reference to the owner of this Config object\r
-       * @type object\r
-       */\r
-       owner : null,\r
 \r
        /**\r
-       * Object reference to the owner of this Config object\r
-       * args: key, value\r
-       * @type YAHOO.util.CustomEvent\r
+       * Object reference to the owner of this Config Object\r
+       * @property owner\r
+       * @type Object\r
        */\r
-       configChangedEvent : null,\r
+       owner : null,\r
 \r
        /**\r
        * Boolean flag that specifies whether a queue is currently being executed\r
-       * @type boolean\r
+       * @property queueInProgress\r
+       * @type Boolean\r
        */\r
        queueInProgress : false,\r
 \r
-       /**\r
-       * Adds a property to the Config object's private config hash. \r
-       * @param {string}       key     The configuration property's name\r
-       * @param {object}       propertyObject  The object containing all of this property's arguments\r
-       */\r
-       addProperty : function(key, propertyObject){},\r
-\r
-       /**\r
-       * Returns a key-value configuration map of the values currently set in the Config object.\r
-       * @return {object} The current config, represented in a key-value map\r
-       */\r
-       getConfig : function(){},\r
-\r
-       /**\r
-       * Returns the value of specified property.\r
-       * @param {key}          The name of the property\r
-       * @return {object}      The value of the specified property\r
-       */\r
-       getProperty : function(key){},\r
-\r
-       /**\r
-       * Resets the specified property's value to its initial value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       resetProperty : function(key){},\r
-\r
-       /**\r
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @param {boolean}      Whether the value should be set silently, without firing the property event.\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */\r
-       setProperty : function(key,value,silent){},\r
-\r
-       /**\r
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
-       * moved from its current position to the end of the queue.\r
-       * @param {key}          The name of the property\r
-       * @param {value}        The value to set the property to\r
-       * @return {boolean}     true, if the set was successful, false if it failed.\r
-       */      \r
-       queueProperty : function(key,value){},\r
-\r
-       /**\r
-       * Fires the event for a property using the property's current value.\r
-       * @param {key}          The name of the property\r
-       */\r
-       refireEvent : function(key){},\r
-\r
-       /**\r
-       * Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.\r
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
-       * @param {object}       userConfig      The configuration object literal\r
-       * @param {boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
-       */\r
-       applyConfig : function(userConfig,init){},\r
-\r
-       /**\r
-       * Refires the events for all configuration properties using their current values.\r
-       */\r
-       refresh : function(){},\r
-\r
-       /**\r
-       * Fires the normalized list of queued property change events\r
-       */\r
-       fireQueue : function(){},\r
-\r
-       /**\r
-       * Subscribes an external handler to the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
-       * @param {boolean}      override        Optional. If true, will override "this" within the handler to map to the scope object passed into the method.\r
-       */      \r
-       subscribeToConfigEvent : function(key,handler,obj,override){},\r
 \r
        /**\r
-       * Unsubscribes an external handler from the change event for any given property. \r
-       * @param {string}       key                     The property name\r
-       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
-       * @param {object}       obj                     The object to use for scoping the event handler (see CustomEvent documentation)\r
+       * Validates that the value passed in is a Boolean.\r
+       * @method checkBoolean\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
-       unsubscribeFromConfigEvent: function(key,handler,obj){},\r
-\r
-       /**\r
-       * Validates that the value passed in is a boolean.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
-       */      \r
        checkBoolean: function(val) {\r
                if (typeof val == 'boolean') {\r
                        return true;\r
@@ -137,8 +50,9 @@ YAHOO.util.Config.prototype = {
 \r
        /**\r
        * Validates that the value passed in is a number.\r
-       * @param        {object}        val     The value to validate\r
-       * @return       {boolean}       true, if the value is valid\r
+       * @method checkNumber\r
+       * @param        {Object}        val     The value to validate\r
+       * @return       {Boolean}       true, if the value is valid\r
        */\r
        checkNumber: function(val) {\r
                if (isNaN(val)) {\r
@@ -147,31 +61,60 @@ YAHOO.util.Config.prototype = {
                        return true;\r
                }\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
-* Initializes the configuration object and all of its local members.\r
-* @param {object}      owner   The owner object to which this Config object belongs\r
+* Initializes the configuration Object and all of its local members.\r
+* @method init\r
+* @param {Object}      owner   The owner Object to which this Config Object belongs\r
 */\r
 YAHOO.util.Config.prototype.init = function(owner) {\r
 \r
        this.owner = owner;\r
+\r
+       /**\r
+       * Object reference to the owner of this Config Object\r
+       * @event configChangedEvent\r
+       */\r
        this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");\r
+\r
        this.queueInProgress = false;\r
 \r
        /* Private Members */\r
 \r
+       /**\r
+       * Maintains the local collection of configuration property objects and their specified values\r
+       * @property config\r
+       * @private\r
+       * @type Object\r
+       */\r
        var config = {};\r
+\r
+       /**\r
+       * Maintains the local collection of configuration property objects as they were initially applied.\r
+       * This object is used when resetting a property.\r
+       * @property initialConfig\r
+       * @private\r
+       * @type Object\r
+       */\r
        var initialConfig = {};\r
+\r
+       /**\r
+       * Maintains the local, normalized CustomEvent queue\r
+       * @property eventQueue\r
+       * @private\r
+       * @type Object\r
+       */\r
        var eventQueue = [];\r
 \r
        /**\r
+       * Fires a configuration property event using the specified value.\r
+       * @method fireEvent\r
        * @private\r
-       * Fires a configuration property event using the specified value. \r
-       * @param {string}       key                     The configuration property's name\r
-       * @param {value}        object          The value of the correct type for the property\r
-       */ \r
+       * @param {String}       key                     The configuration property's name\r
+       * @param {value}        Object          The value of the correct type for the property\r
+       */\r
        var fireEvent = function( key, value ) {\r
                key = key.toLowerCase();\r
 \r
@@ -179,10 +122,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
 \r
                if (typeof property != 'undefined' && property.event) {\r
                        property.event.fire(value);\r
-               }       \r
-       }\r
+               }\r
+       };\r
        /* End Private Members */\r
 \r
+       /**\r
+       * Adds a property to the Config Object's private config hash.\r
+       * @method addProperty\r
+       * @param {String}       key     The configuration property's name\r
+       * @param {Object}       propertyObject  The Object containing all of this property's arguments\r
+       */\r
        this.addProperty = function( key, propertyObject ) {\r
                key = key.toLowerCase();\r
 \r
@@ -196,25 +145,36 @@ YAHOO.util.Config.prototype.init = function(owner) {
                }\r
 \r
                this.setProperty(key, propertyObject.value, true);\r
-               \r
+\r
                if (! propertyObject.suppressEvent) {\r
                        this.queueProperty(key, propertyObject.value);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a key-value configuration map of the values currently set in the Config Object.\r
+       * @method getConfig\r
+       * @return {Object} The current config, represented in a key-value map\r
+       */\r
        this.getConfig = function() {\r
                var cfg = {};\r
-                       \r
+\r
                for (var prop in config) {\r
-                       var property = config[prop]\r
+                       var property = config[prop];\r
                        if (typeof property != 'undefined' && property.event) {\r
                                cfg[prop] = property.value;\r
                        }\r
                }\r
-               \r
+\r
                return cfg;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns the value of specified property.\r
+       * @method getProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Object}              The value of the specified property\r
+       */\r
        this.getProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -224,24 +184,41 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return undefined;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Resets the specified property's value to its initial value.\r
+       * @method resetProperty\r
+       * @param {String} key   The name of the property\r
+       * @return {Boolean} True is the property was reset, false if not\r
+       */\r
        this.resetProperty = function(key) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
                if (typeof property != 'undefined' && property.event) {\r
-                       this.setProperty(key, initialConfig[key].value);\r
+                       if (initialConfig[key] && initialConfig[key] != 'undefined')    {\r
+                               this.setProperty(key, initialConfig[key]);\r
+                       }\r
+                       return true;\r
                } else {\r
-                       return undefined;\r
+                       return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.\r
+       * @method setProperty\r
+       * @param {String} key           The name of the property\r
+       * @param {String} value         The value to set the property to\r
+       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.\r
+       * @return {Boolean}                     True, if the set was successful, false if it failed.\r
+       */\r
        this.setProperty = function(key, value, silent) {\r
                key = key.toLowerCase();\r
 \r
                if (this.queueInProgress && ! silent) {\r
-                       this.queueProperty(key,value); // Currently running through a queue... \r
+                       this.queueProperty(key,value); // Currently running through a queue...\r
                        return true;\r
                } else {\r
                        var property = config[key];\r
@@ -260,13 +237,21 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                return false;\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is\r
+       * moved from its current position to the end of the queue.\r
+       * @method queueProperty\r
+       * @param {String} key   The name of the property\r
+       * @param {String} value The value to set the property to\r
+       * @return {Boolean}             true, if the set was successful, false if it failed.\r
+       */\r
        this.queueProperty = function(key, value) {\r
                key = key.toLowerCase();\r
 \r
                var property = config[key];\r
-                                                       \r
+\r
                if (typeof property != 'undefined' && property.event) {\r
                        if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator\r
                                return false;\r
@@ -286,7 +271,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                        if (queueItem) {\r
                                                var queueItemKey = queueItem[0];\r
                                                var queueItemValue = queueItem[1];\r
-                                               \r
+\r
                                                if (queueItemKey.toLowerCase() == key) {\r
                                                        // found a dupe... push to end of queue, null current item, and break\r
                                                        eventQueue[i] = null;\r
@@ -296,7 +281,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                }\r
                                        }\r
                                }\r
-                               \r
+\r
                                if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue\r
                                        eventQueue.push([key, value]);\r
                                }\r
@@ -312,7 +297,7 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                                if (queueItemCheck) {\r
                                                        var queueItemCheckKey = queueItemCheck[0];\r
                                                        var queueItemCheckValue = queueItemCheck[1];\r
-                                                       \r
+\r
                                                        if ( queueItemCheckKey.toLowerCase() == supercedesCheck.toLowerCase() ) {\r
                                                                eventQueue.push([queueItemCheckKey, queueItemCheckValue]);\r
                                                                eventQueue[q] = null;\r
@@ -327,8 +312,13 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the event for a property using the property's current value.\r
+       * @method refireEvent\r
+       * @param {String} key   The name of the property\r
+       */\r
        this.refireEvent = function(key) {\r
                key = key.toLowerCase();\r
 \r
@@ -340,8 +330,15 @@ YAHOO.util.Config.prototype.init = function(owner) {
                                fireEvent(key, property.value);\r
                        }\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.\r
+       * Although the values will be set, fireQueue() must be called for their associated events to execute.\r
+       * @method applyConfig\r
+       * @param {Object}       userConfig      The configuration Object literal\r
+       * @param {Boolean}      init            When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.\r
+       */\r
        this.applyConfig = function(userConfig, init) {\r
                if (init) {\r
                        initialConfig = userConfig;\r
@@ -349,14 +346,22 @@ YAHOO.util.Config.prototype.init = function(owner) {
                for (var prop in userConfig) {\r
                        this.queueProperty(prop, userConfig[prop]);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Refires the events for all configuration properties using their current values.\r
+       * @method refresh\r
+       */\r
        this.refresh = function() {\r
                for (var prop in config) {\r
                        this.refireEvent(prop);\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Fires the normalized list of queued property change events\r
+       * @method fireQueue\r
+       */\r
        this.fireQueue = function() {\r
                this.queueInProgress = true;\r
                for (var i=0;i<eventQueue.length;i++) {\r
@@ -364,18 +369,27 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        if (queueItem) {\r
                                var key = queueItem[0];\r
                                var value = queueItem[1];\r
-                               \r
+\r
                                var property = config[key];\r
                                property.value = value;\r
 \r
                                fireEvent(key,value);\r
                        }\r
                }\r
-               \r
+\r
                this.queueInProgress = false;\r
-               eventQueue = new Array();\r
-       }\r
+               eventQueue = [];\r
+       };\r
 \r
+       /**\r
+       * Subscribes an external handler to the change event for any given property.\r
+       * @method subscribeToConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.\r
+       * @return {Boolean}                             True, if the subscription was successful, otherwise false.\r
+       */\r
        this.subscribeToConfigEvent = function(key, handler, obj, override) {\r
                key = key.toLowerCase();\r
 \r
@@ -388,9 +402,16 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
-\r
+       };\r
 \r
+       /**\r
+       * Unsubscribes an external handler from the change event for any given property.\r
+       * @method unsubscribeFromConfigEvent\r
+       * @param {String}       key                     The property name\r
+       * @param {Function}     handler         The handler function to use subscribe to the property's event\r
+       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)\r
+       * @return {Boolean}                             True, if the unsubscription was successful, otherwise false.\r
+       */\r
        this.unsubscribeFromConfigEvent = function(key, handler, obj) {\r
                key = key.toLowerCase();\r
 \r
@@ -400,16 +421,26 @@ YAHOO.util.Config.prototype.init = function(owner) {
                } else {\r
                        return false;\r
                }\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object\r
+       * @method toString\r
+       * @return {String}      The Config object in string format.\r
+       */\r
        this.toString = function() {\r
                var output = "Config";\r
                if (this.owner) {\r
                        output += " [" + this.owner.toString() + "]";\r
                }\r
                return output;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Returns a string representation of the Config object's current CustomEvent queue\r
+       * @method outputEventQueue\r
+       * @return {String}      The string list of CustomEvents currently queued for execution\r
+       */\r
        this.outputEventQueue = function() {\r
                var output = "";\r
                for (var q=0;q<eventQueue.length;q++) {\r
@@ -419,266 +450,262 @@ YAHOO.util.Config.prototype.init = function(owner) {
                        }\r
                }\r
                return output;\r
-       }\r
-}\r
+       };\r
+};\r
 \r
 /**\r
-* Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent\r
+* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent\r
+* @method YAHOO.util.Config.alreadySubscribed\r
+* @static\r
 * @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions\r
 * @param {Function}    fn      The function to look for in the subscribers list\r
-* @param {object}      obj     The execution scope object for the subscription\r
-* @return {boolean}    true, if the function/object pair is already subscribed to the CustomEvent passed in\r
+* @param {Object}      obj     The execution scope Object for the subscription\r
+* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in\r
 */\r
 YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {\r
        for (var e=0;e<evt.subscribers.length;e++) {\r
                var subsc = evt.subscribers[e];\r
                if (subsc && subsc.obj == obj && subsc.fn == fn) {\r
                        return true;\r
-                       break;\r
                }\r
        }\r
        return false;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class \r
+};\r
+\r
+/**\r
+*  The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
+* @module Container\r
+* @requires yahoo,dom,event,dragdrop,animation\r
+*/\r
+\r
+/**\r
 * Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @param {string}      el      The element ID representing the Module <em>OR</em>\r
-* @param {Element}     el      The element representing the Module\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+* @class Module\r
+* @namespace YAHOO.widget\r
 * @constructor\r
+* @param {String} el                   The element ID representing the Module <em>OR</em>\r
+* @param {HTMLElement} el              The element representing the Module\r
+* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
 */\r
 YAHOO.widget.Module = function(el, userConfig) {\r
-       if (el) { \r
-               this.init(el, userConfig); \r
+       if (el) {\r
+               this.init(el, userConfig);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the prefix path to use for non-secure images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";\r
 \r
 /**\r
 * Constant representing the prefix path to use for securely served images\r
-* @type string\r
+* @property YAHOO.widget.Module.IMG_ROOT_SSL\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";\r
 \r
 /**\r
 * Constant for the default CSS class name that represents a Module\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_MODULE\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_MODULE = "module";\r
 \r
 /**\r
 * Constant representing the module header\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_HEADER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_HEADER = "hd";\r
 \r
 /**\r
 * Constant representing the module body\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_BODY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_BODY = "bd";\r
 \r
 /**\r
 * Constant representing the module footer\r
-* @type string\r
+* @property YAHOO.widget.Module.CSS_FOOTER\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Module.CSS_FOOTER = "ft";\r
 \r
 /**\r
 * Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size\r
-* @type string\r
+* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = null;\r
+YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
 \r
 YAHOO.widget.Module.prototype = {\r
-\r
        /**\r
        * The class's constructor function\r
-       * @type function\r
+       * @property contructor\r
+       * @type Function\r
        */\r
        constructor : YAHOO.widget.Module,\r
 \r
        /**\r
        * The main module element that contains the header, body, and footer\r
-       * @type Element\r
+       * @property element\r
+       * @type HTMLElement\r
        */\r
-       element : null, \r
+       element : null,\r
 \r
        /**\r
        * The header element, denoted with CSS class "hd"\r
-       * @type Element\r
+       * @property header\r
+       * @type HTMLElement\r
        */\r
        header : null,\r
 \r
        /**\r
        * The body element, denoted with CSS class "bd"\r
-       * @type Element\r
+       * @property body\r
+       * @type HTMLElement\r
        */\r
        body : null,\r
 \r
        /**\r
        * The footer element, denoted with CSS class "ft"\r
-       * @type Element\r
+       * @property footer\r
+       * @type HTMLElement\r
        */\r
        footer : null,\r
 \r
        /**\r
        * The id of the element\r
-       * @type string\r
+       * @property id\r
+       * @type String\r
        */\r
        id : null,\r
 \r
        /**\r
-       * Array of elements\r
-       * @type Element[]\r
-       */\r
-       childNodesInDOM : null,\r
-\r
-       /**\r
-       * The string representing the image root\r
-       * @type string\r
+       * The String representing the image root\r
+       * @property imageRoot\r
+       * @type String\r
        */\r
        imageRoot : YAHOO.widget.Module.IMG_ROOT,\r
 \r
-       /**\r
-       * CustomEvent fired prior to class initalization.\r
-       * args: class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeInitEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after class initalization.\r
-       * args: class reference of the initializing class, such as this.initEvent.fire(YAHOO.widget.Module)\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       initEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is appended to the DOM\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       appendEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeRenderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is rendered\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       renderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the header content of the Module is modified\r
-       * args: string/element representing the new header content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeHeaderEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the body content of the Module is modified\r
-       * args: string/element representing the new body content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeBodyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the footer content of the Module is modified\r
-       * args: string/element representing the new footer content\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeFooterEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the content of the Module is modified\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       changeContentEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired when the Module is destroyed\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       destroyEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeShowEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired after the Module is shown\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       showEvent : null,\r
-\r
-       /**\r
-       * CustomEvent fired before the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       beforeHideEvent : null,\r
-       \r
-       /**\r
-       * CustomEvent fired after the Module is hidden\r
-       * args: none\r
-       * @type YAHOO.util.CustomEvent\r
-       */\r
-       hideEvent : null,\r
-               \r
        /**\r
        * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.\r
+       * @method initEvents\r
        */\r
        initEvents : function() {\r
 \r
-               this.beforeInitEvent            = new YAHOO.util.CustomEvent("beforeInit");\r
-               this.initEvent                          = new YAHOO.util.CustomEvent("init");\r
-\r
-               this.appendEvent                        = new YAHOO.util.CustomEvent("append");\r
-\r
-               this.beforeRenderEvent          = new YAHOO.util.CustomEvent("beforeRender");\r
-               this.renderEvent                        = new YAHOO.util.CustomEvent("render");\r
-\r
-               this.changeHeaderEvent          = new YAHOO.util.CustomEvent("changeHeader");\r
-               this.changeBodyEvent            = new YAHOO.util.CustomEvent("changeBody");\r
-               this.changeFooterEvent          = new YAHOO.util.CustomEvent("changeFooter");\r
-\r
-               this.changeContentEvent         = new YAHOO.util.CustomEvent("changeContent");\r
-\r
-               this.destroyEvent                       = new YAHOO.util.CustomEvent("destroy");\r
-               this.beforeShowEvent            = new YAHOO.util.CustomEvent("beforeShow");\r
-               this.showEvent                          = new YAHOO.util.CustomEvent("show");\r
-               this.beforeHideEvent            = new YAHOO.util.CustomEvent("beforeHide");\r
-               this.hideEvent                          = new YAHOO.util.CustomEvent("hide");\r
-       }, \r
+               /**\r
+               * CustomEvent fired prior to class initalization.\r
+               * @event beforeInitEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");\r
+\r
+               /**\r
+               * CustomEvent fired after class initalization.\r
+               * @event initEvent\r
+               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)\r
+               */\r
+               this.initEvent = new YAHOO.util.CustomEvent("init");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is appended to the DOM\r
+               * @event appendEvent\r
+               */\r
+               this.appendEvent = new YAHOO.util.CustomEvent("append");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is rendered\r
+               * @event beforeRenderEvent\r
+               */\r
+               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is rendered\r
+               * @event renderEvent\r
+               */\r
+               this.renderEvent = new YAHOO.util.CustomEvent("render");\r
+\r
+               /**\r
+               * CustomEvent fired when the header content of the Module is modified\r
+               * @event changeHeaderEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new header content\r
+               */\r
+               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");\r
+\r
+               /**\r
+               * CustomEvent fired when the body content of the Module is modified\r
+               * @event changeBodyEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new body content\r
+               */\r
+               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");\r
+\r
+               /**\r
+               * CustomEvent fired when the footer content of the Module is modified\r
+               * @event changeFooterEvent\r
+               * @param {String/HTMLElement} content   String/element representing the new footer content\r
+               */\r
+               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");\r
+\r
+               /**\r
+               * CustomEvent fired when the content of the Module is modified\r
+               * @event changeContentEvent\r
+               */\r
+               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");\r
+\r
+               /**\r
+               * CustomEvent fired when the Module is destroyed\r
+               * @event destroyEvent\r
+               */\r
+               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is shown\r
+               * @event beforeShowEvent\r
+               */\r
+               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is shown\r
+               * @event showEvent\r
+               */\r
+               this.showEvent = new YAHOO.util.CustomEvent("show");\r
+\r
+               /**\r
+               * CustomEvent fired before the Module is hidden\r
+               * @event beforeHideEvent\r
+               */\r
+               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");\r
+\r
+               /**\r
+               * CustomEvent fired after the Module is hidden\r
+               * @event hideEvent\r
+               */\r
+               this.hideEvent = new YAHOO.util.CustomEvent("hide");\r
+       },\r
 \r
        /**\r
        * String representing the current user-agent platform\r
-       * @type string\r
+       * @property platform\r
+       * @type String\r
        */\r
        platform : function() {\r
                                        var ua = navigator.userAgent.toLowerCase();\r
@@ -693,7 +720,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * String representing the current user-agent browser\r
-       * @type string\r
+       * @property browser\r
+       * @type String\r
        */\r
        browser : function() {\r
                        var ua = navigator.userAgent.toLowerCase();\r
@@ -714,10 +742,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Boolean representing whether or not the current browsing context is secure (https)\r
-       * @type boolean\r
+       * @property isSecure\r
+       * @type Boolean\r
        */\r
        isSecure : function() {\r
-               if (window.location.href.toLowerCase().indexOf("https") == 0) {\r
+               if (window.location.href.toLowerCase().indexOf("https") === 0) {\r
                        return true;\r
                } else {\r
                        return false;\r
@@ -730,16 +759,37 @@ YAHOO.widget.Module.prototype = {
        initDefaultConfig : function() {\r
                // Add properties //\r
 \r
+               /**\r
+               * Specifies whether the Module is visible on the page.\r
+               * @config visible\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );\r
+\r
+               /**\r
+               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.\r
+               * @config effect\r
+               * @type Object\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );\r
+\r
+               /**\r
+               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document\r
+               * @config monitorresize\r
+               * @type Boolean\r
+               * @default true\r
+               */\r
                this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );\r
        },\r
 \r
        /**\r
        * The Module class's initialization method, which is executed for Module and all of its subclasses. 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.\r
-       * @param {string}       el      The element ID representing the Module <em>OR</em>\r
-       * @param {Element}      el      The element representing the Module\r
-       * @param {object}       userConfig      The configuration object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
+       * @method init\r
+       * @param {String}       el      The element ID representing the Module <em>OR</em>\r
+       * @param {HTMLElement}  el      The element representing the Module\r
+       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.\r
        */\r
        init : function(el, userConfig) {\r
 \r
@@ -747,8 +797,13 @@ YAHOO.widget.Module.prototype = {
 \r
                this.beforeInitEvent.fire(YAHOO.widget.Module);\r
 \r
+               /**\r
+               * The Module's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
-               \r
+\r
                if (this.isSecure) {\r
                        this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;\r
                }\r
@@ -764,10 +819,10 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                this.element = el;\r
-               \r
+\r
                if (el.id) {\r
                        this.id = el.id;\r
-               } \r
+               }\r
 \r
                var childNodes = this.element.childNodes;\r
 \r
@@ -806,93 +861,101 @@ YAHOO.widget.Module.prototype = {
        },\r
 \r
        /**\r
-       * Initialized an empty DOM element that is placed out of the visible area that can be used to detect text resize.\r
+       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.\r
+       * @method initResizeMonitor\r
        */\r
        initResizeMonitor : function() {\r
 \r
         if(this.browser != "opera") {\r
 \r
             var resizeMonitor = document.getElementById("_yuiResizeMonitor");\r
-    \r
+\r
             if (! resizeMonitor) {\r
-    \r
+\r
                 resizeMonitor = document.createElement("iframe");\r
-    \r
+\r
                 var bIE = (this.browser.indexOf("ie") === 0);\r
-    \r
-                if(this.isSecure && this.RESIZE_MONITOR_SECURE_URL && bIE) {\r
-    \r
-                    resizeMonitor.src = this.RESIZE_MONITOR_SECURE_URL;\r
-    \r
+\r
+                if(this.isSecure &&\r
+                   YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL &&\r
+                   bIE) {\r
+\r
+                  resizeMonitor.src =\r
+                       YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;\r
+\r
                 }\r
-                \r
+\r
                 resizeMonitor.id = "_yuiResizeMonitor";\r
                 resizeMonitor.style.visibility = "hidden";\r
-                \r
+\r
                 document.body.appendChild(resizeMonitor);\r
-    \r
+\r
                 resizeMonitor.style.width = "10em";\r
                 resizeMonitor.style.height = "10em";\r
                 resizeMonitor.style.position = "absolute";\r
-                \r
+\r
                 var nLeft = -1 * resizeMonitor.offsetWidth,\r
                     nTop = -1 * resizeMonitor.offsetHeight;\r
-    \r
+\r
                 resizeMonitor.style.top = nTop + "px";\r
                 resizeMonitor.style.left =  nLeft + "px";\r
                 resizeMonitor.style.borderStyle = "none";\r
                 resizeMonitor.style.borderWidth = "0";\r
                 YAHOO.util.Dom.setStyle(resizeMonitor, "opacity", "0");\r
-                \r
+\r
                 resizeMonitor.style.visibility = "visible";\r
-    \r
+\r
                 if(!bIE) {\r
-    \r
+\r
                     var doc = resizeMonitor.contentWindow.document;\r
-    \r
+\r
                     doc.open();\r
                     doc.close();\r
-                \r
+\r
                 }\r
-    \r
+\r
             }\r
-    \r
+\r
             if(resizeMonitor && resizeMonitor.contentWindow) {\r
-    \r
+\r
                 this.resizeMonitor = resizeMonitor;\r
-    \r
+\r
                 YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
-    \r
+\r
             }\r
-        \r
+\r
         }\r
 \r
        },\r
 \r
        /**\r
        * Event handler fired when the resize monitor element is resized.\r
+       * @method onDomResize\r
+       * @param {DOMEvent} e   The DOM resize event\r
+       * @param {Object} obj   The scope object passed to the handler\r
        */\r
-       onDomResize : function(e, obj) { \r
+       onDomResize : function(e, obj) {\r
 \r
         var nLeft = -1 * this.resizeMonitor.offsetWidth,\r
             nTop = -1 * this.resizeMonitor.offsetHeight;\r
-        \r
+\r
         this.resizeMonitor.style.top = nTop + "px";\r
         this.resizeMonitor.style.left =  nLeft + "px";\r
-       \r
+\r
        },\r
 \r
        /**\r
        * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {string}       headerContent   The HTML used to set the header <em>OR</em>\r
-       * @param {Element}      headerContent   The Element to append to the header\r
-       */      \r
+       * @method setHeader\r
+       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>\r
+       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header\r
+       */\r
        setHeader : function(headerContent) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                if (typeof headerContent == "string") {\r
                        this.header.innerHTML = headerContent;\r
                } else {\r
@@ -906,14 +969,15 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the header. If no header is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the header\r
-       */      \r
+       * @method appendToHeader\r
+       * @param {HTMLElement}  element The element to append to the header\r
+       */\r
        appendToHeader : function(element) {\r
                if (! this.header) {\r
                        this.header = document.createElement("DIV");\r
                        this.header.className = YAHOO.widget.Module.CSS_HEADER;\r
                }\r
-               \r
+\r
                this.header.appendChild(element);\r
                this.changeHeaderEvent.fire(element);\r
                this.changeContentEvent.fire();\r
@@ -921,9 +985,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       bodyContent     The HTML used to set the body <em>OR</em>\r
-       * @param {Element}      bodyContent     The Element to append to the body\r
-       */              \r
+       * @method setBody\r
+       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>\r
+       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body\r
+       */\r
        setBody : function(bodyContent) {\r
                if (! this.body) {\r
                        this.body = document.createElement("DIV");\r
@@ -944,7 +1009,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the body. If no body is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the body\r
+       * @method appendToBody\r
+       * @param {HTMLElement}  element The element to append to the body\r
        */\r
        appendToBody : function(element) {\r
                if (! this.body) {\r
@@ -959,9 +1025,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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.\r
-       * @param {string}       footerContent   The HTML used to set the footer <em>OR</em>\r
-       * @param {Element}      footerContent   The Element to append to the footer\r
-       */      \r
+       * @method setFooter\r
+       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>\r
+       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer\r
+       */\r
        setFooter : function(footerContent) {\r
                if (! this.footer) {\r
                        this.footer = document.createElement("DIV");\r
@@ -981,7 +1048,8 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Appends the passed element to the footer. If no footer is present, one will be automatically created.\r
-       * @param {Element}      element The element to append to the footer\r
+       * @method appendToFooter\r
+       * @param {HTMLElement}  element The element to append to the footer\r
        */\r
        appendToFooter : function(element) {\r
                if (! this.footer) {\r
@@ -996,10 +1064,11 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * 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 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.\r
-       * @param {string}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
-       * @param {Element}      appendToNode    The element to which the Module should be appended to prior to rendering        \r
-       * @param {Element}      moduleElement   OPTIONAL. The element that represents the actual Standard Module container. \r
-       * @return {boolean} Success or failure of the render\r
+       * @method render\r
+       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>\r
+       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering\r
+       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container.\r
+       * @return {Boolean} Success or failure of the render\r
        */\r
        render : function(appendToNode, moduleElement) {\r
                this.beforeRenderEvent.fire();\r
@@ -1013,12 +1082,12 @@ YAHOO.widget.Module.prototype = {
                        if (typeof element == "string") {\r
                                element = document.getElementById(element);\r
                        }\r
-                       \r
+\r
                        if (element) {\r
                                element.appendChild(me.element);\r
                                me.appendEvent.fire();\r
                        }\r
-               }\r
+               };\r
 \r
                if (appendToNode) {\r
                        appendTo(appendToNode);\r
@@ -1029,7 +1098,7 @@ YAHOO.widget.Module.prototype = {
                }\r
 \r
                // Need to get everything into the DOM if it isn't already\r
-               \r
+\r
                if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {\r
                        // There is a header, but it's not in the DOM yet... need to add it\r
                        var firstChild = moduleElement.firstChild;\r
@@ -1060,6 +1129,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Removes the Module element from the DOM and sets all child elements to null.\r
+       * @method destroy\r
        */\r
        destroy : function() {\r
                if (this.element) {\r
@@ -1079,6 +1149,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Shows the Module element by setting the visible configuration property to true. Also fires two events: beforeShowEvent prior to the visibility change, and showEvent after.\r
+       * @method show\r
        */\r
        show : function() {\r
                this.cfg.setProperty("visible", true);\r
@@ -1086,6 +1157,7 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Hides the Module element by setting the visible configuration property to false. Also fires two events: beforeHideEvent prior to the visibility change, and hideEvent after.\r
+       * @method hide\r
        */\r
        hide : function() {\r
                this.cfg.setProperty("visible", false);\r
@@ -1096,6 +1168,10 @@ YAHOO.widget.Module.prototype = {
        /**\r
        * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".\r
        * This method is responsible for firing showEvent and hideEvent.\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configVisible\r
        */\r
        configVisible : function(type, args, obj) {\r
                var visible = args[0];\r
@@ -1112,6 +1188,10 @@ YAHOO.widget.Module.prototype = {
 \r
        /**\r
        * Default event handler for the "monitorresize" configuration property\r
+       * @param {String} type  The CustomEvent type (usually the property name)\r
+       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.\r
+       * @method configMonitorResize\r
        */\r
        configMonitorResize : function(type, args, obj) {\r
                var monitor = args[0];\r
@@ -1122,95 +1202,97 @@ YAHOO.widget.Module.prototype = {
                        this.resizeMonitor = null;\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the Object.\r
+* @method toString\r
+* @return {String}     The string representation of the Module\r
+*/\r
 YAHOO.widget.Module.prototype.toString = function() {\r
        return "Module " + this.id;\r
-}/**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
+};\r
+\r
+/**\r
+* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
+* @class Overlay\r
+* @namespace YAHOO.widget\r
+* @extends YAHOO.widget.Module\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 * @constructor\r
 */\r
 YAHOO.widget.Overlay = function(el, userConfig) {\r
        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);\r
-}\r
+};\r
 \r
 YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);\r
 \r
 /**\r
-* The URL of the blank image that will be placed in the iframe\r
-* @type string\r
+* The URL that will be placed in the iframe\r
+* @property YAHOO.widget.Overlay.IFRAME_SRC\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
-YAHOO.widget.Overlay.IFRAME_SRC = "promo/m/irs/blank.gif";\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
 \r
 /**\r
 * Constant representing the top left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_LEFT = "tl";\r
 \r
 /**\r
 * Constant representing the top right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.TOP_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.TOP_RIGHT = "tr";\r
 \r
 /**\r
 * Constant representing the top bottom left corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_LEFT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";\r
 \r
 /**\r
 * Constant representing the bottom right corner of an element, used for configuring the context element alignment\r
-* @type string\r
+* @property YAHOO.widget.Overlay.BOTTOM_RIGHT\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";\r
 \r
 /**\r
 * Constant representing the default CSS class used for an Overlay\r
-* @type string\r
+* @property YAHOO.widget.Overlay.CSS_OVERLAY\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";\r
 \r
 /**\r
-* CustomEvent fired before the Overlay is moved.\r
-* args: x,y that the Overlay will be moved to\r
-* @type YAHOO.util.CustomEvent\r
+* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
+* @method init\r
+* @param {String}      el      The element ID representing the Overlay <em>OR</em>\r
+* @param {HTMLElement} el      The element representing the Overlay\r
+* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
 */\r
-YAHOO.widget.Overlay.prototype.beforeMoveEvent = null;\r
+YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
+       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
 \r
-/**\r
-* CustomEvent fired after the Overlay is moved.\r
-* args: x,y that the Overlay was moved to\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.Overlay.prototype.moveEvent = null;\r
-\r
-/**\r
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. 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.\r
-* @param {string}      el      The element ID representing the Overlay <em>OR</em>\r
-* @param {Element}     el      The element representing the Overlay\r
-* @param {object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.\r
-*/\r
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {\r
-       YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level\r
-       \r
        this.beforeInitEvent.fire(YAHOO.widget.Overlay);\r
 \r
        YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);\r
@@ -1229,81 +1311,181 @@ YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
        }\r
 \r
        this.initEvent.fire(YAHOO.widget.Overlay);\r
-\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.\r
+* @method initEvents\r
 */\r
 YAHOO.widget.Overlay.prototype.initEvents = function() {\r
        YAHOO.widget.Overlay.superclass.initEvents.call(this);\r
 \r
+       /**\r
+       * CustomEvent fired before the Overlay is moved.\r
+       * @event beforeMoveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);\r
+\r
+       /**\r
+       * CustomEvent fired after the Overlay is moved.\r
+       * @event moveEvent\r
+       * @param {Number} x     x coordinate\r
+       * @param {Number} y     y coordinate\r
+       */\r
        this.moveEvent = new YAHOO.util.CustomEvent("move", this);\r
-}\r
+};\r
 \r
 /**\r
 * Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).\r
+* @method initDefaultConfig\r
 */\r
 YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {\r
        YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);\r
 \r
        // Add overlay config properties //\r
+\r
+       /**\r
+       * The absolute x-coordinate position of the Overlay\r
+       * @config x\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * The absolute y-coordinate position of the Overlay\r
+       * @config y\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * An array with the absolute x and y positions of the Overlay\r
+       * @config xy\r
+       * @type Number[]\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * The 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 Overlay's top left corner to the context element's bottom left corner.\r
+       * @config context\r
+       * @type Array\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * True if the Overlay should be anchored to the center of the viewport.\r
+       * @config fixedcenter\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );\r
 \r
+       /**\r
+       * CSS width of the Overlay.\r
+       * @config width\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );\r
+\r
+       /**\r
+       * CSS height of the Overlay.\r
+       * @config height\r
+       * @type String\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );\r
 \r
+       /**\r
+       * CSS z-index of the Overlay.\r
+       * @config zIndex\r
+       * @type Number\r
+       * @default null\r
+       */\r
        this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );\r
 \r
+       /**\r
+       * True if the Overlay should be prevented from being positioned out of the viewport.\r
+       * @config constraintoviewport\r
+       * @type Boolean\r
+       * @default false\r
+       */\r
        this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );\r
+\r
+       /**\r
+       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).\r
+       * @config iframe\r
+       * @type Boolean\r
+       * @default true for IE6 and below, false for all others\r
+       */\r
        this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );\r
-}\r
+};\r
 \r
 /**\r
 * Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);\r
-* @param {int} x       The Overlay's new x position\r
-* @param {int} y       The Overlay's new y position\r
+* @method moveTo\r
+* @param {Number}      x       The Overlay's new x position\r
+* @param {Number}      y       The Overlay's new y position\r
 */\r
 YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {\r
        this.cfg.setProperty("xy",[x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method hideMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");\r
-}\r
+};\r
 \r
 /**\r
 * Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where\r
 * scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435\r
+* @method showMacGeckoScrollbars\r
 */\r
 YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {\r
        YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");\r
        YAHOO.util.Dom.addClass(this.element, "show-scrollbars");\r
-}\r
+};\r
 \r
 // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.\r
+* @method configVisible\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {\r
        var visible = args[0];\r
+\r
        var currentVis = YAHOO.util.Dom.getStyle(this.element, "visibility");\r
 \r
+       if (currentVis == "inherit") {\r
+               var e = this.element.parentNode;\r
+               while (e.nodeType != 9 && e.nodeType != 11) {\r
+                       currentVis = YAHOO.util.Dom.getStyle(e, "visibility");\r
+                       if (currentVis != "inherit") { break; }\r
+                       e = e.parentNode;\r
+               }\r
+               if (currentVis == "inherit") {\r
+                       currentVis = "visible";\r
+               }\r
+       }\r
+\r
        var effect = this.cfg.getProperty("effect");\r
 \r
-       var effectInstances = new Array();\r
+       var effectInstances = [];\r
        if (effect) {\r
                if (effect instanceof Array) {\r
                        for (var i=0;i<effect.length;i++) {\r
@@ -1320,23 +1502,23 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        if (visible) { // Show\r
                if (isMacGecko) {\r
                        this.showMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate in\r
                        if (visible) { // Animate in if not showing\r
-                               if (currentVis != "visible") {\r
+                               if (currentVis != "visible" || currentVis === "") {\r
                                        this.beforeShowEvent.fire();\r
-                                       for (var i=0;i<effectInstances.length;i++) {\r
-                                               var e = effectInstances[i];\r
-                                               if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
-                                                       e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
+                                       for (var j=0;j<effectInstances.length;j++) {\r
+                                               var ei = effectInstances[j];\r
+                                               if (j === 0 && ! YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {\r
+                                                       ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete\r
                                                }\r
-                                               e.animateIn();\r
+                                               ei.animateIn();\r
                                        }\r
                                }\r
                        }\r
                } else { // Show\r
-                       if (currentVis != "visible") {\r
+                       if (currentVis != "visible" || currentVis === "") {\r
                                this.beforeShowEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");\r
                                this.cfg.refireEvent("iframe");\r
@@ -1347,52 +1529,59 @@ YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
        } else { // Hide\r
                if (isMacGecko) {\r
                        this.hideMacGeckoScrollbars();\r
-               }       \r
+               }\r
 \r
                if (effect) { // Animate out if showing\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible") {\r
                                this.beforeHideEvent.fire();\r
-                               for (var i=0;i<effectInstances.length;i++) {\r
-                                       var e = effectInstances[i];\r
-                                       if (i == 0 && ! YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {                            \r
-                                               e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
+                               for (var k=0;k<effectInstances.length;k++) {\r
+                                       var h = effectInstances[k];\r
+                                       if (k === 0 && ! YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {\r
+                                               h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete\r
                                        }\r
-                                       e.animateOut();\r
+                                       h.animateOut();\r
                                }\r
+                       } else if (currentVis === "") {\r
+                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                        }\r
                } else { // Simple hide\r
-                       if (currentVis != "hidden") {\r
+                       if (currentVis == "visible" || currentVis === "") {\r
                                this.beforeHideEvent.fire();\r
                                YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");\r
                                this.cfg.refireEvent("iframe");\r
                                this.hideEvent.fire();\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * Center event handler used for centering on scroll/resize, but only if the Overlay is visible\r
+* @method doCenterOnDOMEvent\r
 */\r
 YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {\r
        if (this.cfg.getProperty("visible")) {\r
                this.center();\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "fixedcenter" property is changed.\r
+* @method configFixedCenter\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {\r
        var val = args[0];\r
 \r
        if (val) {\r
                this.center();\r
-                       \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent, this.center, this)) {\r
                        this.beforeShowEvent.subscribe(this.center, this, true);\r
                }\r
-               \r
+\r
                if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {\r
                        YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);\r
                }\r
@@ -1404,30 +1593,42 @@ YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {
                YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
                YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "height" property is changed.\r
+* @method configHeight\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configHeight = function(type, args, obj) {\r
        var height = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "height", height);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "width" property is changed.\r
+* @method configWidth\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configWidth = function(type, args, obj) {\r
        var width = args[0];\r
        var el = this.element;\r
        YAHOO.util.Dom.setStyle(el, "width", width);\r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "zIndex" property is changed.\r
+* @method configzIndex\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {\r
        var zIndex = args[0];\r
@@ -1450,10 +1651,14 @@ YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {
 \r
        YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);\r
        this.cfg.setProperty("zIndex", zIndex, true);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "xy" property is changed.\r
+* @method configXY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1470,10 +1675,14 @@ YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x,y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "x" property is changed.\r
+* @method configX\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {\r
        var x = args[0];\r
@@ -1488,15 +1697,19 @@ YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
        y = this.cfg.getProperty("y");\r
 \r
        YAHOO.util.Dom.setX(this.element, x, true);\r
-       \r
+\r
        this.cfg.setProperty("xy", [x, y], true);\r
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "y" property is changed.\r
+* @method configY\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {\r
        var x = this.cfg.getProperty("x");\r
@@ -1516,36 +1729,46 @@ YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
 \r
        this.cfg.refireEvent("iframe");\r
        this.moveEvent.fire([x, y]);\r
-}\r
+};\r
+\r
+/**\r
+* Shows the iframe shim, if it has been enabled\r
+* @method showIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.showIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "block";\r
+       }\r
+};\r
+\r
+/**\r
+* Hides the iframe shim, if it has been enabled\r
+* @method hideIframe\r
+*/\r
+YAHOO.widget.Overlay.prototype.hideIframe = function() {\r
+       if (this.iframe) {\r
+               this.iframe.style.display = "none";\r
+       }\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "iframe" property is changed.\r
+* @method configIframe\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {\r
 \r
        var val = args[0];\r
 \r
-       var el = this.element;\r
-       \r
-       var showIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "block";\r
-               }\r
-       }\r
-\r
-       var hideIframe = function() {\r
-               if (this.iframe) {\r
-                       this.iframe.style.display = "none";\r
-               }\r
-       }\r
-\r
        if (val) { // IFRAME shim is enabled\r
 \r
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, showIframe, this)) {\r
-                       this.showEvent.subscribe(showIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {\r
+                       this.showEvent.subscribe(this.showIframe, this, true);\r
                }\r
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, hideIframe, this)) {\r
-                       this.hideEvent.subscribe(hideIframe, this, true);\r
+               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {\r
+                       this.hideEvent.subscribe(this.hideIframe, this, true);\r
                }\r
 \r
                var x = this.cfg.getProperty("x");\r
@@ -1563,8 +1786,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                if (this.isSecure) {\r
                                        this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
                                }\r
-                               \r
-                               var parent = el.parentNode;\r
+\r
+                               var parent = this.element.parentNode;\r
                                if (parent) {\r
                                        parent.appendChild(this.iframe);\r
                                } else {\r
@@ -1577,12 +1800,12 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                                YAHOO.util.Dom.setStyle(this.iframe, "padding", "0");\r
                                YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");\r
                                if (this.cfg.getProperty("visible")) {\r
-                                       showIframe.call(this);\r
+                                       this.showIframe();\r
                                } else {\r
-                                       hideIframe.call(this);\r
+                                       this.hideIframe();\r
                                }\r
                        }\r
-                       \r
+\r
                        var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");\r
 \r
                        if (iframeDisplay == "none") {\r
@@ -1591,8 +1814,8 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
 \r
                        YAHOO.util.Dom.setXY(this.iframe, [x,y]);\r
 \r
-                       var width = el.clientWidth;\r
-                       var height = el.clientHeight;\r
+                       var width = this.element.clientWidth;\r
+                       var height = this.element.clientHeight;\r
 \r
                        YAHOO.util.Dom.setStyle(this.iframe, "width", (width+2) + "px");\r
                        YAHOO.util.Dom.setStyle(this.iframe, "height", (height+2) + "px");\r
@@ -1605,14 +1828,18 @@ YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
                if (this.iframe) {\r
                        this.iframe.style.display = "none";\r
                }\r
-               this.showEvent.unsubscribe(showIframe, this);\r
-               this.hideEvent.unsubscribe(hideIframe, this);\r
+               this.showEvent.unsubscribe(this.showIframe, this);\r
+               this.hideEvent.unsubscribe(this.hideIframe, this);\r
        }\r
-}\r
+};\r
 \r
 \r
 /**\r
 * The default event handler fired when the "constraintoviewport" property is changed.\r
+* @method configConstrainToViewport\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args, obj) {\r
        var val = args[0];\r
@@ -1623,10 +1850,14 @@ YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args,
        } else {\r
                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler fired when the "context" property is changed.\r
+* @method configContext\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {\r
        var contextArgs = args[0];\r
@@ -1640,27 +1871,28 @@ YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {
                        if (typeof contextEl == "string") {\r
                                this.cfg.setProperty("context", [document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner], true);\r
                        }\r
-                       \r
+\r
                        if (elementMagnetCorner && contextMagnetCorner) {\r
                                this.align(elementMagnetCorner, contextMagnetCorner);\r
                        }\r
-               }       \r
+               }\r
        }\r
-}\r
+};\r
 \r
 \r
 // END BUILT-IN PROPERTY EVENT HANDLERS //\r
 \r
 /**\r
 * Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.\r
-* @param {string} elementAlign         The string representing the corner of the Overlay that should be aligned to the context element\r
-* @param {string} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
+* @method align\r
+* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element\r
+* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.\r
 */\r
 YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {\r
        var contextArgs = this.cfg.getProperty("context");\r
        if (contextArgs) {\r
                var context = contextArgs[0];\r
-               \r
+\r
                var element = this.element;\r
                var me = this;\r
 \r
@@ -1691,7 +1923,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                                me.moveTo(h-element.offsetWidth,v-element.offsetHeight);\r
                                                break;\r
                                }\r
-                       }\r
+                       };\r
 \r
                        switch (contextAlign) {\r
                                case YAHOO.widget.Overlay.TOP_LEFT:\r
@@ -1699,7 +1931,7 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                                        break;\r
                                case YAHOO.widget.Overlay.TOP_RIGHT:\r
                                        doAlign(contextRegion.top, contextRegion.right);\r
-                                       break;          \r
+                                       break;\r
                                case YAHOO.widget.Overlay.BOTTOM_LEFT:\r
                                        doAlign(contextRegion.bottom, contextRegion.left);\r
                                        break;\r
@@ -1709,10 +1941,14 @@ YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
                        }\r
                }\r
        }\r
-}\r
+};\r
 \r
 /**\r
 * The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.\r
+* @method enforceConstraints\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.\r
 */\r
 YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {\r
        var pos = args[0];\r
@@ -1720,26 +1956,20 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        var x = pos[0];\r
        var y = pos[1];\r
 \r
-       var width = parseInt(this.cfg.getProperty("width"));\r
-\r
-       if (isNaN(width)) {\r
-               width = 0;\r
-       }\r
-\r
        var offsetHeight = this.element.offsetHeight;\r
-       var offsetWidth = (width>0?width:this.element.offsetWidth); //this.element.offsetWidth;\r
+       var offsetWidth = this.element.offsetWidth;\r
 \r
        var viewPortWidth = YAHOO.util.Dom.getViewportWidth();\r
        var viewPortHeight = YAHOO.util.Dom.getViewportHeight();\r
 \r
-       var scrollX = window.scrollX || document.documentElement.scrollLeft;\r
-       var scrollY = window.scrollY || document.documentElement.scrollTop;\r
+       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
+       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;\r
 \r
        var topConstraint = scrollY + 10;\r
        var leftConstraint = scrollX + 10;\r
        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-       \r
+\r
        if (x < leftConstraint) {\r
                x = leftConstraint;\r
        } else if (x > rightConstraint) {\r
@@ -1755,10 +1985,11 @@ YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
        this.cfg.setProperty("x", x, true);\r
        this.cfg.setProperty("y", y, true);\r
        this.cfg.setProperty("xy", [x,y], true);\r
-}\r
+};\r
 \r
 /**\r
 * Centers the container in the viewport.\r
+* @method center\r
 */\r
 YAHOO.widget.Overlay.prototype.center = function() {\r
        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r
@@ -1772,161 +2003,195 @@ YAHOO.widget.Overlay.prototype.center = function() {
 \r
        var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;\r
        var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;\r
-       \r
-       this.element.style.left = parseInt(x) + "px";\r
-       this.element.style.top = parseInt(y) + "px";\r
-       this.syncPosition();\r
+\r
+       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);\r
 \r
        this.cfg.refireEvent("iframe");\r
-}\r
+};\r
 \r
 /**\r
 * Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.\r
+* @method syncPosition\r
 */\r
 YAHOO.widget.Overlay.prototype.syncPosition = function() {\r
        var pos = YAHOO.util.Dom.getXY(this.element);\r
        this.cfg.setProperty("x", pos[0], true);\r
        this.cfg.setProperty("y", pos[1], true);\r
        this.cfg.setProperty("xy", pos, true);\r
-}\r
+};\r
 \r
 /**\r
 * Event handler fired when the resize monitor element is resized.\r
+* @method onDomResize\r
+* @param {DOMEvent} e  The resize DOM event\r
+* @param {Object} obj  The scope object\r
 */\r
 YAHOO.widget.Overlay.prototype.onDomResize = function(e, obj) {\r
        YAHOO.widget.Overlay.superclass.onDomResize.call(this, e, obj);\r
-       this.cfg.refireEvent("iframe");\r
-}\r
+       var me = this;\r
+       setTimeout(function() {\r
+               me.syncPosition();\r
+               me.cfg.refireEvent("iframe");\r
+               me.cfg.refireEvent("context");\r
+       }, 0);\r
+};\r
 \r
 /**\r
 * Removes the Overlay element from the DOM and sets all child elements to null.\r
+* @method destroy\r
 */\r
 YAHOO.widget.Overlay.prototype.destroy = function() {\r
        if (this.iframe) {\r
                this.iframe.parentNode.removeChild(this.iframe);\r
        }\r
-       \r
+\r
        this.iframe = null;\r
 \r
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  \r
+       YAHOO.widget.Overlay.superclass.destroy.call(this);\r
 };\r
 \r
 /**\r
-* Returns a string representation of the object.\r
-* @type string\r
-*/ \r
+* Returns a String representation of the object.\r
+* @method toString\r
+* @return {String} The string representation of the Overlay.\r
+*/\r
 YAHOO.widget.Overlay.prototype.toString = function() {\r
        return "Overlay " + this.id;\r
-}\r
+};\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window scroll\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowScrollEvent\r
 */\r
 YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");\r
 \r
 /**\r
 * A singleton CustomEvent used for reacting to the DOM event for window resize\r
-* @type YAHOO.util.CustomEvent\r
+* @event YAHOO.widget.Overlay.windowResizeEvent\r
 */\r
 YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window scroll\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowScrollHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM scroll event\r
 */\r
 YAHOO.widget.Overlay.windowScrollHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowScrollEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.scrollEnd) {\r
+                       window.scrollEnd = -1;\r
+               }\r
+               clearTimeout(window.scrollEnd);\r
+               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowScrollEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
 * The DOM event handler used to fire the CustomEvent for window resize\r
-* @type Function\r
+* @method YAHOO.widget.Overlay.windowResizeHandler\r
+* @static\r
+* @param {DOMEvent} e The DOM resize event\r
 */\r
 YAHOO.widget.Overlay.windowResizeHandler = function(e) {\r
-       YAHOO.widget.Overlay.windowResizeEvent.fire();\r
-}\r
+       if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {\r
+               if (! window.resizeEnd) {\r
+                       window.resizeEnd = -1;\r
+               }\r
+               clearTimeout(window.resizeEnd);\r
+               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);\r
+       } else {\r
+               YAHOO.widget.Overlay.windowResizeEvent.fire();\r
+       }\r
+};\r
 \r
 /**\r
+* A boolean that indicated whether the window resize and scroll events have already been subscribed to.\r
+* @property YAHOO.widget.Overlay._initialized\r
 * @private\r
+* @type Boolean\r
 */\r
-YAHOO.widget.Overlay._initialized == null;\r
+YAHOO.widget.Overlay._initialized = null;\r
 \r
-if (YAHOO.widget.Overlay._initialized == null) {\r
+if (YAHOO.widget.Overlay._initialized === null) {\r
        YAHOO.util.Event.addListener(window, "scroll", YAHOO.widget.Overlay.windowScrollHandler);\r
        YAHOO.util.Event.addListener(window, "resize", YAHOO.widget.Overlay.windowResizeHandler);\r
 \r
        YAHOO.widget.Overlay._initialized = true;\r
 }\r
+\r
 /**\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-* @class\r
-* OverlayManager is used for maintaining the focus status of multiple Overlays.\r
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
-* @param {object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
+* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget\r
+* @namespace YAHOO.widget\r
+* @class OverlayManager\r
 * @constructor\r
+* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.\r
+* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager\r
 */\r
 YAHOO.widget.OverlayManager = function(userConfig) {\r
        this.init(userConfig);\r
-}\r
+};\r
 \r
 /**\r
 * The CSS class representing a focused Overlay\r
-* @type string\r
+* @property YAHOO.widget.OverlayManager.CSS_FOCUSED\r
+* @static\r
+* @final\r
+* @type String\r
 */\r
 YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";\r
 \r
 YAHOO.widget.OverlayManager.prototype = {\r
-\r
+       /**\r
+       * The class's constructor function\r
+       * @property contructor\r
+       * @type Function\r
+       */\r
        constructor : YAHOO.widget.OverlayManager,\r
 \r
        /**\r
        * The array of Overlays that are currently registered\r
-       * @type Array\r
+       * @property overlays\r
+       * @type YAHOO.widget.Overlay[]\r
        */\r
        overlays : null,\r
 \r
        /**\r
        * Initializes the default configuration of the OverlayManager\r
-       */      \r
+       * @method initDefaultConfig\r
+       */\r
        initDefaultConfig : function() {\r
+               /**\r
+               * The collection of registered Overlays in use by the OverlayManager\r
+               * @config overlays\r
+               * @type YAHOO.widget.Overlay[]\r
+               * @default null\r
+               */\r
                this.cfg.addProperty("overlays", { suppressEvent:true } );\r
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
-       }, \r
 \r
-       /**\r
-       * Returns the currently focused Overlay\r
-       * @return {Overlay}     The currently focused Overlay\r
-       */\r
-       getActive : function() {},\r
-\r
-       /**\r
-       * Focuses the specified Overlay\r
-       * @param {Overlay}      The Overlay to focus\r
-       * @param {string}       The id of the Overlay to focus\r
-       */\r
-       focus : function(overlay) {},\r
-\r
-       /**\r
-       * Removes the specified Overlay from the manager\r
-       * @param {Overlay}      The Overlay to remove\r
-       * @param {string}       The id of the Overlay to remove\r
-       */\r
-       remove: function(overlay) {},\r
-\r
-       /**\r
-       * Removes focus from all registered Overlays in the manager\r
-       */\r
-       blurAll : function() {},\r
+               /**\r
+               * The default DOM event that should be used to focus an Overlay\r
+               * @config focusevent\r
+               * @type String\r
+               * @default "mousedown"\r
+               */\r
+               this.cfg.addProperty("focusevent", { value:"mousedown" } );\r
+       },\r
 \r
        /**\r
        * Initializes the OverlayManager\r
-       * @param {Array}        overlays        Optional. A collection of Overlays to register with the manager.\r
-       * @param {object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
+       * @method init\r
+       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.\r
+       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager\r
        */\r
        init : function(userConfig) {\r
+               /**\r
+               * The OverlayManager's Config object used for monitoring configuration properties.\r
+               * @property cfg\r
+               * @type YAHOO.util.Config\r
+               */\r
                this.cfg = new YAHOO.util.Config(this);\r
 \r
                this.initDefaultConfig();\r
@@ -1936,12 +2201,29 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
                this.cfg.fireQueue();\r
 \r
+               /**\r
+               * The currently activated Overlay\r
+               * @property activeOverlay\r
+               * @private\r
+               * @type YAHOO.widget.Overlay\r
+               */\r
                var activeOverlay = null;\r
 \r
+               /**\r
+               * Returns the currently focused Overlay\r
+               * @method getActive\r
+               * @return {YAHOO.widget.Overlay}        The currently focused Overlay\r
+               */\r
                this.getActive = function() {\r
                        return activeOverlay;\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Focuses the specified Overlay\r
+               * @method focus\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus\r
+               * @param {String} overlay       The id of the Overlay to focus\r
+               */\r
                this.focus = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1951,12 +2233,18 @@ YAHOO.widget.OverlayManager.prototype = {
                                this.overlays.sort(this.compareZIndexDesc);\r
                                var topZIndex = YAHOO.util.Dom.getStyle(this.overlays[0].element, "zIndex");\r
                                if (! isNaN(topZIndex) && this.overlays[0] != overlay) {\r
-                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex) + 1));\r
+                                       activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex, 10) + 2));\r
                                }\r
                                this.overlays.sort(this.compareZIndexDesc);\r
                        }\r
-               }\r
-\r
+               };\r
+\r
+               /**\r
+               * Removes the specified Overlay from the manager\r
+               * @method remove\r
+               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove\r
+               * @param {String} overlay       The id of the Overlay to remove\r
+               */\r
                this.remove = function(overlay) {\r
                        var o = this.find(overlay);\r
                        if (o) {\r
@@ -1967,24 +2255,28 @@ YAHOO.widget.OverlayManager.prototype = {
                                o.cfg.setProperty("zIndex", originalZ, true);\r
 \r
                                o.cfg.setProperty("manager", null);\r
-                               o.focusEvent = null\r
+                               o.focusEvent = null;\r
                                o.blurEvent = null;\r
                                o.focus = null;\r
                                o.blur = null;\r
                        }\r
-               }\r
+               };\r
 \r
+               /**\r
+               * Removes focus from all registered Overlays in the manager\r
+               * @method blurAll\r
+               */\r
                this.blurAll = function() {\r
                        activeOverlay = null;\r
                        for (var o=0;o<this.overlays.length;o++) {\r
                                YAHOO.util.Dom.removeClass(this.overlays[o].element, YAHOO.widget.OverlayManager.CSS_FOCUSED);\r
-                       }               \r
-               }\r
+                       }\r
+               };\r
 \r
                var overlays = this.cfg.getProperty("overlays");\r
-               \r
+\r
                if (! this.overlays) {\r
-                       this.overlays = new Array();\r
+                       this.overlays = [];\r
                }\r
 \r
                if (overlays) {\r
@@ -1995,9 +2287,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each.\r
-       * @param {Overlay}      overlay         An Overlay to register with the manager.\r
-       * @param {Overlay[]}    overlay         An array of Overlays to register with the manager.\r
-       * @return       {boolean}       True if any Overlays are registered.\r
+       * @method register\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.\r
+       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.\r
+       * @return       {Boolean}       True if any Overlays are registered.\r
        */\r
        register : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2005,33 +2298,33 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
                        overlay.focusEvent = new YAHOO.util.CustomEvent("focus");\r
                        overlay.blurEvent = new YAHOO.util.CustomEvent("blur");\r
-                       \r
+\r
                        var mgr=this;\r
 \r
                        overlay.focus = function() {\r
                                mgr.focus(this);\r
                                this.focusEvent.fire();\r
-                       } \r
+                       };\r
 \r
                        overlay.blur = function() {\r
                                mgr.blurAll();\r
                                this.blurEvent.fire();\r
-                       }\r
+                       };\r
 \r
                        var focusOnDomEvent = function(e,obj) {\r
                                overlay.focus();\r
-                       }\r
-                       \r
+                       };\r
+\r
                        var focusevent = this.cfg.getProperty("focusevent");\r
                        YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);\r
 \r
                        var zIndex = YAHOO.util.Dom.getStyle(overlay.element, "zIndex");\r
                        if (! isNaN(zIndex)) {\r
-                               overlay.cfg.setProperty("zIndex", parseInt(zIndex));\r
+                               overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));\r
                        } else {\r
                                overlay.cfg.setProperty("zIndex", 0);\r
                        }\r
-                       \r
+\r
                        this.overlays.push(overlay);\r
                        return true;\r
                } else if (overlay instanceof Array) {\r
@@ -2051,9 +2344,10 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Attempts to locate an Overlay by instance or ID.\r
-       * @param {Overlay}      overlay         An Overlay to locate within the manager\r
-       * @param {string}       overlay         An Overlay id to locate within the manager\r
-       * @return       {Overlay}       The requested Overlay, if found, or null if it cannot be located.\r
+       * @method find\r
+       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager\r
+       * @param {String}       overlay         An Overlay id to locate within the manager\r
+       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.\r
        */\r
        find : function(overlay) {\r
                if (overlay instanceof YAHOO.widget.Overlay) {\r
@@ -2063,18 +2357,20 @@ YAHOO.widget.OverlayManager.prototype = {
                                }\r
                        }\r
                } else if (typeof overlay == "string") {\r
-                       for (var o=0;o<this.overlays.length;o++) {\r
-                               if (this.overlays[o].id == overlay) {\r
-                                       return this.overlays[o];\r
+                       for (var p=0;p<this.overlays.length;p++) {\r
+                               if (this.overlays[p].id == overlay) {\r
+                                       return this.overlays[p];\r
                                }\r
-                       }                       \r
+                       }\r
                }\r
                return null;\r
        },\r
 \r
        /**\r
        * Used for sorting the manager's Overlays by z-index.\r
+       * @method compareZIndexDesc\r
        * @private\r
+       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.\r
        */\r
        compareZIndexDesc : function(o1, o2) {\r
                var zIndex1 = o1.cfg.getProperty("zIndex");\r
@@ -2091,6 +2387,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Shows all Overlays in the manager.\r
+       * @method showAll\r
        */\r
        showAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2100,6 +2397,7 @@ YAHOO.widget.OverlayManager.prototype = {
 \r
        /**\r
        * Hides all Overlays in the manager.\r
+       * @method hideAll\r
        */\r
        hideAll : function() {\r
                for (var o=0;o<this.overlays.length;o++) {\r
@@ -2107,35 +2405,55 @@ YAHOO.widget.OverlayManager.prototype = {
                }\r
        },\r
 \r
+\r
        /**\r
        * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * @method toString\r
+       * @return {String}      The string representation of the OverlayManager\r
+       */\r
        toString : function() {\r
                return "OverlayManager";\r
        }\r
 \r
-}/**\r
-* Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-* Code licensed under the BSD License:\r
-* http://developer.yahoo.net/yui/license.txt\r
+};\r
+\r
+/**\r
 * KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.\r
-* @param {Element}     attachTo        The element or element ID to which the key event should be attached\r
-* @param {string}      attachTo        The element or element ID to which the key event should be attached\r
-* @param {object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
-* @param {function}    handler         The CustomEvent handler to fire when the key event is detected\r
-* @param {object}      handler         An object literal representing the handler. \r
-* @param {string}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
+* @namespace YAHOO.util\r
+* @class KeyListener\r
 * @constructor\r
+* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached\r
+* @param {String}      attachTo        The element or element ID to which the key event should be attached\r
+* @param {Object}      keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected\r
+* @param {Object}      handler         An object literal representing the handler.\r
+* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.\r
 */\r
 YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {\r
        if (! event) {\r
                event = YAHOO.util.KeyListener.KEYDOWN;\r
        }\r
 \r
+       /**\r
+       * The CustomEvent fired internally when a key is pressed\r
+       * @event keyEvent\r
+       * @private\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        var keyEvent = new YAHOO.util.CustomEvent("keyPressed");\r
-       \r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is enabled via the enable() function\r
+       * @event enabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.enabledEvent = new YAHOO.util.CustomEvent("enabled");\r
+\r
+       /**\r
+       * The CustomEvent fired when the KeyListener is disabled via the disable() function\r
+       * @event disabledEvent\r
+       * @param {Object}       keyData         The object literal representing the key(s) to detect. Possible attributes are shift(boolean), alt(boolean), ctrl(boolean) and keys(either an int or an array of ints representing keycodes).\r
+       */\r
        this.disabledEvent = new YAHOO.util.CustomEvent("disabled");\r
 \r
        if (typeof attachTo == 'string') {\r
@@ -2150,99 +2468,417 @@ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
 \r
        /**\r
        * Handles the key event when a key is pressed.\r
+       * @method handleKeyPress\r
+       * @param {DOMEvent} e   The keypress DOM event\r
+       * @param {Object}       obj     The DOM event scope object\r
        * @private\r
        */\r
        function handleKeyPress(e, obj) {\r
-               var keyPressed = e.charCode || e.keyCode;\r
-               \r
-               if (! keyData.shift)    keyData.shift = false;\r
-               if (! keyData.alt)              keyData.alt = false;\r
-               if (! keyData.ctrl)             keyData.ctrl = false;\r
+               if (! keyData.shift) {\r
+                       keyData.shift = false;\r
+               }\r
+               if (! keyData.alt) {\r
+                       keyData.alt = false;\r
+               }\r
+               if (! keyData.ctrl) {\r
+                       keyData.ctrl = false;\r
+               }\r
 \r
                // check held down modifying keys first\r
-               if (e.shiftKey == keyData.shift && \r
+               if (e.shiftKey == keyData.shift &&\r
                        e.altKey   == keyData.alt &&\r
                        e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match\r
 \r
+                       var dataItem;\r
+                       var keyPressed;\r
+\r
                        if (keyData.keys instanceof Array) {\r
                                for (var i=0;i<keyData.keys.length;i++) {\r
-                                       if (keyPressed == keyData.keys[i]) {\r
-                                               keyEvent.fire(keyPressed, e);\r
+                                       dataItem = keyData.keys[i];\r
+\r
+                                       if (dataItem == e.charCode ) {\r
+                                               keyEvent.fire(e.charCode, e);\r
+                                               break;\r
+                                       } else if (dataItem == e.keyCode) {\r
+                                               keyEvent.fire(e.keyCode, e);\r
                                                break;\r
                                        }\r
                                }\r
                        } else {\r
-                               if (keyPressed == keyData.keys) {\r
-                                       keyEvent.fire(keyPressed, e);\r
+                               dataItem = keyData.keys;\r
+\r
+                               if (dataItem == e.charCode ) {\r
+                                       keyEvent.fire(e.charCode, e);\r
+                               } else if (dataItem == e.keyCode) {\r
+                                       keyEvent.fire(e.keyCode, e);\r
                                }\r
                        }\r
                }\r
        }\r
 \r
+       /**\r
+       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element\r
+       * @method enable\r
+       */\r
        this.enable = function() {\r
                if (! this.enabled) {\r
                        YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);\r
                        this.enabledEvent.fire(keyData);\r
                }\r
+               /**\r
+               * Boolean indicating the enabled/disabled state of the Tooltip\r
+               * @property enabled\r
+               * @type Boolean\r
+               */\r
                this.enabled = true;\r
-       }\r
+       };\r
 \r
+       /**\r
+       * Disables the KeyListener by removing the DOM event listeners from the target DOM element\r
+       * @method disable\r
+       */\r
        this.disable = function() {\r
                if (this.enabled) {\r
                        YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);\r
                        this.disabledEvent.fire(keyData);\r
                }\r
                this.enabled = false;\r
-       }\r
+       };\r
 \r
        /**\r
-       * Returns a string representation of the object.\r
-       * @type string\r
-       */ \r
+       * Returns a String representation of the object.\r
+       * @method toString\r
+       * @return {String}      The string representation of the KeyListener\r
+       */\r
        this.toString = function() {\r
                return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");\r
-       }\r
+       };\r
 \r
-}\r
+};\r
 \r
 /**\r
 * Constant representing the DOM "keydown" event.\r
+* @property YAHOO.util.KeyListener.KEYDOWN\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYDOWN = "keydown";\r
 \r
 /**\r
 * Constant representing the DOM "keyup" event.\r
+* @property YAHOO.util.KeyListener.KEYUP\r
+* @static\r
 * @final\r
+* @type String\r
 */\r
 YAHOO.util.KeyListener.KEYUP = "keyup";\r
 \r
 /**\r
-* Boolean indicating the enabled/disabled state of the Tooltip\r
-* @type Booleam\r
+* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.\r
+* @namespace YAHOO.widget\r
+* @class ContainerEffect\r
+* @constructor\r
+* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with\r
+* @param {Object}      attrIn          The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {Object}      attrOut         The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).\r
+* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.\r
+* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.\r
 */\r
-YAHOO.util.KeyListener.prototype.enabled = null;\r
+YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {\r
+       if (! animClass) {\r
+               animClass = YAHOO.util.Anim;\r
+       }\r
+\r
+       /**\r
+       * The overlay to animate\r
+       * @property overlay\r
+       * @type YAHOO.widget.Overlay\r
+       */\r
+       this.overlay = overlay;\r
+       /**\r
+       * The animation attributes to use when transitioning into view\r
+       * @property attrIn\r
+       * @type Object\r
+       */\r
+       this.attrIn = attrIn;\r
+       /**\r
+       * The animation attributes to use when transitioning out of view\r
+       * @property attrOut\r
+       * @type Object\r
+       */\r
+       this.attrOut = attrOut;\r
+       /**\r
+       * The target element to be animated\r
+       * @property targetElement\r
+       * @type HTMLElement\r
+       */\r
+       this.targetElement = targetElement || overlay.element;\r
+       /**\r
+       * The animation class to use for animating the overlay\r
+       * @property animClass\r
+       * @type class\r
+       */\r
+       this.animClass = animClass;\r
+};\r
+\r
+/**\r
+* Initializes the animation classes and events.\r
+* @method init\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.init = function() {\r
+       this.beforeAnimateInEvent = new YAHOO.util.CustomEvent("beforeAnimateIn");\r
+       this.beforeAnimateOutEvent = new YAHOO.util.CustomEvent("beforeAnimateOut");\r
+\r
+       this.animateInCompleteEvent = new YAHOO.util.CustomEvent("animateInComplete");\r
+       this.animateOutCompleteEvent = new YAHOO.util.CustomEvent("animateOutComplete");\r
+\r
+       this.animIn = new this.animClass(this.targetElement, this.attrIn.attributes, this.attrIn.duration, this.attrIn.method);\r
+       this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);\r
+       this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);\r
+       this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, this);\r
+\r
+       this.animOut = new this.animClass(this.targetElement, this.attrOut.attributes, this.attrOut.duration, this.attrOut.method);\r
+       this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);\r
+       this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);\r
+       this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, this);\r
+};\r
 \r
 /**\r
-* Enables the KeyListener, by dynamically attaching the key event to the appropriate DOM element.\r
+* Triggers the in-animation.\r
+* @method animateIn\r
 */\r
-YAHOO.util.KeyListener.prototype.enable = function() {};\r
+YAHOO.widget.ContainerEffect.prototype.animateIn = function() {\r
+       this.beforeAnimateInEvent.fire();\r
+       this.animIn.animate();\r
+};\r
 \r
 /**\r
-* Disables the KeyListener, by dynamically removing the key event from the appropriate DOM element.\r
+* Triggers the out-animation.\r
+* @method animateOut\r
 */\r
-YAHOO.util.KeyListener.prototype.disable = function() {};\r
+YAHOO.widget.ContainerEffect.prototype.animateOut = function() {\r
+       this.beforeAnimateOutEvent.fire();\r
+       this.animOut.animate();\r
+};\r
 \r
 /**\r
-* CustomEvent fired when the KeyListener is enabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
+* The default onStart handler for the in-animation.\r
+* @method handleStartAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };\r
+/**\r
+* The default onTween handler for the in-animation.\r
+* @method handleTweenAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.util.KeyListener.prototype.enabledEvent = null;\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };\r
+/**\r
+* The default onComplete handler for the in-animation.\r
+* @method handleCompleteAnimateIn\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };\r
 \r
 /**\r
-* CustomEvent fired when the KeyListener is disabled\r
-* args: keyData\r
-* @type YAHOO.util.CustomEvent\r
+* The default onStart handler for the out-animation.\r
+* @method handleStartAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
 */\r
-YAHOO.util.KeyListener.prototype.disabledEvent = null;
\ No newline at end of file
+YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };\r
+/**\r
+* The default onTween handler for the out-animation.\r
+* @method handleTweenAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };\r
+/**\r
+* The default onComplete handler for the out-animation.\r
+* @method handleCompleteAnimateOut\r
+* @param {String} type The CustomEvent type\r
+* @param {Object[]}    args    The CustomEvent arguments\r
+* @param {Object} obj  The scope object\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };\r
+\r
+/**\r
+* Returns a string representation of the object.\r
+* @method toString\r
+* @return {String}     The string representation of the ContainerEffect\r
+*/\r
+YAHOO.widget.ContainerEffect.prototype.toString = function() {\r
+       var output = "ContainerEffect";\r
+       if (this.overlay) {\r
+               output += " [" + this.overlay.toString() + "]";\r
+       }\r
+       return output;\r
+};\r
+\r
+/**\r
+* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
+* @method FADE\r
+* @static\r
+* @param {Overlay}     The Overlay object to animate\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
+*/\r
+YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
+       var fade = new YAHOO.widget.ContainerEffect(overlay, { attributes:{opacity: {from:0, to:1}}, duration:dur, method:YAHOO.util.Easing.easeIn }, { attributes:{opacity: {to:0}}, duration:dur, method:YAHOO.util.Easing.easeOut}, overlay.element );\r
+\r
+       fade.handleStartAnimateIn = function(type,args,obj) {\r
+               YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
+\r
+               if (! obj.overlay.underlay) {\r
+                       obj.overlay.cfg.refireEvent("underlay");\r
+               }\r
+\r
+               if (obj.overlay.underlay) {\r
+                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");\r
+                       obj.overlay.underlay.style.filter = null;\r
+               }\r
+\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 0);\r
+       };\r
+\r
+       fade.handleCompleteAnimateIn = function(type,args,obj) {\r
+               YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
+\r
+               if (obj.overlay.element.style.filter) {\r
+                       obj.overlay.element.style.filter = null;\r
+               }\r
+\r
+               if (obj.overlay.underlay) {\r
+                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);\r
+               }\r
+\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+               obj.animateInCompleteEvent.fire();\r
+       };\r
+\r
+       fade.handleStartAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");\r
+\r
+               if (obj.overlay.underlay) {\r
+                       obj.overlay.underlay.style.filter = null;\r
+               }\r
+       };\r
+\r
+       fade.handleCompleteAnimateOut =  function(type, args, obj) {\r
+               YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");\r
+               if (obj.overlay.element.style.filter) {\r
+                       obj.overlay.element.style.filter = null;\r
+               }\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1);\r
+\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+\r
+               obj.animateOutCompleteEvent.fire();\r
+       };\r
+\r
+       fade.init();\r
+       return fade;\r
+};\r
+\r
+\r
+/**\r
+* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
+* @method SLIDE\r
+* @static\r
+* @param {Overlay}     The Overlay object to animate\r
+* @param {Number}      The duration of the animation\r
+* @return {ContainerEffect}    The configured ContainerEffect object\r
+*/\r
+YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
+       var x = overlay.cfg.getProperty("x") || YAHOO.util.Dom.getX(overlay.element);\r
+       var y = overlay.cfg.getProperty("y") || YAHOO.util.Dom.getY(overlay.element);\r
+\r
+       var clientWidth = YAHOO.util.Dom.getClientWidth();\r
+       var offsetWidth = overlay.element.offsetWidth;\r
+\r
+       var slide = new YAHOO.widget.ContainerEffect(overlay, {\r
+                                                                                                                       attributes:{ points: { to:[x, y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeIn\r
+                                                                                                               },\r
+                                                                                                               {\r
+                                                                                                                       attributes:{ points: { to:[(clientWidth+25), y] } },\r
+                                                                                                                       duration:dur,\r
+                                                                                                                       method:YAHOO.util.Easing.easeOut\r
+                                                                                                               },\r
+                                                                                                               overlay.element,\r
+                                                                                                               YAHOO.util.Motion);\r
+\r
+\r
+       slide.handleStartAnimateIn = function(type,args,obj) {\r
+               obj.overlay.element.style.left = (-25-offsetWidth) + "px";\r
+               obj.overlay.element.style.top  = y + "px";\r
+       };\r
+\r
+       slide.handleTweenAnimateIn = function(type, args, obj) {\r
+\r
+\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var currentX = pos[0];\r
+               var currentY = pos[1];\r
+\r
+               if (YAHOO.util.Dom.getStyle(obj.overlay.element, "visibility") == "hidden" && currentX < x) {\r
+                       YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");\r
+               }\r
+\r
+               obj.overlay.cfg.setProperty("xy", [currentX,currentY], true);\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+       };\r
+\r
+       slide.handleCompleteAnimateIn = function(type, args, obj) {\r
+               obj.overlay.cfg.setProperty("xy", [x,y], true);\r
+               obj.startX = x;\r
+               obj.startY = y;\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+               obj.animateInCompleteEvent.fire();\r
+       };\r
+\r
+       slide.handleStartAnimateOut = function(type, args, obj) {\r
+               var vw = YAHOO.util.Dom.getViewportWidth();\r
+\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var yso = pos[1];\r
+\r
+               var currentTo = obj.animOut.attributes.points.to;\r
+               obj.animOut.attributes.points.to = [(vw+25), yso];\r
+       };\r
+\r
+       slide.handleTweenAnimateOut = function(type, args, obj) {\r
+               var pos = YAHOO.util.Dom.getXY(obj.overlay.element);\r
+\r
+               var xto = pos[0];\r
+               var yto = pos[1];\r
+\r
+               obj.overlay.cfg.setProperty("xy", [xto,yto], true);\r
+               obj.overlay.cfg.refireEvent("iframe");\r
+       };\r
+\r
+       slide.handleCompleteAnimateOut = function(type, args, obj) {\r
+               YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");\r
+\r
+               obj.overlay.cfg.setProperty("xy", [x,y]);\r
+               obj.animateOutCompleteEvent.fire();\r
+       };\r
+\r
+       slide.init();\r
+       return slide;\r
+};
\ No newline at end of file
index e4e1941d91c498197c4fd6af236903234c585bbe..e7ec5f6e23b99420d7dd3e39e17daba93f105cc2 100755 (executable)
@@ -1,5 +1,34 @@
 Dom Release Notes\r
 \r
+*** version .12.0 ***\r
+\r
+* fixed getXY for IE null parent\r
+* branching set/getStyle at load time instead of run time \r
+\r
+*** version 0.11.3 ***\r
+\r
+* fixed getX and getY returning incorrect values for collections \r
+* fixed getXY incorrectly calculated for Opera inline elements\r
+* fixed isAncestor failure in safari when 2nd arg is document.documentElement\r
+* fixed infinite loop in replaceClass when oldClassName == newClassName \r
+* getDocumentWidth no longer includes scrollbars \r
+\r
+\r
+*** version 0.11.2 ***\r
+* limit depth of parent.document crawl to 1 for getXY\r
+* test offsetParent instead of parentNode for getXY\r
+* return null if no el fo r get\r
+* just addClass if no class to replace for replaceClass\r
+\r
+\r
+*** version 0.11.1 ***\r
+\r
+* return null if el is null for get()\r
+* test offsetParent rather than parentNode for getXY()\r
+* limit depth of parent.document crawl for IE getXY() to 1\r
+* if no oldClassName to replace, just addClass for replaceClass()\r
+\r
+\r
 *** version 0.11.0 ***\r
 * Work around Opera 9 broken currentStyle\r
 * Removed timeout wrapper from setXY retry\r
index d1886f09fb48f92533c20806cbf4260b414ac689..b88a26138fb1f1e748bad246866c66b6cbd2f19e 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
 /**\r
- * @class Provides helper methods for DOM elements.\r
+ * The dom module provides helper methods for manipulating Dom elements.\r
+ * @module dom\r
+ *\r
  */\r
-YAHOO.util.Dom = function() {\r
-   var ua = navigator.userAgent.toLowerCase();\r
-   var isOpera = (ua.indexOf('opera') > -1);\r
-   var isSafari = (ua.indexOf('safari') > -1);\r
-   var isIE = (window.ActiveXObject);\r
-\r
-   var id_counter = 0;\r
-   var util = YAHOO.util; // internal shorthand\r
-   var property_cache = {}; // to cache case conversion for set/getStyle\r
-   var logger = {};\r
-   logger.log = function() {YAHOO.log.apply(window, arguments)};\r
-\r
-   var toCamel = function(property) {\r
-      var convert = function(prop) {\r
-         var test = /(-[a-z])/i.exec(prop);\r
-         return prop.replace(RegExp.$1, RegExp.$1.substr(1).toUpperCase());\r
-      };\r
-\r
-      while(property.indexOf('-') > -1) {\r
-         property = convert(property);\r
-      }\r
-\r
-      return property;\r
-      //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug\r
-   };\r
-\r
-   var toHyphen = function(property) {\r
-      if (property.indexOf('-') > -1) { // assume hyphen\r
-         return property;\r
-      }\r
-\r
-      var converted = '';\r
-      for (var i = 0, len = property.length;i < len; ++i) {\r
-         if (property.charAt(i) == property.charAt(i).toUpperCase()) {\r
-            converted = converted + '-' + property.charAt(i).toLowerCase();\r
-         } else {\r
-            converted = converted + property.charAt(i);\r
-         }\r
-      }\r
-\r
-      return converted;\r
-      //return property.replace(/([a-z])([A-Z]+)/g, function(m0, m1, m2) {return (m1 + '-' + m2.toLowerCase())});\r
-   };\r
-\r
-   // improve performance by only looking up once\r
-   var cacheConvertedProperties = function(property) {\r
-      property_cache[property] = {\r
-         camel: toCamel(property),\r
-         hyphen: toHyphen(property)\r
-      };\r
-   };\r
-\r
-   return {\r
-      /**\r
-       * Returns an HTMLElement reference\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @return {HTMLElement/Array} A DOM reference to an HTML element or an array of HTMLElements.\r
-       */\r
-      get: function(el) {\r
-         if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is\r
-            logger.log('get(' + el + ') returning ' + el, 'info', 'Dom');\r
-            return el;\r
-         }\r
-\r
-         if (typeof el == 'string') { // ID\r
-            logger.log('get("' + el + '") returning ' + document.getElementById(el), 'info', 'Dom');\r
-            return document.getElementById(el);\r
-         }\r
-         else { // array of ID's and/or elements\r
-            var collection = [];\r
-            for (var i = 0, len = el.length; i < len; ++i) {\r
-               collection[collection.length] = util.Dom.get(el[i]);\r
-            }\r
 \r
-            logger.log('get("' + el + '") returning ' + collection, 'info', 'Dom');\r
-            return collection;\r
-         }\r
-\r
-         logger.log('element ' + el + ' not found', 'error', 'Dom');\r
-         return null; // safety, should never happen\r
-      },\r
-\r
-      /**\r
-       * Normalizes currentStyle and ComputedStyle.\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {String} property The style property whose value is returned.\r
-       * @return {String/Array} The current value of the style property for the element(s).\r
-       */\r
-      getStyle: function(el, property) {\r
-         var f = function(el) {\r
+(function() {\r
+    var Y = YAHOO.util,     // internal shorthand\r
+        getStyle,           // for load time browser branching\r
+        setStyle,           // ditto\r
+        id_counter = 0,     // for use with generateId\r
+        propertyCache = {}; // for faster hyphen converts\r
+\r
+    // brower detection\r
+    var ua = navigator.userAgent.toLowerCase(),\r
+        isOpera = (ua.indexOf('opera') > -1),\r
+        isSafari = (ua.indexOf('safari') > -1),\r
+        isGecko = (!isOpera && !isSafari && ua.indexOf('gecko') > -1),\r
+        isIE = (!isOpera && ua.indexOf('msie') > -1);\r
+\r
+    // regex cache\r
+    var patterns = {\r
+        HYPHEN: /(-[a-z])/i\r
+    };\r
+\r
+    var logger = {};\r
+    logger.log = function() { YAHOO.log.apply(window, arguments); };\r
+\r
+    var toCamel = function(property) {\r
+        if ( !patterns.HYPHEN.test(property) ) {\r
+            return property; // no hyphens\r
+        }\r
+\r
+        if (propertyCache[property]) { // already converted\r
+            return propertyCache[property];\r
+        }\r
+\r
+        while( patterns.HYPHEN.exec(property) ) {\r
+            property = property.replace(RegExp.$1,\r
+                    RegExp.$1.substr(1).toUpperCase());\r
+        }\r
+\r
+        propertyCache[property] = property;\r
+        return property;\r
+        //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug\r
+    };\r
+\r
+    // branching at load instead of runtime\r
+    if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method\r
+        getStyle = function(el, property) {\r
             var value = null;\r
-            var dv = document.defaultView;\r
 \r
-            if (!property_cache[property]) {\r
-               cacheConvertedProperties(property);\r
+            var computed = document.defaultView.getComputedStyle(el, '');\r
+            if (computed) { // test computed before touching for safari\r
+                value = computed[toCamel(property)];\r
             }\r
 \r
-            var camel = property_cache[property]['camel'];\r
-            var hyphen = property_cache[property]['hyphen'];\r
-\r
-            if (property == 'opacity' && el.filters) {// IE opacity\r
-               value = 1;\r
-               try {\r
-                  value = el.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;\r
-               } catch(e) {\r
-                  try {\r
-                     value = el.filters.item('alpha').opacity / 100;\r
-                  } catch(e) {}\r
-               }\r
-            } else if (el.style[camel]) { // camelCase for valid styles\r
-               value = el.style[camel];\r
+            return el.style[property] || value;\r
+        };\r
+    } else if (document.documentElement.currentStyle && isIE) { // IE method\r
+        getStyle = function(el, property) {\r
+            switch( toCamel(property) ) {\r
+                case 'opacity' :// IE opacity uses filter\r
+                    var val = 100;\r
+                    try { // will error if no DXImageTransform\r
+                        val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;\r
+\r
+                    } catch(e) {\r
+                        try { // make sure its in the document\r
+                            val = el.filters('alpha').opacity;\r
+                        } catch(e) {\r
+                            logger.log('getStyle: IE filter failed',\r
+                                    'error', 'Dom');\r
+                        }\r
+                    }\r
+                    return val / 100;\r
+                    break;\r
+                default:\r
+                    // test currentStyle before touching\r
+                    var value = el.currentStyle ? el.currentStyle[property] : null;\r
+                    return ( el.style[property] || value );\r
             }\r
-            else if (isIE && el.currentStyle && el.currentStyle[camel]) { // camelCase for currentStyle; isIE to workaround broken Opera 9 currentStyle\r
-               value = el.currentStyle[camel];\r
-            }\r
-            else if ( dv && dv.getComputedStyle ) { // hyphen-case for computedStyle\r
-               var computed = dv.getComputedStyle(el, '');\r
+        };\r
+    } else { // default to inline only\r
+        getStyle = function(el, property) { return el.style[property]; };\r
+    }\r
 \r
-               if (computed && computed.getPropertyValue(hyphen)) {\r
-                  value = computed.getPropertyValue(hyphen);\r
-               }\r
+    if (isIE) {\r
+        setStyle = function(el, property, val) {\r
+            switch (property) {\r
+                case 'opacity':\r
+                    if ( typeof el.style.filter == 'string' ) { // in case not appended\r
+                        el.style.filter = 'alpha(opacity=' + val * 100 + ')';\r
+\r
+                        if (!el.currentStyle || !el.currentStyle.hasLayout) {\r
+                            el.style.zoom = 1; // when no layout or cant tell\r
+                        }\r
+                    }\r
+                    break;\r
+                default:\r
+                el.style[property] = val;\r
             }\r
+        };\r
+    } else {\r
+        setStyle = function(el, property, val) {\r
+            el.style[property] = val;\r
+        };\r
+    }\r
 \r
-            logger.log('getStyle ' + property + ' returning ' + value, 'info', 'Dom');\r
-            return value;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {String} property The style property to be set.\r
-       * @param {String} val The value to apply to the given property.\r
-       */\r
-      setStyle: function(el, property, val) {\r
-         if (!property_cache[property]) {\r
-            cacheConvertedProperties(property);\r
-         }\r
-\r
-         var camel = property_cache[property]['camel'];\r
-\r
-         var f = function(el) {\r
-            switch(property) {\r
-               case 'opacity' :\r
-                  if (isIE && typeof el.style.filter == 'string') { // in case not appended\r
-                     el.style.filter = 'alpha(opacity=' + val * 100 + ')';\r
-\r
-                     if (!el.currentStyle || !el.currentStyle.hasLayout) {\r
-                        el.style.zoom = 1; // when no layout or cant tell\r
-                     }\r
-                  } else {\r
-                     el.style.opacity = val;\r
-                     el.style['-moz-opacity'] = val;\r
-                     el.style['-khtml-opacity'] = val;\r
-                  }\r
-\r
-                  break;\r
-               default :\r
-                  el.style[camel] = val;\r
+    /**\r
+     * Provides helper methods for DOM elements.\r
+     * @namespace YAHOO.util\r
+     * @class Dom\r
+     */\r
+    YAHOO.util.Dom = {\r
+        /**\r
+         * Returns an HTMLElement reference.\r
+         * @method get\r
+         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.\r
+         */\r
+        get: function(el) {\r
+            if (!el) { return null; } // nothing to work with\r
+\r
+            if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is\r
+                logger.log('get(' + el + ') returning ' + el, 'info', 'Dom');\r
+                return el;\r
             }\r
 \r
-            logger.log('setStyle setting ' + property + ' to ' + val, 'info', 'Dom');\r
-\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       @ return {Array} The XY position of the element(s)\r
-       */\r
-      getXY: function(el) {\r
-         var f = function(el) {\r
-\r
-         // has to be part of document to have pageXY\r
-            if (el.parentNode === null || this.getStyle(el, 'display') == 'none') {\r
-               logger.log('getXY failed: element not available', 'error', 'Dom');\r
-               return false;\r
+            if (typeof el == 'string') { // ID\r
+                logger.log('get("' + el + '") returning ' + document.getElementById(el), 'info', 'Dom');\r
+                return document.getElementById(el);\r
             }\r
-\r
-            var parentNode = null;\r
-            var pos = [];\r
-            var box;\r
-\r
-            if (el.getBoundingClientRect) { // IE\r
-               box = el.getBoundingClientRect();\r
-               var doc = document;\r
-               if ( !this.inDocument(el) ) {// might be in a frame, need to get its scroll\r
-                  var doc = parent.document;\r
-                  while ( doc && !this.isAncestor(doc.documentElement, el) ) {\r
-                     doc = parent.document;\r
-                  }\r
-               }\r
-\r
-               var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);\r
-               var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);\r
-\r
-               return [box.left + scrollLeft, box.top + scrollTop];\r
+            else { // array of ID's and/or elements\r
+                var collection = [];\r
+                for (var i = 0, len = el.length; i < len; ++i) {\r
+                    collection[collection.length] = Y.Dom.get(el[i]);\r
+                }\r
+\r
+                logger.log('get("' + el + '") returning ' + collection, 'info', 'Dom');\r
+                return collection;\r
             }\r
-            else { // safari, opera, & gecko\r
-               pos = [el.offsetLeft, el.offsetTop];\r
-               parentNode = el.offsetParent;\r
-               if (parentNode != el) {\r
-                  while (parentNode) {\r
-                     pos[0] += parentNode.offsetLeft;\r
-                     pos[1] += parentNode.offsetTop;\r
-                     parentNode = parentNode.offsetParent;\r
-                  }\r
-               }\r
-               if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases\r
-                  pos[0] -= document.body.offsetLeft;\r
-                  pos[1] -= document.body.offsetTop;\r
-               }\r
-            }\r
-\r
-            if (el.parentNode) { parentNode = el.parentNode; }\r
-            else { parentNode = null; }\r
 \r
-            while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')\r
-            { // account for any scrolled ancestors\r
-               pos[0] -= parentNode.scrollLeft;\r
-               pos[1] -= parentNode.scrollTop;\r
-\r
-               if (parentNode.parentNode) { parentNode = parentNode.parentNode; }\r
-               else { parentNode = null; }\r
+            logger.log('element ' + el + ' not found', 'error', 'Dom');\r
+            return null; // safety, should never happen\r
+        },\r
+\r
+        /**\r
+         * Normalizes currentStyle and ComputedStyle.\r
+         * @method getStyle\r
+         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {String} property The style property whose value is returned.\r
+         * @return {String | Array} The current value of the style property for the element(s).\r
+         */\r
+        getStyle: function(el, property) {\r
+            property = toCamel(property);\r
+\r
+            var f = function(element) {\r
+                return getStyle(element, property);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.\r
+         * @method setStyle\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {String} property The style property to be set.\r
+         * @param {String} val The value to apply to the given property.\r
+         */\r
+        setStyle: function(el, property, val) {\r
+            property = toCamel(property);\r
+\r
+            var f = function(element) {\r
+                setStyle(element, property, val);\r
+                logger.log('setStyle setting ' + property + ' to ' + val, 'info', 'Dom');\r
+\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getXY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {Array} The XY position of the element(s)\r
+         */\r
+        getXY: function(el) {\r
+            var f = function(el) {\r
+\r
+            // has to be part of document to have pageXY\r
+                if (el.parentNode === null || el.offsetParent === null ||\r
+                        this.getStyle(el, 'display') == 'none') {\r
+                    logger.log('getXY failed: element not available', 'error', 'Dom');\r
+                    return false;\r
+                }\r
+\r
+                var parentNode = null;\r
+                var pos = [];\r
+                var box;\r
+\r
+                if (el.getBoundingClientRect) { // IE\r
+                    box = el.getBoundingClientRect();\r
+                    var doc = document;\r
+                    if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll\r
+                        doc = parent.document;\r
+\r
+                        if ( !this.isAncestor(doc.documentElement, el) ) {\r
+                            logger.log('getXY failed: element not available', 'error', 'Dom');\r
+                            return false;\r
+                        }\r
+\r
+                    }\r
+\r
+                    var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);\r
+                    var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);\r
+\r
+                    return [box.left + scrollLeft, box.top + scrollTop];\r
+                }\r
+                else { // safari, opera, & gecko\r
+                    pos = [el.offsetLeft, el.offsetTop];\r
+                    parentNode = el.offsetParent;\r
+                    if (parentNode != el) {\r
+                        while (parentNode) {\r
+                            pos[0] += parentNode.offsetLeft;\r
+                            pos[1] += parentNode.offsetTop;\r
+                            parentNode = parentNode.offsetParent;\r
+                        }\r
+                    }\r
+                    if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases\r
+                        pos[0] -= document.body.offsetLeft;\r
+                        pos[1] -= document.body.offsetTop;\r
+                    }\r
+                }\r
+\r
+                if (el.parentNode) { parentNode = el.parentNode; }\r
+                else { parentNode = null; }\r
+\r
+                while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')\r
+                { // account for any scrolled ancestors\r
+                    if (Y.Dom.getStyle(parentNode, 'display') != 'inline') { // work around opera inline scrollLeft/Top bug\r
+                        pos[0] -= parentNode.scrollLeft;\r
+                        pos[1] -= parentNode.scrollTop;\r
+                    }\r
+\r
+                    if (parentNode.parentNode) {\r
+                        parentNode = parentNode.parentNode;\r
+                    } else { parentNode = null; }\r
+                }\r
+\r
+                logger.log('getXY returning ' + pos, 'info', 'Dom');\r
+\r
+                return pos;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getX\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {String | Array} The X position of the element(s)\r
+         */\r
+        getX: function(el) {\r
+            var f = function(el) {\r
+                return Y.Dom.getXY(el)[0];\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {String | Array} The Y position of the element(s)\r
+         */\r
+        getY: function(el) {\r
+            var f = function(el) {\r
+                return Y.Dom.getXY(el)[1];\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Set the position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setXY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @param {Array} pos Contains X & Y values for new position (coordinates are page-based)\r
+         * @param {Boolean} noRetry By default we try and set the position a second time if the first fails\r
+         */\r
+        setXY: function(el, pos, noRetry) {\r
+            var f = function(el) {\r
+                var style_pos = this.getStyle(el, 'position');\r
+                if (style_pos == 'static') { // default to relative\r
+                    this.setStyle(el, 'position', 'relative');\r
+                    style_pos = 'relative';\r
+                }\r
+\r
+                var pageXY = this.getXY(el);\r
+                if (pageXY === false) { // has to be part of doc to have pageXY\r
+                    logger.log('setXY failed: element not available', 'error', 'Dom');\r
+                    return false;\r
+                }\r
+\r
+                var delta = [ // assuming pixels; if not we will have to retry\r
+                    parseInt( this.getStyle(el, 'left'), 10 ),\r
+                    parseInt( this.getStyle(el, 'top'), 10 )\r
+                ];\r
+\r
+                if ( isNaN(delta[0]) ) {// in case of 'auto'\r
+                    delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;\r
+                }\r
+                if ( isNaN(delta[1]) ) { // in case of 'auto'\r
+                    delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;\r
+                }\r
+\r
+                if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
+                if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
+\r
+                var newXY = this.getXY(el);\r
+\r
+                // if retry is true, try one more time if we miss\r
+                if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
+                    this.setXY(el, pos, true);\r
+                }\r
+\r
+                logger.log('setXY setting position to ' + pos, 'info', 'Dom');\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Set the X position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setX\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {Int} x The value to use as the X coordinate for the element(s).\r
+         */\r
+        setX: function(el, x) {\r
+            Y.Dom.setXY(el, [x, null]);\r
+        },\r
+\r
+        /**\r
+         * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {Int} x To use as the Y coordinate for the element(s).\r
+         */\r
+        setY: function(el, y) {\r
+            Y.Dom.setXY(el, [null, y]);\r
+        },\r
+\r
+        /**\r
+         * Returns the region position of the given element.\r
+         * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
+         * @method getRegion\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @return {Region | Array} A Region or array of Region instances containing "top, left, bottom, right" member data.\r
+         */\r
+        getRegion: function(el) {\r
+            var f = function(el) {\r
+                var region = new Y.Region.getRegion(el);\r
+                logger.log('getRegion returning ' + region, 'info', 'Dom');\r
+                return region;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Returns the width of the client (viewport).\r
+         * @method getClientWidth\r
+         * @deprecated Now using getViewportWidth.  This interface left intact for back compat.\r
+         * @return {Int} The width of the viewable area of the page.\r
+         */\r
+        getClientWidth: function() {\r
+            return Y.Dom.getViewportWidth();\r
+        },\r
+\r
+        /**\r
+         * Returns the height of the client (viewport).\r
+         * @method getClientHeight\r
+         * @deprecated Now using getViewportHeight.  This interface left intact for back compat.\r
+         * @return {Int} The height of the viewable area of the page.\r
+         */\r
+        getClientHeight: function() {\r
+            return Y.Dom.getViewportHeight();\r
+        },\r
+\r
+        /**\r
+         * Returns a array of HTMLElements with the given class.\r
+         * For optimized performance, include a tag and/or root node when possible.\r
+         * @method getElementsByClassName\r
+         * @param {String} className The class name to match against\r
+         * @param {String} tag (optional) The tag name of the elements being collected\r
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
+         * @return {Array} An array of elements that have the given class name\r
+         */\r
+        getElementsByClassName: function(className, tag, root) {\r
+            var method = function(el) { return Y.Dom.hasClass(el, className); };\r
+            return Y.Dom.getElementsBy(method, tag, root);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement has the given className.\r
+         * @method hasClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to test\r
+         * @param {String} className the class name to search for\r
+         * @return {Boolean | Array} A boolean value or array of boolean values\r
+         */\r
+        hasClass: function(el, className) {\r
+            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');\r
+\r
+            var f = function(el) {\r
+                logger.log('hasClass returning ' + re.test(el['className']), 'info', 'Dom');\r
+                return re.test(el['className']);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Adds a class name to a given element or collection of elements.\r
+         * @method addClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to add the class to\r
+         * @param {String} className the class name to add to the class attribute\r
+         */\r
+        addClass: function(el, className) {\r
+            var f = function(el) {\r
+                if (this.hasClass(el, className)) { return; } // already present\r
+\r
+                logger.log('addClass adding ' + className, 'info', 'Dom');\r
+\r
+                el['className'] = [el['className'], className].join(' ');\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Removes a class name from a given element or collection of elements.\r
+         * @method removeClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to remove the class from\r
+         * @param {String} className the class name to remove from the class attribute\r
+         */\r
+        removeClass: function(el, className) {\r
+            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');\r
+\r
+            var f = function(el) {\r
+                if (!this.hasClass(el, className)) { return; } // not present\r
+\r
+                logger.log('removeClass removing ' + className, 'info', 'Dom');\r
+\r
+                var c = el['className'];\r
+                el['className'] = c.replace(re, ' ');\r
+                if ( this.hasClass(el, className) ) { // in case of multiple adjacent\r
+                    this.removeClass(el, className);\r
+                }\r
+\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Replace a class with another class for a given element or collection of elements.\r
+         * If no oldClassName is present, the newClassName is simply added.\r
+         * @method replaceClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to remove the class from\r
+         * @param {String} oldClassName the class name to be replaced\r
+         * @param {String} newClassName the class name that will be replacing the old class name\r
+         */\r
+        replaceClass: function(el, oldClassName, newClassName) {\r
+            if (oldClassName === newClassName) { // avoid infinite loop\r
+                return false;\r
             }\r
 \r
-            logger.log('getXY returning ' + pos, 'info', 'Dom');\r
-\r
-            return pos;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @return {String/Array} The X position of the element(s)\r
-       */\r
-      getX: function(el) {\r
-         return util.Dom.getXY(el)[0];\r
-      },\r
-\r
-      /**\r
-       * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @return {String/Array} The Y position of the element(s)\r
-       */\r
-      getY: function(el) {\r
-         return util.Dom.getXY(el)[1];\r
-      },\r
-\r
-      /**\r
-       * Set the position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @param {Array} pos Contains X & Y values for new position (coordinates are page-based)\r
-       * @param {Boolean} noRetry By default we try and set the position a second time if the first fails\r
-       */\r
-      setXY: function(el, pos, noRetry) {\r
-         var f = function(el) {\r
-            var style_pos = this.getStyle(el, 'position');\r
-            if (style_pos == 'static') { // default to relative\r
-               this.setStyle(el, 'position', 'relative');\r
-               style_pos = 'relative';\r
+            var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');\r
+\r
+            var f = function(el) {\r
+                logger.log('replaceClass replacing ' + oldClassName + ' with ' + newClassName, 'info', 'Dom');\r
+\r
+                if ( !this.hasClass(el, oldClassName) ) {\r
+                    this.addClass(el, newClassName); // just add it if nothing to replace\r
+                    return; // note return\r
+                }\r
+\r
+                el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');\r
+\r
+                if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent\r
+                    this.replaceClass(el, oldClassName, newClassName);\r
+                }\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Generates a unique ID\r
+         * @method generateId\r
+         * @param {String | HTMLElement | Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present).\r
+         * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").\r
+         * @return {String | Array} The generated ID, or array of generated IDs (or original ID if already present on an element)\r
+         */\r
+        generateId: function(el, prefix) {\r
+            prefix = prefix || 'yui-gen';\r
+            el = el || {};\r
+\r
+            var f = function(el) {\r
+                if (el) {\r
+                    el = Y.Dom.get(el);\r
+                } else {\r
+                    el = {}; // just generating ID in this case\r
+                }\r
+\r
+                if (!el.id) {\r
+                    el.id = prefix + id_counter++;\r
+                    logger.log('generateId generating ' + el.id, 'info', 'Dom');\r
+                } // dont override existing\r
+\r
+                logger.log('generateId returning ' + el.id, 'info', 'Dom');\r
+\r
+                return el.id;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.\r
+         * @method isAncestor\r
+         * @param {String | HTMLElement} haystack The possible ancestor\r
+         * @param {String | HTMLElement} needle The possible descendent\r
+         * @return {Boolean} Whether or not the haystack is an ancestor of needle\r
+         */\r
+        isAncestor: function(haystack, needle) {\r
+            haystack = Y.Dom.get(haystack);\r
+            if (!haystack || !needle) { return false; }\r
+\r
+            var f = function(needle) {\r
+                if (haystack.contains && !isSafari) { // safari "contains" is broken\r
+                    logger.log('isAncestor returning ' + haystack.contains(needle), 'info', 'Dom');\r
+                    return haystack.contains(needle);\r
+                }\r
+                else if ( haystack.compareDocumentPosition ) {\r
+                    logger.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(needle) & 16), 'info', 'Dom');\r
+                    return !!(haystack.compareDocumentPosition(needle) & 16);\r
+                }\r
+                else { // loop up and test each parent\r
+                    var parent = needle.parentNode;\r
+\r
+                    while (parent) {\r
+                        if (parent == haystack) {\r
+                            logger.log('isAncestor returning true', 'info', 'Dom');\r
+                            return true;\r
+                        }\r
+                        else if (!parent.tagName || parent.tagName.toUpperCase() == 'HTML') {\r
+                            logger.log('isAncestor returning false', 'info', 'Dom');\r
+                            return false;\r
+                        }\r
+\r
+                        parent = parent.parentNode;\r
+                    }\r
+                    logger.log('isAncestor returning false', 'info', 'Dom');\r
+                    return false;\r
+                }\r
+            };\r
+\r
+            return Y.Dom.batch(needle, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement is present in the current document.\r
+         * @method inDocument\r
+         * @param {String | HTMLElement} el The element to search for\r
+         * @return {Boolean} Whether or not the element is present in the current document\r
+         */\r
+        inDocument: function(el) {\r
+            var f = function(el) {\r
+                return this.isAncestor(document.documentElement, el);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Returns a array of HTMLElements that pass the test applied by supplied boolean method.\r
+         * For optimized performance, include a tag and/or root node when possible.\r
+         * @method getElementsBy\r
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.\r
+\r
+         * @param {String} tag (optional) The tag name of the elements being collected\r
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
+         */\r
+        getElementsBy: function(method, tag, root) {\r
+            tag = tag || '*';\r
+            root = Y.Dom.get(root) || document;\r
+\r
+            var nodes = [];\r
+            var elements = root.getElementsByTagName(tag);\r
+\r
+            if ( !elements.length && (tag == '*' && root.all) ) {\r
+                elements = root.all; // IE < 6\r
             }\r
 \r
-            var pageXY = this.getXY(el);\r
-            if (pageXY === false) { // has to be part of doc to have pageXY\r
-               logger.log('setXY failed: element not available', 'error', 'Dom');\r
-               return false;\r
+            for (var i = 0, len = elements.length; i < len; ++i) {\r
+                if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }\r
             }\r
 \r
-            var delta = [ // assuming pixels; if not we will have to retry\r
-               parseInt( this.getStyle(el, 'left'), 10 ),\r
-               parseInt( this.getStyle(el, 'top'), 10 )\r
-            ];\r
-\r
-            if ( isNaN(delta[0]) ) {// in case of 'auto'\r
-               delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;\r
+            logger.log('getElementsBy returning ' + nodes, 'info', 'Dom');\r
+\r
+            return nodes;\r
+        },\r
+\r
+        /**\r
+         * Returns an array of elements that have had the supplied method applied.\r
+         * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).\r
+         * @method batch\r
+         * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to\r
+         * @param {Function} method The method to apply to the element(s)\r
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method\r
+         * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"\r
+         * @return {HTMLElement | Array} The element(s) with the method applied\r
+         */\r
+        batch: function(el, method, o, override) {\r
+            var id = el;\r
+            el = Y.Dom.get(el);\r
+\r
+            var scope = (override) ? o : window;\r
+\r
+            if (!el || el.tagName || !el.length) { // is null or not a collection (tagName for SELECT and others that can be both an element and a collection)\r
+                if (!el) {\r
+                    logger.log(id + ' not available', 'error', 'Dom');\r
+                    return false;\r
+                }\r
+                return method.call(scope, el, o);\r
             }\r
-            if ( isNaN(delta[1]) ) { // in case of 'auto'\r
-               delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;\r
-            }\r
-\r
-            if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
-            if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
 \r
-            var newXY = this.getXY(el);\r
+            var collection = [];\r
 \r
-            // if retry is true, try one more time if we miss\r
-            if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
-               this.setXY(el, pos, true);\r
+            for (var i = 0, len = el.length; i < len; ++i) {\r
+                if (!el[i]) {\r
+                    id = el[i];\r
+                    logger.log(id + ' not available', 'error', 'Dom');\r
+                }\r
+                collection[collection.length] = method.call(scope, el[i], o);\r
             }\r
 \r
-            logger.log('setXY setting position to ' + pos, 'info', 'Dom');\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Set the X position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {Int} x to use as the X coordinate for the element(s).\r
-       */\r
-      setX: function(el, x) {\r
-         util.Dom.setXY(el, [x, null]);\r
-      },\r
-\r
-      /**\r
-       * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {Int} x to use as the Y coordinate for the element(s).\r
-       */\r
-      setY: function(el, y) {\r
-         util.Dom.setXY(el, [null, y]);\r
-      },\r
-\r
-      /**\r
-       * Returns the region position of the given element.\r
-       * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @return {Region/Array} A Region or array of Region instances containing "top, left, bottom, right" member data.\r
-       */\r
-      getRegion: function(el) {\r
-         var f = function(el) {\r
-            var region = new YAHOO.util.Region.getRegion(el);\r
-            logger.log('getRegion returning ' + region, 'info', 'Dom');\r
-            return region;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Returns the width of the client (viewport).\r
-       * Now using getViewportWidth.  This interface left intact for back compat.\r
-       * @return {Int} The width of the viewable area of the page.\r
-       */\r
-      getClientWidth: function() {\r
-         return util.Dom.getViewportWidth();\r
-      },\r
-\r
-      /**\r
-       * Returns the height of the client (viewport).\r
-       * Now using getViewportHeight.  This interface left intact for back compat.\r
-       * @return {Int} The height of the viewable area of the page.\r
-       */\r
-      getClientHeight: function() {\r
-         return util.Dom.getViewportHeight();\r
-      },\r
-\r
-      /**\r
-       * Returns a array of HTMLElements with the given class\r
-       * For optimized performance, include a tag and/or root node if possible\r
-       * @param {String} className The class name to match against\r
-       * @param {String} tag (optional) The tag name of the elements being collected\r
-       * @param {String/HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
-       * @return {Array} An array of elements that have the given class name\r
-       */\r
-      getElementsByClassName: function(className, tag, root) {\r
-         var method = function(el) { return util.Dom.hasClass(el, className) };\r
-         return util.Dom.getElementsBy(method, tag, root);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement has the given className\r
-       * @param {String/HTMLElement/Array} el The element or collection to test\r
-       * @param {String} className the class name to search for\r
-       * @return {Boolean/Array} A boolean value or array of boolean values\r
-       */\r
-      hasClass: function(el, className) {\r
-         var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');\r
-\r
-         var f = function(el) {\r
-            logger.log('hasClass returning ' + re.test(el['className']), 'info', 'Dom');\r
-            return re.test(el['className']);\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Adds a class name to a given element or collection of elements\r
-       * @param {String/HTMLElement/Array} el The element or collection to add the class to\r
-       * @param {String} className the class name to add to the class attribute\r
-       */\r
-      addClass: function(el, className) {\r
-         var f = function(el) {\r
-            if (this.hasClass(el, className)) { return; } // already present\r
-\r
-            logger.log('addClass adding ' + className, 'info', 'Dom');\r
-\r
-            el['className'] = [el['className'], className].join(' ');\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Removes a class name from a given element or collection of elements\r
-       * @param {String/HTMLElement/Array} el The element or collection to remove the class from\r
-       * @param {String} className the class name to remove from the class attribute\r
-       */\r
-      removeClass: function(el, className) {\r
-         var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');\r
-\r
-         var f = function(el) {\r
-            if (!this.hasClass(el, className)) { return; } // not present\r
-\r
-            logger.log('removeClass removing ' + className, 'info', 'Dom');\r
-\r
-            var c = el['className'];\r
-            el['className'] = c.replace(re, ' ');\r
-            if ( this.hasClass(el, className) ) { // in case of multiple adjacent\r
-               this.removeClass(el, className);\r
+            return collection;\r
+        },\r
+\r
+        /**\r
+         * Returns the height of the document.\r
+         * @method getDocumentHeight\r
+         * @return {Int} The height of the actual document (which includes the body and its margin).\r
+         */\r
+        getDocumentHeight: function() {\r
+            var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;\r
+\r
+            var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());\r
+            logger.log('getDocumentHeight returning ' + h, 'info', 'Dom');\r
+            return h;\r
+        },\r
+\r
+        /**\r
+         * Returns the width of the document.\r
+         * @method getDocumentWidth\r
+         * @return {Int} The width of the actual document (which includes the body and its margin).\r
+         */\r
+        getDocumentWidth: function() {\r
+            var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;\r
+            var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());\r
+            logger.log('getDocumentWidth returning ' + w, 'info', 'Dom');\r
+            return w;\r
+        },\r
+\r
+        /**\r
+         * Returns the current height of the viewport.\r
+         * @method getViewportHeight\r
+         * @return {Int} The height of the viewable area of the page (excludes scrollbars).\r
+         */\r
+        getViewportHeight: function() {\r
+            var height = self.innerHeight; // Safari, Opera\r
+            var mode = document.compatMode;\r
+\r
+            if ( (mode || isIE) && !isOpera ) { // IE, Gecko\r
+                height = (mode == 'CSS1Compat') ?\r
+                        document.documentElement.clientHeight : // Standards\r
+                        document.body.clientHeight; // Quirks\r
             }\r
 \r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
+            logger.log('getViewportHeight returning ' + height, 'info', 'Dom');\r
+            return height;\r
+        },\r
 \r
-      /**\r
-       * Replace a class with another class for a given element or collection of elements.\r
-       * If no oldClassName is present, the newClassName is simply added.\r
-       * @param {String/HTMLElement/Array} el The element or collection to remove the class from\r
-       * @param {String} oldClassName the class name to be replaced\r
-       * @param {String} newClassName the class name that will be replacing the old class name\r
-       */\r
-      replaceClass: function(el, oldClassName, newClassName) {\r
-         var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');\r
+        /**\r
+         * Returns the current width of the viewport.\r
+         * @method getViewportWidth\r
+         * @return {Int} The width of the viewable area of the page (excludes scrollbars).\r
+         */\r
 \r
-         var f = function(el) {\r
-            logger.log('replaceClass replacing ' + oldClassName + ' with ' + newClassName, 'info', 'Dom');\r
-\r
-            el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');\r
-\r
-            if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent\r
-               this.replaceClass(el, oldClassName, newClassName);\r
-            }\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Generates a unique ID\r
-       * @param {String/HTMLElement/Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present)\r
-       * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen")\r
-       * @return {String/Array} The generated ID, or array of generated IDs (or original ID if already present on an element)\r
-       */\r
-      generateId: function(el, prefix) {\r
-         prefix = prefix || 'yui-gen';\r
-         el = el || {};\r
-\r
-         var f = function(el) {\r
-            if (el) {\r
-               el = util.Dom.get(el);\r
-            } else {\r
-               el = {}; // just generating ID in this case\r
-            }\r
+        getViewportWidth: function() {\r
+            var width = self.innerWidth;  // Safari\r
+            var mode = document.compatMode;\r
 \r
-            if (!el.id) {\r
-               el.id = prefix + id_counter++;\r
-               logger.log('generateId generating ' + el.id, 'info', 'Dom');\r
-            } // dont override existing\r
-\r
-            logger.log('generateId returning ' + el.id, 'info', 'Dom');\r
-\r
-            return el.id;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy\r
-       * @param {String/HTMLElement} haystack The possible ancestor\r
-       * @param {String/HTMLElement} needle The possible descendent\r
-       * @return {Boolean} Whether or not the haystack is an ancestor of needle\r
-       */\r
-      isAncestor: function(haystack, needle) {\r
-         haystack = util.Dom.get(haystack);\r
-         if (!haystack || !needle) { return false; }\r
-\r
-         var f = function(needle) {\r
-            if (haystack.contains && !isSafari) { // safari "contains" is broken\r
-               logger.log('isAncestor returning ' + haystack.contains(needle), 'info', 'Dom');\r
-               return haystack.contains(needle);\r
+            if (mode || isIE) { // IE, Gecko, Opera\r
+                width = (mode == 'CSS1Compat') ?\r
+                        document.documentElement.clientWidth : // Standards\r
+                        document.body.clientWidth; // Quirks\r
             }\r
-            else if ( haystack.compareDocumentPosition ) {\r
-               logger.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(needle) & 16), 'info', 'Dom');\r
-               return !!(haystack.compareDocumentPosition(needle) & 16);\r
-            }\r
-            else { // loop up and test each parent\r
-               var parent = needle.parentNode;\r
-\r
-               while (parent) {\r
-                  if (parent == haystack) {\r
-                     logger.log('isAncestor returning true', 'info', 'Dom');\r
-                     return true;\r
-                  }\r
-                  else if (parent.tagName.toUpperCase() == 'HTML') {\r
-                     logger.log('isAncestor returning false', 'info', 'Dom');\r
-                     return false;\r
-                  }\r
-\r
-                  parent = parent.parentNode;\r
-               }\r
-               logger.log('isAncestor returning false', 'info', 'Dom');\r
-               return false;\r
-            }\r
-         };\r
-\r
-         return util.Dom.batch(needle, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement is present in the current document\r
-       * @param {String/HTMLElement} el The element to search for\r
-       * @return {Boolean} Whether or not the element is present in the current document\r
-       */\r
-      inDocument: function(el) {\r
-         var f = function(el) {\r
-            return this.isAncestor(document.documentElement, el);\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Returns a array of HTMLElements that pass the test applied by supplied boolean method\r
-       * For optimized performance, include a tag and/or root node if possible\r
-       * @param {Function} method A boolean method to test elements with\r
-       * @param {String} tag (optional) The tag name of the elements being collected\r
-       * @param {String/HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
-       */\r
-      getElementsBy: function(method, tag, root) {\r
-         tag = tag || '*';\r
-         root = util.Dom.get(root) || document;\r
-\r
-         var nodes = [];\r
-         var elements = root.getElementsByTagName(tag);\r
-\r
-         if ( !elements.length && (tag == '*' && root.all) ) {\r
-            elements = root.all; // IE < 6\r
-         }\r
-\r
-         for (var i = 0, len = elements.length; i < len; ++i)\r
-         {\r
-            if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }\r
-         }\r
-\r
-         logger.log('getElementsBy returning ' + nodes, 'info', 'Dom');\r
-\r
-         return nodes;\r
-      },\r
-\r
-      /**\r
-       * Returns an array of elements that have had the supplied method applied.\r
-       * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) )\r
-       * @param {String/HTMLElement/Array} el (optional) An element or array of elements to apply the method to\r
-       * @param {Function} method The method to apply to the element(s)\r
-       * @param {Generic} (optional) o An optional arg that is passed to the supplied method\r
-       * @param {Boolean} (optional) override Whether or not to override the scope of "method" with "o"\r
-       * @return {HTMLElement/Array} The element(s) with the method applied\r
-       */\r
-      batch: function(el, method, o, override) {\r
-         var id = el;\r
-         el = util.Dom.get(el);\r
-\r
-         var scope = (override) ? o : window;\r
-\r
-         if (!el || el.tagName || !el.length) { // is null or not a collection (tagName for SELECT and others that can be both an element and a collection)\r
-            if (!el) {\r
-               logger.log(id + ' not available', 'error', 'Dom');\r
-               return false;\r
-            }\r
-            return method.call(scope, el, o);\r
-         }\r
-\r
-         var collection = [];\r
-\r
-         for (var i = 0, len = el.length; i < len; ++i) {\r
-            if (!el[i]) {\r
-               id = id[i];\r
-               logger.log(id + ' not available', 'error', 'Dom');\r
-            }\r
-            collection[collection.length] = method.call(scope, el[i], o);\r
-         }\r
-\r
-         return collection;\r
-      },\r
-\r
-      /**\r
-       * Returns the height of the document.\r
-       * @return {Int} The height of the actual document (which includes the body and its margin).\r
-       */\r
-      getDocumentHeight: function() {\r
-         var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;\r
-         var marginTop = parseInt(util.Dom.getStyle(document.body, 'marginTop'), 10);\r
-         var marginBottom = parseInt(util.Dom.getStyle(document.body, 'marginBottom'), 10);\r
-\r
-         var mode = document.compatMode;\r
-\r
-         if ( (mode || isIE) && !isOpera ) { // (IE, Gecko)\r
-            switch (mode) {\r
-               case 'CSS1Compat': // Standards mode\r
-                  scrollHeight = ((window.innerHeight && window.scrollMaxY) ?  window.innerHeight+window.scrollMaxY : -1);\r
-                  windowHeight = [document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a, b){return(a-b);})[1];\r
-                  bodyHeight = document.body.offsetHeight + marginTop + marginBottom;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  scrollHeight = document.body.scrollHeight;\r
-                  bodyHeight = document.body.clientHeight;\r
-            }\r
-         } else { // Safari & Opera\r
-            scrollHeight = document.documentElement.scrollHeight;\r
-            windowHeight = self.innerHeight;\r
-            bodyHeight = document.documentElement.clientHeight;\r
-         }\r
-\r
-         var h = [scrollHeight,windowHeight,bodyHeight].sort(function(a, b){return(a-b);});\r
-         logger.log('getDocumentHeight returning ' + h[2], 'info', 'Dom');\r
-         return h[2];\r
-      },\r
-\r
-      /**\r
-       * Returns the width of the document.\r
-       * @return {Int} The width of the actual document (which includes the body and its margin).\r
-       */\r
-      getDocumentWidth: function() {\r
-         var docWidth=-1,bodyWidth=-1,winWidth=-1;\r
-         var marginRight = parseInt(util.Dom.getStyle(document.body, 'marginRight'), 10);\r
-         var marginLeft = parseInt(util.Dom.getStyle(document.body, 'marginLeft'), 10);\r
-\r
-         var mode = document.compatMode;\r
-\r
-         if (mode || isIE) { // (IE, Gecko, Opera)\r
-            switch (mode) {\r
-               case 'CSS1Compat': // Standards mode\r
-                  docWidth = document.documentElement.clientWidth;\r
-                  bodyWidth = document.body.offsetWidth + marginLeft + marginRight;\r
-                  winWidth = self.innerWidth || -1;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  bodyWidth = document.body.clientWidth;\r
-                  winWidth = document.body.scrollWidth;\r
-                  break;\r
-            }\r
-         } else { // Safari\r
-            docWidth = document.documentElement.clientWidth;\r
-            bodyWidth = document.body.offsetWidth + marginLeft + marginRight;\r
-            winWidth = self.innerWidth;\r
-         }\r
-\r
-         var w = [docWidth,bodyWidth,winWidth].sort(function(a, b){return(a-b);});\r
-         logger.log('getDocumentWidth returning ' + w[2], 'info', 'Dom');\r
-         return w[2];\r
-      },\r
-\r
-      /**\r
-       * Returns the current height of the viewport.\r
-       * @return {Int} The height of the viewable area of the page (excludes scrollbars).\r
-       */\r
-      getViewportHeight: function() {\r
-         var height = -1;\r
-         var mode = document.compatMode;\r
-\r
-         if ( (mode || isIE) && !isOpera ) {\r
-            switch (mode) { // (IE, Gecko)\r
-               case 'CSS1Compat': // Standards mode\r
-                  height = document.documentElement.clientHeight;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  height = document.body.clientHeight;\r
-            }\r
-         } else { // Safari, Opera\r
-            height = self.innerHeight;\r
-         }\r
-\r
-         logger.log('getViewportHeight returning ' + height, 'info', 'Dom');\r
-         return height;\r
-      },\r
-\r
-      /**\r
-       * Returns the current width of the viewport.\r
-       * @return {Int} The width of the viewable area of the page (excludes scrollbars).\r
-       */\r
-\r
-      getViewportWidth: function() {\r
-         var width = -1;\r
-         var mode = document.compatMode;\r
-\r
-         if (mode || isIE) { // (IE, Gecko, Opera)\r
-            switch (mode) {\r
-            case 'CSS1Compat': // Standards mode\r
-               width = document.documentElement.clientWidth;\r
-               break;\r
-\r
-            default: // Quirks\r
-               width = document.body.clientWidth;\r
-            }\r
-         } else { // Safari\r
-            width = self.innerWidth;\r
-         }\r
-         logger.log('getViewportWidth returning ' + width, 'info', 'Dom');\r
-         return width;\r
-      }\r
-   };\r
-}();\r
-\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-*/\r
-\r
+            logger.log('getViewportWidth returning ' + width, 'info', 'Dom');\r
+            return width;\r
+        }\r
+    };\r
+})();\r
 /**\r
- * @class A region is a representation of an object on a grid.  It is defined\r
+ * A region is a representation of an object on a grid.  It is defined\r
  * by the top, right, bottom, left extents, so is rectangular by default.  If\r
  * other shapes are required, this class could be extended to support it.\r
- *\r
- * @param {int} t the top extent\r
- * @param {int} r the right extent\r
- * @param {int} b the bottom extent\r
- * @param {int} l the left extent\r
+ * @namespace YAHOO.util\r
+ * @class Region\r
+ * @param {Int} t the top extent\r
+ * @param {Int} r the right extent\r
+ * @param {Int} b the bottom extent\r
+ * @param {Int} l the left extent\r
  * @constructor\r
  */\r
 YAHOO.util.Region = function(t, r, b, l) {\r
 \r
     /**\r
      * The region's top extent\r
-     * @type int\r
+     * @property top\r
+     * @type Int\r
      */\r
     this.top = t;\r
 \r
     /**\r
      * The region's top extent as index, for symmetry with set/getXY\r
-     * @type int\r
+     * @property 1\r
+     * @type Int\r
      */\r
     this[1] = t;\r
 \r
     /**\r
      * The region's right extent\r
+     * @property right\r
      * @type int\r
      */\r
     this.right = r;\r
 \r
     /**\r
      * The region's bottom extent\r
-     * @type int\r
+     * @property bottom\r
+     * @type Int\r
      */\r
     this.bottom = b;\r
 \r
     /**\r
      * The region's left extent\r
-     * @type int\r
+     * @property left\r
+     * @type Int\r
      */\r
     this.left = l;\r
 \r
     /**\r
      * The region's left extent as index, for symmetry with set/getXY\r
-     * @type int\r
+     * @property 0\r
+     * @type Int\r
      */\r
     this[0] = l;\r
 };\r
 \r
 /**\r
  * Returns true if this region contains the region passed in\r
- *\r
+ * @method contains\r
  * @param  {Region}  region The region to evaluate\r
- * @return {boolean}        True if the region is contained with this region,\r
+ * @return {Boolean}        True if the region is contained with this region,\r
  *                          else false\r
  */\r
 YAHOO.util.Region.prototype.contains = function(region) {\r
@@ -806,8 +803,8 @@ YAHOO.util.Region.prototype.contains = function(region) {
 \r
 /**\r
  * Returns the area of the region\r
- *\r
- * @return {int} the region's area\r
+ * @method getArea\r
+ * @return {Int} the region's area\r
  */\r
 YAHOO.util.Region.prototype.getArea = function() {\r
     return ( (this.bottom - this.top) * (this.right - this.left) );\r
@@ -815,7 +812,7 @@ YAHOO.util.Region.prototype.getArea = function() {
 \r
 /**\r
  * Returns the region where the passed in region overlaps with this one\r
- *\r
+ * @method intersect\r
  * @param  {Region} region The region that intersects\r
  * @return {Region}        The overlap region, or null if there is no overlap\r
  */\r
@@ -835,7 +832,7 @@ YAHOO.util.Region.prototype.intersect = function(region) {
 /**\r
  * Returns the region representing the smallest region that can contain both\r
  * the passed in region and this region.\r
- *\r
+ * @method union\r
  * @param  {Region} region The region that to create the union with\r
  * @return {Region}        The union region\r
  */\r
@@ -850,6 +847,7 @@ YAHOO.util.Region.prototype.union = function(region) {
 \r
 /**\r
  * toString\r
+ * @method toString\r
  * @return string the region properties\r
  */\r
 YAHOO.util.Region.prototype.toString = function() {\r
@@ -863,7 +861,7 @@ YAHOO.util.Region.prototype.toString = function() {
 \r
 /**\r
  * Returns a region that is occupied by the DOM element\r
- *\r
+ * @method getRegion\r
  * @param  {HTMLElement} el The element\r
  * @return {Region}         The region that the element occupies\r
  * @static\r
@@ -883,15 +881,14 @@ YAHOO.util.Region.getRegion = function(el) {
 \r
 \r
 /**\r
- * @class\r
- *\r
  * A point is a region that is special in that it represents a single point on\r
  * the grid.\r
- *\r
- * @param {int} x The X position of the point\r
- * @param {int} y The Y position of the point\r
+ * @namespace YAHOO.util\r
+ * @class Point\r
+ * @param {Int} x The X position of the point\r
+ * @param {Int} y The Y position of the point\r
  * @constructor\r
- * @extends Region\r
+ * @extends YAHOO.util.Region\r
  */\r
 YAHOO.util.Point = function(x, y) {\r
    if (x instanceof Array) { // accept output from Dom.getXY\r
@@ -901,14 +898,16 @@ YAHOO.util.Point = function(x, y) {
 \r
     /**\r
      * The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)\r
-     * @type int\r
+     * @property x\r
+     * @type Int\r
      */\r
 \r
     this.x = this.right = this.left = this[0] = x;\r
 \r
     /**\r
      * The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)\r
-     * @type int\r
+     * @property y\r
+     * @type Int\r
      */\r
     this.y = this.top = this.bottom = this[1] = y;\r
 };\r
index 7035bd9352ad5103612c450354208cbfe0517d1a..0f9d6ee4cf665652f36d49a80f5e43b5084116c4 100755 (executable)
@@ -1 +1 @@
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}var converted='';for(var i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}return converted;};var cacheConvertedProperties=function(property){property_cache[property]={camel:toCamel(property),hyphen:toHyphen(property)};};return{get:function(el){if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=util.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){var f=function(el){var value=null;var dv=document.defaultView;if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var hyphen=property_cache[property]['hyphen'];if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}else if(el.style[camel]){value=el.style[camel];}else if(isIE&&el.currentStyle&&el.currentStyle[camel]){value=el.currentStyle[camel];}else if(dv&&dv.getComputedStyle){var computed=dv.getComputedStyle(el,'');if(computed&&computed.getPropertyValue(hyphen)){value=computed.getPropertyValue(hyphen);}}return value;};return util.Dom.batch(el,f,util.Dom,true);},setStyle:function(el,property,val){if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var f=function(el){switch(property){case'opacity':if(isIE&&typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}break;default:el.style[camel]=val;}};util.Dom.batch(el,f,util.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||this.getStyle(el,'display')=='none'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)){var doc=parent.document;while(doc&&!this.isAncestor(doc.documentElement,el)){doc=parent.document;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return util.Dom.batch(el,f,util.Dom,true);},getX:function(el){return util.Dom.getXY(el)[0];},getY:function(el){return util.Dom.getXY(el)[1];},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';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}};util.Dom.batch(el,f,util.Dom,true);},setX:function(el,x){util.Dom.setXY(el,[x,null]);},setY:function(el,y){util.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new YAHOO.util.Region.getRegion(el);return region;};return util.Dom.batch(el,f,util.Dom,true);},getClientWidth:function(){return util.Dom.getViewportWidth();},getClientHeight:function(){return util.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return util.Dom.hasClass(el,className)};return util.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return util.Dom.batch(el,f,util.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};util.Dom.batch(el,f,util.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};util.Dom.batch(el,f,util.Dom,true);},replaceClass:function(el,oldClassName,newClassName){var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};util.Dom.batch(el,f,util.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=util.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return util.Dom.batch(el,f,util.Dom,true);},isAncestor:function(haystack,needle){haystack=util.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return util.Dom.batch(needle,f,util.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return util.Dom.batch(el,f,util.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=util.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=util.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=id[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;var marginTop=parseInt(util.Dom.getStyle(document.body,'marginTop'),10);var marginBottom=parseInt(util.Dom.getStyle(document.body,'marginBottom'),10);var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':scrollHeight=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return(a-b);})[1];bodyHeight=document.body.offsetHeight+marginTop+marginBottom;break;default:scrollHeight=document.body.scrollHeight;bodyHeight=document.body.clientHeight;}}else{scrollHeight=document.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=document.documentElement.clientHeight;}var h=[scrollHeight,windowHeight,bodyHeight].sort(function(a,b){return(a-b);});return h[2];},getDocumentWidth:function(){var docWidth=-1,bodyWidth=-1,winWidth=-1;var marginRight=parseInt(util.Dom.getStyle(document.body,'marginRight'),10);var marginLeft=parseInt(util.Dom.getStyle(document.body,'marginLeft'),10);var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth||-1;break;default:bodyWidth=document.body.clientWidth;winWidth=document.body.scrollWidth;break;}}else{docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth;}var w=[docWidth,bodyWidth,winWidth].sort(function(a,b){return(a-b);});return w[2];},getViewportHeight:function(){var height=-1;var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':height=document.documentElement.clientHeight;break;default:height=document.body.clientHeight;}}else{height=self.innerHeight;}return height;},getViewportWidth:function(){var width=-1;var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':width=document.documentElement.clientWidth;break;default:width=document.body.clientWidth;}}else{width=self.innerWidth;}return width;}};}();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(x instanceof Array){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();\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;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;break;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(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}return collection;}return null;},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'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}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';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||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){var region=new 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){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');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;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[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;}};})();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(x instanceof Array){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();
\ No newline at end of file
index 3427cb8de9486d42f1feadceb01a6b19c68d43c4..6f04c43166f70c645624bac5ba208e91dd4a463f 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
 /**\r
- * @class Provides helper methods for DOM elements.\r
+ * The dom module provides helper methods for manipulating Dom elements.\r
+ * @module dom\r
+ *\r
  */\r
-YAHOO.util.Dom = function() {\r
-   var ua = navigator.userAgent.toLowerCase();\r
-   var isOpera = (ua.indexOf('opera') > -1);\r
-   var isSafari = (ua.indexOf('safari') > -1);\r
-   var isIE = (window.ActiveXObject);\r
-\r
-   var id_counter = 0;\r
-   var util = YAHOO.util; // internal shorthand\r
-   var property_cache = {}; // to cache case conversion for set/getStyle\r
-\r
-   var toCamel = function(property) {\r
-      var convert = function(prop) {\r
-         var test = /(-[a-z])/i.exec(prop);\r
-         return prop.replace(RegExp.$1, RegExp.$1.substr(1).toUpperCase());\r
-      };\r
-\r
-      while(property.indexOf('-') > -1) {\r
-         property = convert(property);\r
-      }\r
-\r
-      return property;\r
-      //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug\r
-   };\r
-\r
-   var toHyphen = function(property) {\r
-      if (property.indexOf('-') > -1) { // assume hyphen\r
-         return property;\r
-      }\r
-\r
-      var converted = '';\r
-      for (var i = 0, len = property.length;i < len; ++i) {\r
-         if (property.charAt(i) == property.charAt(i).toUpperCase()) {\r
-            converted = converted + '-' + property.charAt(i).toLowerCase();\r
-         } else {\r
-            converted = converted + property.charAt(i);\r
-         }\r
-      }\r
-\r
-      return converted;\r
-      //return property.replace(/([a-z])([A-Z]+)/g, function(m0, m1, m2) {return (m1 + '-' + m2.toLowerCase())});\r
-   };\r
-\r
-   // improve performance by only looking up once\r
-   var cacheConvertedProperties = function(property) {\r
-      property_cache[property] = {\r
-         camel: toCamel(property),\r
-         hyphen: toHyphen(property)\r
-      };\r
-   };\r
-\r
-   return {\r
-      /**\r
-       * Returns an HTMLElement reference\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @return {HTMLElement/Array} A DOM reference to an HTML element or an array of HTMLElements.\r
-       */\r
-      get: function(el) {\r
-         if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is\r
-            return el;\r
-         }\r
-\r
-         if (typeof el == 'string') { // ID\r
-            return document.getElementById(el);\r
-         }\r
-         else { // array of ID's and/or elements\r
-            var collection = [];\r
-            for (var i = 0, len = el.length; i < len; ++i) {\r
-               collection[collection.length] = util.Dom.get(el[i]);\r
-            }\r
 \r
-            return collection;\r
-         }\r
-\r
-         return null; // safety, should never happen\r
-      },\r
-\r
-      /**\r
-       * Normalizes currentStyle and ComputedStyle.\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {String} property The style property whose value is returned.\r
-       * @return {String/Array} The current value of the style property for the element(s).\r
-       */\r
-      getStyle: function(el, property) {\r
-         var f = function(el) {\r
+(function() {\r
+    var Y = YAHOO.util,     // internal shorthand\r
+        getStyle,           // for load time browser branching\r
+        setStyle,           // ditto\r
+        id_counter = 0,     // for use with generateId\r
+        propertyCache = {}; // for faster hyphen converts\r
+\r
+    // brower detection\r
+    var ua = navigator.userAgent.toLowerCase(),\r
+        isOpera = (ua.indexOf('opera') > -1),\r
+        isSafari = (ua.indexOf('safari') > -1),\r
+        isGecko = (!isOpera && !isSafari && ua.indexOf('gecko') > -1),\r
+        isIE = (!isOpera && ua.indexOf('msie') > -1);\r
+\r
+    // regex cache\r
+    var patterns = {\r
+        HYPHEN: /(-[a-z])/i\r
+    };\r
+\r
+\r
+    var toCamel = function(property) {\r
+        if ( !patterns.HYPHEN.test(property) ) {\r
+            return property; // no hyphens\r
+        }\r
+\r
+        if (propertyCache[property]) { // already converted\r
+            return propertyCache[property];\r
+        }\r
+\r
+        while( patterns.HYPHEN.exec(property) ) {\r
+            property = property.replace(RegExp.$1,\r
+                    RegExp.$1.substr(1).toUpperCase());\r
+        }\r
+\r
+        propertyCache[property] = property;\r
+        return property;\r
+        //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug\r
+    };\r
+\r
+    // branching at load instead of runtime\r
+    if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method\r
+        getStyle = function(el, property) {\r
             var value = null;\r
-            var dv = document.defaultView;\r
 \r
-            if (!property_cache[property]) {\r
-               cacheConvertedProperties(property);\r
+            var computed = document.defaultView.getComputedStyle(el, '');\r
+            if (computed) { // test computed before touching for safari\r
+                value = computed[toCamel(property)];\r
             }\r
 \r
-            var camel = property_cache[property]['camel'];\r
-            var hyphen = property_cache[property]['hyphen'];\r
-\r
-            if (property == 'opacity' && el.filters) {// IE opacity\r
-               value = 1;\r
-               try {\r
-                  value = el.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;\r
-               } catch(e) {\r
-                  try {\r
-                     value = el.filters.item('alpha').opacity / 100;\r
-                  } catch(e) {}\r
-               }\r
-            } else if (el.style[camel]) { // camelCase for valid styles\r
-               value = el.style[camel];\r
+            return el.style[property] || value;\r
+        };\r
+    } else if (document.documentElement.currentStyle && isIE) { // IE method\r
+        getStyle = function(el, property) {\r
+            switch( toCamel(property) ) {\r
+                case 'opacity' :// IE opacity uses filter\r
+                    var val = 100;\r
+                    try { // will error if no DXImageTransform\r
+                        val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;\r
+\r
+                    } catch(e) {\r
+                        try { // make sure its in the document\r
+                            val = el.filters('alpha').opacity;\r
+                        } catch(e) {\r
+                        }\r
+                    }\r
+                    return val / 100;\r
+                    break;\r
+                default:\r
+                    // test currentStyle before touching\r
+                    var value = el.currentStyle ? el.currentStyle[property] : null;\r
+                    return ( el.style[property] || value );\r
             }\r
-            else if (isIE && el.currentStyle && el.currentStyle[camel]) { // camelCase for currentStyle; isIE to workaround broken Opera 9 currentStyle\r
-               value = el.currentStyle[camel];\r
-            }\r
-            else if ( dv && dv.getComputedStyle ) { // hyphen-case for computedStyle\r
-               var computed = dv.getComputedStyle(el, '');\r
+        };\r
+    } else { // default to inline only\r
+        getStyle = function(el, property) { return el.style[property]; };\r
+    }\r
 \r
-               if (computed && computed.getPropertyValue(hyphen)) {\r
-                  value = computed.getPropertyValue(hyphen);\r
-               }\r
+    if (isIE) {\r
+        setStyle = function(el, property, val) {\r
+            switch (property) {\r
+                case 'opacity':\r
+                    if ( typeof el.style.filter == 'string' ) { // in case not appended\r
+                        el.style.filter = 'alpha(opacity=' + val * 100 + ')';\r
+\r
+                        if (!el.currentStyle || !el.currentStyle.hasLayout) {\r
+                            el.style.zoom = 1; // when no layout or cant tell\r
+                        }\r
+                    }\r
+                    break;\r
+                default:\r
+                el.style[property] = val;\r
             }\r
+        };\r
+    } else {\r
+        setStyle = function(el, property, val) {\r
+            el.style[property] = val;\r
+        };\r
+    }\r
 \r
-            return value;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {String} property The style property to be set.\r
-       * @param {String} val The value to apply to the given property.\r
-       */\r
-      setStyle: function(el, property, val) {\r
-         if (!property_cache[property]) {\r
-            cacheConvertedProperties(property);\r
-         }\r
-\r
-         var camel = property_cache[property]['camel'];\r
-\r
-         var f = function(el) {\r
-            switch(property) {\r
-               case 'opacity' :\r
-                  if (isIE && typeof el.style.filter == 'string') { // in case not appended\r
-                     el.style.filter = 'alpha(opacity=' + val * 100 + ')';\r
-\r
-                     if (!el.currentStyle || !el.currentStyle.hasLayout) {\r
-                        el.style.zoom = 1; // when no layout or cant tell\r
-                     }\r
-                  } else {\r
-                     el.style.opacity = val;\r
-                     el.style['-moz-opacity'] = val;\r
-                     el.style['-khtml-opacity'] = val;\r
-                  }\r
-\r
-                  break;\r
-               default :\r
-                  el.style[camel] = val;\r
+    /**\r
+     * Provides helper methods for DOM elements.\r
+     * @namespace YAHOO.util\r
+     * @class Dom\r
+     */\r
+    YAHOO.util.Dom = {\r
+        /**\r
+         * Returns an HTMLElement reference.\r
+         * @method get\r
+         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.\r
+         */\r
+        get: function(el) {\r
+            if (!el) { return null; } // nothing to work with\r
+\r
+            if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is\r
+                return el;\r
             }\r
 \r
-\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       @ return {Array} The XY position of the element(s)\r
-       */\r
-      getXY: function(el) {\r
-         var f = function(el) {\r
-\r
-         // has to be part of document to have pageXY\r
-            if (el.parentNode === null || this.getStyle(el, 'display') == 'none') {\r
-               return false;\r
+            if (typeof el == 'string') { // ID\r
+                return document.getElementById(el);\r
             }\r
+            else { // array of ID's and/or elements\r
+                var collection = [];\r
+                for (var i = 0, len = el.length; i < len; ++i) {\r
+                    collection[collection.length] = Y.Dom.get(el[i]);\r
+                }\r
 \r
-            var parentNode = null;\r
-            var pos = [];\r
-            var box;\r
-\r
-            if (el.getBoundingClientRect) { // IE\r
-               box = el.getBoundingClientRect();\r
-               var doc = document;\r
-               if ( !this.inDocument(el) ) {// might be in a frame, need to get its scroll\r
-                  var doc = parent.document;\r
-                  while ( doc && !this.isAncestor(doc.documentElement, el) ) {\r
-                     doc = parent.document;\r
-                  }\r
-               }\r
-\r
-               var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);\r
-               var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);\r
-\r
-               return [box.left + scrollLeft, box.top + scrollTop];\r
+                return collection;\r
             }\r
-            else { // safari, opera, & gecko\r
-               pos = [el.offsetLeft, el.offsetTop];\r
-               parentNode = el.offsetParent;\r
-               if (parentNode != el) {\r
-                  while (parentNode) {\r
-                     pos[0] += parentNode.offsetLeft;\r
-                     pos[1] += parentNode.offsetTop;\r
-                     parentNode = parentNode.offsetParent;\r
-                  }\r
-               }\r
-               if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases\r
-                  pos[0] -= document.body.offsetLeft;\r
-                  pos[1] -= document.body.offsetTop;\r
-               }\r
-            }\r
-\r
-            if (el.parentNode) { parentNode = el.parentNode; }\r
-            else { parentNode = null; }\r
-\r
-            while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')\r
-            { // account for any scrolled ancestors\r
-               pos[0] -= parentNode.scrollLeft;\r
-               pos[1] -= parentNode.scrollTop;\r
 \r
-               if (parentNode.parentNode) { parentNode = parentNode.parentNode; }\r
-               else { parentNode = null; }\r
+            return null; // safety, should never happen\r
+        },\r
+\r
+        /**\r
+         * Normalizes currentStyle and ComputedStyle.\r
+         * @method getStyle\r
+         * @param {String | HTMLElement |Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {String} property The style property whose value is returned.\r
+         * @return {String | Array} The current value of the style property for the element(s).\r
+         */\r
+        getStyle: function(el, property) {\r
+            property = toCamel(property);\r
+\r
+            var f = function(element) {\r
+                return getStyle(element, property);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.\r
+         * @method setStyle\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {String} property The style property to be set.\r
+         * @param {String} val The value to apply to the given property.\r
+         */\r
+        setStyle: function(el, property, val) {\r
+            property = toCamel(property);\r
+\r
+            var f = function(element) {\r
+                setStyle(element, property, val);\r
+\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getXY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {Array} The XY position of the element(s)\r
+         */\r
+        getXY: function(el) {\r
+            var f = function(el) {\r
+\r
+            // has to be part of document to have pageXY\r
+                if (el.parentNode === null || el.offsetParent === null ||\r
+                        this.getStyle(el, 'display') == 'none') {\r
+                    return false;\r
+                }\r
+\r
+                var parentNode = null;\r
+                var pos = [];\r
+                var box;\r
+\r
+                if (el.getBoundingClientRect) { // IE\r
+                    box = el.getBoundingClientRect();\r
+                    var doc = document;\r
+                    if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll\r
+                        doc = parent.document;\r
+\r
+                        if ( !this.isAncestor(doc.documentElement, el) ) {\r
+                            return false;\r
+                        }\r
+\r
+                    }\r
+\r
+                    var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);\r
+                    var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);\r
+\r
+                    return [box.left + scrollLeft, box.top + scrollTop];\r
+                }\r
+                else { // safari, opera, & gecko\r
+                    pos = [el.offsetLeft, el.offsetTop];\r
+                    parentNode = el.offsetParent;\r
+                    if (parentNode != el) {\r
+                        while (parentNode) {\r
+                            pos[0] += parentNode.offsetLeft;\r
+                            pos[1] += parentNode.offsetTop;\r
+                            parentNode = parentNode.offsetParent;\r
+                        }\r
+                    }\r
+                    if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases\r
+                        pos[0] -= document.body.offsetLeft;\r
+                        pos[1] -= document.body.offsetTop;\r
+                    }\r
+                }\r
+\r
+                if (el.parentNode) { parentNode = el.parentNode; }\r
+                else { parentNode = null; }\r
+\r
+                while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')\r
+                { // account for any scrolled ancestors\r
+                    if (Y.Dom.getStyle(parentNode, 'display') != 'inline') { // work around opera inline scrollLeft/Top bug\r
+                        pos[0] -= parentNode.scrollLeft;\r
+                        pos[1] -= parentNode.scrollTop;\r
+                    }\r
+\r
+                    if (parentNode.parentNode) {\r
+                        parentNode = parentNode.parentNode;\r
+                    } else { parentNode = null; }\r
+                }\r
+\r
+\r
+                return pos;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getX\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {String | Array} The X position of the element(s)\r
+         */\r
+        getX: function(el) {\r
+            var f = function(el) {\r
+                return Y.Dom.getXY(el)[0];\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method getY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @return {String | Array} The Y position of the element(s)\r
+         */\r
+        getY: function(el) {\r
+            var f = function(el) {\r
+                return Y.Dom.getXY(el)[1];\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Set the position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setXY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
+         * @param {Array} pos Contains X & Y values for new position (coordinates are page-based)\r
+         * @param {Boolean} noRetry By default we try and set the position a second time if the first fails\r
+         */\r
+        setXY: function(el, pos, noRetry) {\r
+            var f = function(el) {\r
+                var style_pos = this.getStyle(el, 'position');\r
+                if (style_pos == 'static') { // default to relative\r
+                    this.setStyle(el, 'position', 'relative');\r
+                    style_pos = 'relative';\r
+                }\r
+\r
+                var pageXY = this.getXY(el);\r
+                if (pageXY === false) { // has to be part of doc to have pageXY\r
+                    return false;\r
+                }\r
+\r
+                var delta = [ // assuming pixels; if not we will have to retry\r
+                    parseInt( this.getStyle(el, 'left'), 10 ),\r
+                    parseInt( this.getStyle(el, 'top'), 10 )\r
+                ];\r
+\r
+                if ( isNaN(delta[0]) ) {// in case of 'auto'\r
+                    delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;\r
+                }\r
+                if ( isNaN(delta[1]) ) { // in case of 'auto'\r
+                    delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;\r
+                }\r
+\r
+                if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
+                if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
+\r
+                var newXY = this.getXY(el);\r
+\r
+                // if retry is true, try one more time if we miss\r
+                if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
+                    this.setXY(el, pos, true);\r
+                }\r
+\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Set the X position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setX\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {Int} x The value to use as the X coordinate for the element(s).\r
+         */\r
+        setX: function(el, x) {\r
+            Y.Dom.setXY(el, [x, null]);\r
+        },\r
+\r
+        /**\r
+         * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.\r
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+         * @method setY\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @param {Int} x To use as the Y coordinate for the element(s).\r
+         */\r
+        setY: function(el, y) {\r
+            Y.Dom.setXY(el, [null, y]);\r
+        },\r
+\r
+        /**\r
+         * Returns the region position of the given element.\r
+         * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
+         * @method getRegion\r
+         * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
+         * @return {Region | Array} A Region or array of Region instances containing "top, left, bottom, right" member data.\r
+         */\r
+        getRegion: function(el) {\r
+            var f = function(el) {\r
+                var region = new Y.Region.getRegion(el);\r
+                return region;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Returns the width of the client (viewport).\r
+         * @method getClientWidth\r
+         * @deprecated Now using getViewportWidth.  This interface left intact for back compat.\r
+         * @return {Int} The width of the viewable area of the page.\r
+         */\r
+        getClientWidth: function() {\r
+            return Y.Dom.getViewportWidth();\r
+        },\r
+\r
+        /**\r
+         * Returns the height of the client (viewport).\r
+         * @method getClientHeight\r
+         * @deprecated Now using getViewportHeight.  This interface left intact for back compat.\r
+         * @return {Int} The height of the viewable area of the page.\r
+         */\r
+        getClientHeight: function() {\r
+            return Y.Dom.getViewportHeight();\r
+        },\r
+\r
+        /**\r
+         * Returns a array of HTMLElements with the given class.\r
+         * For optimized performance, include a tag and/or root node when possible.\r
+         * @method getElementsByClassName\r
+         * @param {String} className The class name to match against\r
+         * @param {String} tag (optional) The tag name of the elements being collected\r
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
+         * @return {Array} An array of elements that have the given class name\r
+         */\r
+        getElementsByClassName: function(className, tag, root) {\r
+            var method = function(el) { return Y.Dom.hasClass(el, className); };\r
+            return Y.Dom.getElementsBy(method, tag, root);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement has the given className.\r
+         * @method hasClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to test\r
+         * @param {String} className the class name to search for\r
+         * @return {Boolean | Array} A boolean value or array of boolean values\r
+         */\r
+        hasClass: function(el, className) {\r
+            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');\r
+\r
+            var f = function(el) {\r
+                return re.test(el['className']);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Adds a class name to a given element or collection of elements.\r
+         * @method addClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to add the class to\r
+         * @param {String} className the class name to add to the class attribute\r
+         */\r
+        addClass: function(el, className) {\r
+            var f = function(el) {\r
+                if (this.hasClass(el, className)) { return; } // already present\r
+\r
+\r
+                el['className'] = [el['className'], className].join(' ');\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Removes a class name from a given element or collection of elements.\r
+         * @method removeClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to remove the class from\r
+         * @param {String} className the class name to remove from the class attribute\r
+         */\r
+        removeClass: function(el, className) {\r
+            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');\r
+\r
+            var f = function(el) {\r
+                if (!this.hasClass(el, className)) { return; } // not present\r
+\r
+\r
+                var c = el['className'];\r
+                el['className'] = c.replace(re, ' ');\r
+                if ( this.hasClass(el, className) ) { // in case of multiple adjacent\r
+                    this.removeClass(el, className);\r
+                }\r
+\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Replace a class with another class for a given element or collection of elements.\r
+         * If no oldClassName is present, the newClassName is simply added.\r
+         * @method replaceClass\r
+         * @param {String | HTMLElement | Array} el The element or collection to remove the class from\r
+         * @param {String} oldClassName the class name to be replaced\r
+         * @param {String} newClassName the class name that will be replacing the old class name\r
+         */\r
+        replaceClass: function(el, oldClassName, newClassName) {\r
+            if (oldClassName === newClassName) { // avoid infinite loop\r
+                return false;\r
             }\r
 \r
-\r
-            return pos;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @return {String/Array} The X position of the element(s)\r
-       */\r
-      getX: function(el) {\r
-         return util.Dom.getXY(el)[0];\r
-      },\r
-\r
-      /**\r
-       * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @return {String/Array} The Y position of the element(s)\r
-       */\r
-      getY: function(el) {\r
-         return util.Dom.getXY(el)[1];\r
-      },\r
-\r
-      /**\r
-       * Set the position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements\r
-       * @param {Array} pos Contains X & Y values for new position (coordinates are page-based)\r
-       * @param {Boolean} noRetry By default we try and set the position a second time if the first fails\r
-       */\r
-      setXY: function(el, pos, noRetry) {\r
-         var f = function(el) {\r
-            var style_pos = this.getStyle(el, 'position');\r
-            if (style_pos == 'static') { // default to relative\r
-               this.setStyle(el, 'position', 'relative');\r
-               style_pos = 'relative';\r
+            var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');\r
+\r
+            var f = function(el) {\r
+\r
+                if ( !this.hasClass(el, oldClassName) ) {\r
+                    this.addClass(el, newClassName); // just add it if nothing to replace\r
+                    return; // note return\r
+                }\r
+\r
+                el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');\r
+\r
+                if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent\r
+                    this.replaceClass(el, oldClassName, newClassName);\r
+                }\r
+            };\r
+\r
+            Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Generates a unique ID\r
+         * @method generateId\r
+         * @param {String | HTMLElement | Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present).\r
+         * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").\r
+         * @return {String | Array} The generated ID, or array of generated IDs (or original ID if already present on an element)\r
+         */\r
+        generateId: function(el, prefix) {\r
+            prefix = prefix || 'yui-gen';\r
+            el = el || {};\r
+\r
+            var f = function(el) {\r
+                if (el) {\r
+                    el = Y.Dom.get(el);\r
+                } else {\r
+                    el = {}; // just generating ID in this case\r
+                }\r
+\r
+                if (!el.id) {\r
+                    el.id = prefix + id_counter++;\r
+                } // dont override existing\r
+\r
+\r
+                return el.id;\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.\r
+         * @method isAncestor\r
+         * @param {String | HTMLElement} haystack The possible ancestor\r
+         * @param {String | HTMLElement} needle The possible descendent\r
+         * @return {Boolean} Whether or not the haystack is an ancestor of needle\r
+         */\r
+        isAncestor: function(haystack, needle) {\r
+            haystack = Y.Dom.get(haystack);\r
+            if (!haystack || !needle) { return false; }\r
+\r
+            var f = function(needle) {\r
+                if (haystack.contains && !isSafari) { // safari "contains" is broken\r
+                    return haystack.contains(needle);\r
+                }\r
+                else if ( haystack.compareDocumentPosition ) {\r
+                    return !!(haystack.compareDocumentPosition(needle) & 16);\r
+                }\r
+                else { // loop up and test each parent\r
+                    var parent = needle.parentNode;\r
+\r
+                    while (parent) {\r
+                        if (parent == haystack) {\r
+                            return true;\r
+                        }\r
+                        else if (!parent.tagName || parent.tagName.toUpperCase() == 'HTML') {\r
+                            return false;\r
+                        }\r
+\r
+                        parent = parent.parentNode;\r
+                    }\r
+                    return false;\r
+                }\r
+            };\r
+\r
+            return Y.Dom.batch(needle, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Determines whether an HTMLElement is present in the current document.\r
+         * @method inDocument\r
+         * @param {String | HTMLElement} el The element to search for\r
+         * @return {Boolean} Whether or not the element is present in the current document\r
+         */\r
+        inDocument: function(el) {\r
+            var f = function(el) {\r
+                return this.isAncestor(document.documentElement, el);\r
+            };\r
+\r
+            return Y.Dom.batch(el, f, Y.Dom, true);\r
+        },\r
+\r
+        /**\r
+         * Returns a array of HTMLElements that pass the test applied by supplied boolean method.\r
+         * For optimized performance, include a tag and/or root node when possible.\r
+         * @method getElementsBy\r
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.\r
+\r
+         * @param {String} tag (optional) The tag name of the elements being collected\r
+         * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
+         */\r
+        getElementsBy: function(method, tag, root) {\r
+            tag = tag || '*';\r
+            root = Y.Dom.get(root) || document;\r
+\r
+            var nodes = [];\r
+            var elements = root.getElementsByTagName(tag);\r
+\r
+            if ( !elements.length && (tag == '*' && root.all) ) {\r
+                elements = root.all; // IE < 6\r
             }\r
 \r
-            var pageXY = this.getXY(el);\r
-            if (pageXY === false) { // has to be part of doc to have pageXY\r
-               return false;\r
+            for (var i = 0, len = elements.length; i < len; ++i) {\r
+                if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }\r
             }\r
 \r
-            var delta = [ // assuming pixels; if not we will have to retry\r
-               parseInt( this.getStyle(el, 'left'), 10 ),\r
-               parseInt( this.getStyle(el, 'top'), 10 )\r
-            ];\r
 \r
-            if ( isNaN(delta[0]) ) {// in case of 'auto'\r
-               delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;\r
-            }\r
-            if ( isNaN(delta[1]) ) { // in case of 'auto'\r
-               delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;\r
+            return nodes;\r
+        },\r
+\r
+        /**\r
+         * Returns an array of elements that have had the supplied method applied.\r
+         * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).\r
+         * @method batch\r
+         * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to\r
+         * @param {Function} method The method to apply to the element(s)\r
+         * @param {Any} o (optional) An optional arg that is passed to the supplied method\r
+         * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"\r
+         * @return {HTMLElement | Array} The element(s) with the method applied\r
+         */\r
+        batch: function(el, method, o, override) {\r
+            var id = el;\r
+            el = Y.Dom.get(el);\r
+\r
+            var scope = (override) ? o : window;\r
+\r
+            if (!el || el.tagName || !el.length) { // is null or not a collection (tagName for SELECT and others that can be both an element and a collection)\r
+                if (!el) {\r
+                    return false;\r
+                }\r
+                return method.call(scope, el, o);\r
             }\r
 \r
-            if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
-            if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
-\r
-            var newXY = this.getXY(el);\r
+            var collection = [];\r
 \r
-            // if retry is true, try one more time if we miss\r
-            if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
-               this.setXY(el, pos, true);\r
+            for (var i = 0, len = el.length; i < len; ++i) {\r
+                if (!el[i]) {\r
+                    id = el[i];\r
+                }\r
+                collection[collection.length] = method.call(scope, el[i], o);\r
             }\r
 \r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Set the X position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {Int} x to use as the X coordinate for the element(s).\r
-       */\r
-      setX: function(el, x) {\r
-         util.Dom.setXY(el, [x, null]);\r
-      },\r
-\r
-      /**\r
-       * Set the Y position of an html element in page coordinates, regardless of how the element is positioned.\r
-       * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @param {Int} x to use as the Y coordinate for the element(s).\r
-       */\r
-      setY: function(el, y) {\r
-         util.Dom.setXY(el, [null, y]);\r
-      },\r
-\r
-      /**\r
-       * Returns the region position of the given element.\r
-       * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
-       * @param {String/HTMLElement/Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.\r
-       * @return {Region/Array} A Region or array of Region instances containing "top, left, bottom, right" member data.\r
-       */\r
-      getRegion: function(el) {\r
-         var f = function(el) {\r
-            var region = new YAHOO.util.Region.getRegion(el);\r
-            return region;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Returns the width of the client (viewport).\r
-       * Now using getViewportWidth.  This interface left intact for back compat.\r
-       * @return {Int} The width of the viewable area of the page.\r
-       */\r
-      getClientWidth: function() {\r
-         return util.Dom.getViewportWidth();\r
-      },\r
-\r
-      /**\r
-       * Returns the height of the client (viewport).\r
-       * Now using getViewportHeight.  This interface left intact for back compat.\r
-       * @return {Int} The height of the viewable area of the page.\r
-       */\r
-      getClientHeight: function() {\r
-         return util.Dom.getViewportHeight();\r
-      },\r
-\r
-      /**\r
-       * Returns a array of HTMLElements with the given class\r
-       * For optimized performance, include a tag and/or root node if possible\r
-       * @param {String} className The class name to match against\r
-       * @param {String} tag (optional) The tag name of the elements being collected\r
-       * @param {String/HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
-       * @return {Array} An array of elements that have the given class name\r
-       */\r
-      getElementsByClassName: function(className, tag, root) {\r
-         var method = function(el) { return util.Dom.hasClass(el, className) };\r
-         return util.Dom.getElementsBy(method, tag, root);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement has the given className\r
-       * @param {String/HTMLElement/Array} el The element or collection to test\r
-       * @param {String} className the class name to search for\r
-       * @return {Boolean/Array} A boolean value or array of boolean values\r
-       */\r
-      hasClass: function(el, className) {\r
-         var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');\r
-\r
-         var f = function(el) {\r
-            return re.test(el['className']);\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Adds a class name to a given element or collection of elements\r
-       * @param {String/HTMLElement/Array} el The element or collection to add the class to\r
-       * @param {String} className the class name to add to the class attribute\r
-       */\r
-      addClass: function(el, className) {\r
-         var f = function(el) {\r
-            if (this.hasClass(el, className)) { return; } // already present\r
-\r
-\r
-            el['className'] = [el['className'], className].join(' ');\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Removes a class name from a given element or collection of elements\r
-       * @param {String/HTMLElement/Array} el The element or collection to remove the class from\r
-       * @param {String} className the class name to remove from the class attribute\r
-       */\r
-      removeClass: function(el, className) {\r
-         var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');\r
-\r
-         var f = function(el) {\r
-            if (!this.hasClass(el, className)) { return; } // not present\r
-\r
-\r
-            var c = el['className'];\r
-            el['className'] = c.replace(re, ' ');\r
-            if ( this.hasClass(el, className) ) { // in case of multiple adjacent\r
-               this.removeClass(el, className);\r
+            return collection;\r
+        },\r
+\r
+        /**\r
+         * Returns the height of the document.\r
+         * @method getDocumentHeight\r
+         * @return {Int} The height of the actual document (which includes the body and its margin).\r
+         */\r
+        getDocumentHeight: function() {\r
+            var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;\r
+\r
+            var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());\r
+            return h;\r
+        },\r
+\r
+        /**\r
+         * Returns the width of the document.\r
+         * @method getDocumentWidth\r
+         * @return {Int} The width of the actual document (which includes the body and its margin).\r
+         */\r
+        getDocumentWidth: function() {\r
+            var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;\r
+            var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());\r
+            return w;\r
+        },\r
+\r
+        /**\r
+         * Returns the current height of the viewport.\r
+         * @method getViewportHeight\r
+         * @return {Int} The height of the viewable area of the page (excludes scrollbars).\r
+         */\r
+        getViewportHeight: function() {\r
+            var height = self.innerHeight; // Safari, Opera\r
+            var mode = document.compatMode;\r
+\r
+            if ( (mode || isIE) && !isOpera ) { // IE, Gecko\r
+                height = (mode == 'CSS1Compat') ?\r
+                        document.documentElement.clientHeight : // Standards\r
+                        document.body.clientHeight; // Quirks\r
             }\r
 \r
-         };\r
+            return height;\r
+        },\r
 \r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
+        /**\r
+         * Returns the current width of the viewport.\r
+         * @method getViewportWidth\r
+         * @return {Int} The width of the viewable area of the page (excludes scrollbars).\r
+         */\r
 \r
-      /**\r
-       * Replace a class with another class for a given element or collection of elements.\r
-       * If no oldClassName is present, the newClassName is simply added.\r
-       * @param {String/HTMLElement/Array} el The element or collection to remove the class from\r
-       * @param {String} oldClassName the class name to be replaced\r
-       * @param {String} newClassName the class name that will be replacing the old class name\r
-       */\r
-      replaceClass: function(el, oldClassName, newClassName) {\r
-         var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');\r
+        getViewportWidth: function() {\r
+            var width = self.innerWidth;  // Safari\r
+            var mode = document.compatMode;\r
 \r
-         var f = function(el) {\r
-\r
-            el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');\r
-\r
-            if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent\r
-               this.replaceClass(el, oldClassName, newClassName);\r
+            if (mode || isIE) { // IE, Gecko, Opera\r
+                width = (mode == 'CSS1Compat') ?\r
+                        document.documentElement.clientWidth : // Standards\r
+                        document.body.clientWidth; // Quirks\r
             }\r
-         };\r
-\r
-         util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Generates a unique ID\r
-       * @param {String/HTMLElement/Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present)\r
-       * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen")\r
-       * @return {String/Array} The generated ID, or array of generated IDs (or original ID if already present on an element)\r
-       */\r
-      generateId: function(el, prefix) {\r
-         prefix = prefix || 'yui-gen';\r
-         el = el || {};\r
-\r
-         var f = function(el) {\r
-            if (el) {\r
-               el = util.Dom.get(el);\r
-            } else {\r
-               el = {}; // just generating ID in this case\r
-            }\r
-\r
-            if (!el.id) {\r
-               el.id = prefix + id_counter++;\r
-            } // dont override existing\r
-\r
-\r
-            return el.id;\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy\r
-       * @param {String/HTMLElement} haystack The possible ancestor\r
-       * @param {String/HTMLElement} needle The possible descendent\r
-       * @return {Boolean} Whether or not the haystack is an ancestor of needle\r
-       */\r
-      isAncestor: function(haystack, needle) {\r
-         haystack = util.Dom.get(haystack);\r
-         if (!haystack || !needle) { return false; }\r
-\r
-         var f = function(needle) {\r
-            if (haystack.contains && !isSafari) { // safari "contains" is broken\r
-               return haystack.contains(needle);\r
-            }\r
-            else if ( haystack.compareDocumentPosition ) {\r
-               return !!(haystack.compareDocumentPosition(needle) & 16);\r
-            }\r
-            else { // loop up and test each parent\r
-               var parent = needle.parentNode;\r
-\r
-               while (parent) {\r
-                  if (parent == haystack) {\r
-                     return true;\r
-                  }\r
-                  else if (parent.tagName.toUpperCase() == 'HTML') {\r
-                     return false;\r
-                  }\r
-\r
-                  parent = parent.parentNode;\r
-               }\r
-               return false;\r
-            }\r
-         };\r
-\r
-         return util.Dom.batch(needle, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Determines whether an HTMLElement is present in the current document\r
-       * @param {String/HTMLElement} el The element to search for\r
-       * @return {Boolean} Whether or not the element is present in the current document\r
-       */\r
-      inDocument: function(el) {\r
-         var f = function(el) {\r
-            return this.isAncestor(document.documentElement, el);\r
-         };\r
-\r
-         return util.Dom.batch(el, f, util.Dom, true);\r
-      },\r
-\r
-      /**\r
-       * Returns a array of HTMLElements that pass the test applied by supplied boolean method\r
-       * For optimized performance, include a tag and/or root node if possible\r
-       * @param {Function} method A boolean method to test elements with\r
-       * @param {String} tag (optional) The tag name of the elements being collected\r
-       * @param {String/HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point\r
-       */\r
-      getElementsBy: function(method, tag, root) {\r
-         tag = tag || '*';\r
-         root = util.Dom.get(root) || document;\r
-\r
-         var nodes = [];\r
-         var elements = root.getElementsByTagName(tag);\r
-\r
-         if ( !elements.length && (tag == '*' && root.all) ) {\r
-            elements = root.all; // IE < 6\r
-         }\r
-\r
-         for (var i = 0, len = elements.length; i < len; ++i)\r
-         {\r
-            if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }\r
-         }\r
-\r
-\r
-         return nodes;\r
-      },\r
-\r
-      /**\r
-       * Returns an array of elements that have had the supplied method applied.\r
-       * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) )\r
-       * @param {String/HTMLElement/Array} el (optional) An element or array of elements to apply the method to\r
-       * @param {Function} method The method to apply to the element(s)\r
-       * @param {Generic} (optional) o An optional arg that is passed to the supplied method\r
-       * @param {Boolean} (optional) override Whether or not to override the scope of "method" with "o"\r
-       * @return {HTMLElement/Array} The element(s) with the method applied\r
-       */\r
-      batch: function(el, method, o, override) {\r
-         var id = el;\r
-         el = util.Dom.get(el);\r
-\r
-         var scope = (override) ? o : window;\r
-\r
-         if (!el || el.tagName || !el.length) { // is null or not a collection (tagName for SELECT and others that can be both an element and a collection)\r
-            if (!el) {\r
-               return false;\r
-            }\r
-            return method.call(scope, el, o);\r
-         }\r
-\r
-         var collection = [];\r
-\r
-         for (var i = 0, len = el.length; i < len; ++i) {\r
-            if (!el[i]) {\r
-               id = id[i];\r
-            }\r
-            collection[collection.length] = method.call(scope, el[i], o);\r
-         }\r
-\r
-         return collection;\r
-      },\r
-\r
-      /**\r
-       * Returns the height of the document.\r
-       * @return {Int} The height of the actual document (which includes the body and its margin).\r
-       */\r
-      getDocumentHeight: function() {\r
-         var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;\r
-         var marginTop = parseInt(util.Dom.getStyle(document.body, 'marginTop'), 10);\r
-         var marginBottom = parseInt(util.Dom.getStyle(document.body, 'marginBottom'), 10);\r
-\r
-         var mode = document.compatMode;\r
-\r
-         if ( (mode || isIE) && !isOpera ) { // (IE, Gecko)\r
-            switch (mode) {\r
-               case 'CSS1Compat': // Standards mode\r
-                  scrollHeight = ((window.innerHeight && window.scrollMaxY) ?  window.innerHeight+window.scrollMaxY : -1);\r
-                  windowHeight = [document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a, b){return(a-b);})[1];\r
-                  bodyHeight = document.body.offsetHeight + marginTop + marginBottom;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  scrollHeight = document.body.scrollHeight;\r
-                  bodyHeight = document.body.clientHeight;\r
-            }\r
-         } else { // Safari & Opera\r
-            scrollHeight = document.documentElement.scrollHeight;\r
-            windowHeight = self.innerHeight;\r
-            bodyHeight = document.documentElement.clientHeight;\r
-         }\r
-\r
-         var h = [scrollHeight,windowHeight,bodyHeight].sort(function(a, b){return(a-b);});\r
-         return h[2];\r
-      },\r
-\r
-      /**\r
-       * Returns the width of the document.\r
-       * @return {Int} The width of the actual document (which includes the body and its margin).\r
-       */\r
-      getDocumentWidth: function() {\r
-         var docWidth=-1,bodyWidth=-1,winWidth=-1;\r
-         var marginRight = parseInt(util.Dom.getStyle(document.body, 'marginRight'), 10);\r
-         var marginLeft = parseInt(util.Dom.getStyle(document.body, 'marginLeft'), 10);\r
-\r
-         var mode = document.compatMode;\r
-\r
-         if (mode || isIE) { // (IE, Gecko, Opera)\r
-            switch (mode) {\r
-               case 'CSS1Compat': // Standards mode\r
-                  docWidth = document.documentElement.clientWidth;\r
-                  bodyWidth = document.body.offsetWidth + marginLeft + marginRight;\r
-                  winWidth = self.innerWidth || -1;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  bodyWidth = document.body.clientWidth;\r
-                  winWidth = document.body.scrollWidth;\r
-                  break;\r
-            }\r
-         } else { // Safari\r
-            docWidth = document.documentElement.clientWidth;\r
-            bodyWidth = document.body.offsetWidth + marginLeft + marginRight;\r
-            winWidth = self.innerWidth;\r
-         }\r
-\r
-         var w = [docWidth,bodyWidth,winWidth].sort(function(a, b){return(a-b);});\r
-         return w[2];\r
-      },\r
-\r
-      /**\r
-       * Returns the current height of the viewport.\r
-       * @return {Int} The height of the viewable area of the page (excludes scrollbars).\r
-       */\r
-      getViewportHeight: function() {\r
-         var height = -1;\r
-         var mode = document.compatMode;\r
-\r
-         if ( (mode || isIE) && !isOpera ) {\r
-            switch (mode) { // (IE, Gecko)\r
-               case 'CSS1Compat': // Standards mode\r
-                  height = document.documentElement.clientHeight;\r
-                  break;\r
-\r
-               default: // Quirks\r
-                  height = document.body.clientHeight;\r
-            }\r
-         } else { // Safari, Opera\r
-            height = self.innerHeight;\r
-         }\r
-\r
-         return height;\r
-      },\r
-\r
-      /**\r
-       * Returns the current width of the viewport.\r
-       * @return {Int} The width of the viewable area of the page (excludes scrollbars).\r
-       */\r
-\r
-      getViewportWidth: function() {\r
-         var width = -1;\r
-         var mode = document.compatMode;\r
-\r
-         if (mode || isIE) { // (IE, Gecko, Opera)\r
-            switch (mode) {\r
-            case 'CSS1Compat': // Standards mode\r
-               width = document.documentElement.clientWidth;\r
-               break;\r
-\r
-            default: // Quirks\r
-               width = document.body.clientWidth;\r
-            }\r
-         } else { // Safari\r
-            width = self.innerWidth;\r
-         }\r
-         return width;\r
-      }\r
-   };\r
-}();\r
-\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-*/\r
-\r
+            return width;\r
+        }\r
+    };\r
+})();\r
 /**\r
- * @class A region is a representation of an object on a grid.  It is defined\r
+ * A region is a representation of an object on a grid.  It is defined\r
  * by the top, right, bottom, left extents, so is rectangular by default.  If\r
  * other shapes are required, this class could be extended to support it.\r
- *\r
- * @param {int} t the top extent\r
- * @param {int} r the right extent\r
- * @param {int} b the bottom extent\r
- * @param {int} l the left extent\r
+ * @namespace YAHOO.util\r
+ * @class Region\r
+ * @param {Int} t the top extent\r
+ * @param {Int} r the right extent\r
+ * @param {Int} b the bottom extent\r
+ * @param {Int} l the left extent\r
  * @constructor\r
  */\r
 YAHOO.util.Region = function(t, r, b, l) {\r
 \r
     /**\r
      * The region's top extent\r
-     * @type int\r
+     * @property top\r
+     * @type Int\r
      */\r
     this.top = t;\r
 \r
     /**\r
      * The region's top extent as index, for symmetry with set/getXY\r
-     * @type int\r
+     * @property 1\r
+     * @type Int\r
      */\r
     this[1] = t;\r
 \r
     /**\r
      * The region's right extent\r
+     * @property right\r
      * @type int\r
      */\r
     this.right = r;\r
 \r
     /**\r
      * The region's bottom extent\r
-     * @type int\r
+     * @property bottom\r
+     * @type Int\r
      */\r
     this.bottom = b;\r
 \r
     /**\r
      * The region's left extent\r
-     * @type int\r
+     * @property left\r
+     * @type Int\r
      */\r
     this.left = l;\r
 \r
     /**\r
      * The region's left extent as index, for symmetry with set/getXY\r
-     * @type int\r
+     * @property 0\r
+     * @type Int\r
      */\r
     this[0] = l;\r
 };\r
 \r
 /**\r
  * Returns true if this region contains the region passed in\r
- *\r
+ * @method contains\r
  * @param  {Region}  region The region to evaluate\r
- * @return {boolean}        True if the region is contained with this region,\r
+ * @return {Boolean}        True if the region is contained with this region,\r
  *                          else false\r
  */\r
 YAHOO.util.Region.prototype.contains = function(region) {\r
@@ -774,8 +769,8 @@ YAHOO.util.Region.prototype.contains = function(region) {
 \r
 /**\r
  * Returns the area of the region\r
- *\r
- * @return {int} the region's area\r
+ * @method getArea\r
+ * @return {Int} the region's area\r
  */\r
 YAHOO.util.Region.prototype.getArea = function() {\r
     return ( (this.bottom - this.top) * (this.right - this.left) );\r
@@ -783,7 +778,7 @@ YAHOO.util.Region.prototype.getArea = function() {
 \r
 /**\r
  * Returns the region where the passed in region overlaps with this one\r
- *\r
+ * @method intersect\r
  * @param  {Region} region The region that intersects\r
  * @return {Region}        The overlap region, or null if there is no overlap\r
  */\r
@@ -803,7 +798,7 @@ YAHOO.util.Region.prototype.intersect = function(region) {
 /**\r
  * Returns the region representing the smallest region that can contain both\r
  * the passed in region and this region.\r
- *\r
+ * @method union\r
  * @param  {Region} region The region that to create the union with\r
  * @return {Region}        The union region\r
  */\r
@@ -818,6 +813,7 @@ YAHOO.util.Region.prototype.union = function(region) {
 \r
 /**\r
  * toString\r
+ * @method toString\r
  * @return string the region properties\r
  */\r
 YAHOO.util.Region.prototype.toString = function() {\r
@@ -831,7 +827,7 @@ YAHOO.util.Region.prototype.toString = function() {
 \r
 /**\r
  * Returns a region that is occupied by the DOM element\r
- *\r
+ * @method getRegion\r
  * @param  {HTMLElement} el The element\r
  * @return {Region}         The region that the element occupies\r
  * @static\r
@@ -850,15 +846,14 @@ YAHOO.util.Region.getRegion = function(el) {
 /////////////////////////////////////////////////////////////////////////////\r
 \r
 /**\r
- * @class\r
- *\r
  * A point is a region that is special in that it represents a single point on\r
  * the grid.\r
- *\r
- * @param {int} x The X position of the point\r
- * @param {int} y The Y position of the point\r
+ * @namespace YAHOO.util\r
+ * @class Point\r
+ * @param {Int} x The X position of the point\r
+ * @param {Int} y The Y position of the point\r
  * @constructor\r
- * @extends Region\r
+ * @extends YAHOO.util.Region\r
  */\r
 YAHOO.util.Point = function(x, y) {\r
    if (x instanceof Array) { // accept output from Dom.getXY\r
@@ -868,14 +863,16 @@ YAHOO.util.Point = function(x, y) {
 \r
     /**\r
      * The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)\r
-     * @type int\r
+     * @property x\r
+     * @type Int\r
      */\r
 \r
     this.x = this.right = this.left = this[0] = x;\r
 \r
     /**\r
      * The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)\r
-     * @type int\r
+     * @property y\r
+     * @type Int\r
      */\r
     this.y = this.top = this.bottom = this[1] = y;\r
 };\r
index af7a2d6a616ce20a0c69cd36a6822dea100708eb..c76e65cc44215facd1cd8399b2011be09f797a0b 100755 (executable)
@@ -1,5 +1,53 @@
 Drag and Drop Release Notes\r
 \r
+0.12.0\r
+\r
+   * The logic to determine if a drag should be initiated has been isolated\r
+     to the clickValidator method.  This method can be overridden to provide\r
+     custom valdiation logic.  For example, it is possible to specify hotspots\r
+     of any dimension or shape.  The provided example shows how to make only\r
+     a circular region in the middle of the element initiate a drag.\r
+\r
+   * Added a new drag and drop event: onInvalidDrop.  This is executed when\r
+     the dragged element in dropped in a location without a target.  Previously\r
+     this condition could only detected by implementing handlers for three \r
+     other events.\r
+\r
+   * Now accepts an element reference in lieu of an id.  Ids will\r
+     be generated if the element does not have one.\r
+\r
+   * Fixed horizontal autoscroll when scrollTop is zero.\r
+\r
+   * Added hasOuterHandles property to bypass the isOverTarget check in the\r
+     mousedown validation routine.  Fixes setOuterHandleElId.\r
+\r
+0.11.4\r
+\r
+   * YAHOO.util.DragDropMgr.swapNode now handles adjacent nodes properly\r
+   \r
+   * Fixed missing variable declarations\r
+\r
+0.11.3\r
\r
+   * Fixed a JavaScript error that would be generated when trying to implement\r
+     DDProxy using the default settings and a tiny element.\r
+\r
+   * Fixed an error that resulted when constraints were applied to DragDrop \r
+     instances.\r
+\r
+0.11.2\r
+\r
+   * Drag and drop will no longer interfere with selecting text on elements\r
+     that are not involved in drag and drop.\r
+\r
+   * The shared drag and drop proxy element now resizes correctly when autoResize\r
+     is enabled.\r
+\r
+0.11.1\r
+\r
+   * Fixes an issue where the setXY cache could get out of sync if the element's\r
+     offsetParent is changed during onDragDrop.\r
+\r
 0.11.0\r
 \r
    * The Dom.util.setXY calculation for the initial placement of the dragged\r
@@ -32,7 +80,7 @@ Drag and Drop Release Notes
 \r
 0.10.0\r
 \r
-   * Improved the performance in intersect mode\r
+   * Improved the performance when in intersect mode\r
 \r
    * It was possible for the drag and drop initialization to be skipped\r
      for very slow loading pages.  This was fixed.\r
index ce4013e9bce0eda8e01197c7b9e86da835316cda..e08f31d2b37be6382d7dee3967b5d477ae470403 100755 (executable)
@@ -1,24 +1,28 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+\r
+(function() {\r
 \r
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+var Event=YAHOO.util.Event;\r
+var Dom=YAHOO.util.Dom;\r
 \r
 /**\r
- * Defines the interface and base operation of items that that can be \r
+ * Defines the interface and base operation of items that that can be\r
  * dragged or can be drop targets.  It was designed to be extended, overriding\r
  * the event handlers for startDrag, onDrag, onDragOver, onDragOut.\r
  * Up to three html elements can be associated with a DragDrop instance:\r
  * <ul>\r
  * <li>linked element: the element that is passed into the constructor.\r
- * This is the element which defines the boundaries for interaction with \r
+ * This is the element which defines the boundaries for interaction with\r
  * other DragDrop objects.</li>\r
- * <li>handle element(s): The drag operation only occurs if the element that \r
- * was clicked matches a handle element.  By default this is the linked \r
- * element, but there are times that you will want only a portion of the \r
- * linked element to initiate the drag operation, and the setHandleElId() \r
+ * <li>handle element(s): The drag operation only occurs if the element that\r
+ * was clicked matches a handle element.  By default this is the linked\r
+ * element, but there are times that you will want only a portion of the\r
+ * linked element to initiate the drag operation, and the setHandleElId()\r
  * method provides a way to define this.</li>\r
  * <li>drag element: this represents an the element that would be moved along\r
  * with the cursor during a drag operation.  By default, this is the linked\r
@@ -28,122 +32,129 @@ version: 0.11.0
  * </ul>\r
  * This class should not be instantiated until the onload event to ensure that\r
  * the associated elements are available.\r
- * The following would define a DragDrop obj that would interact with any \r
- * other DragDrop obj in the "group1" group:\r
+ * The following would define a DragDrop obj that would interact with any\r
+ * other DragDrop obj in the "group1" group:\r
  * <pre>\r
  *  dd = new YAHOO.util.DragDrop("div1", "group1");\r
  * </pre>\r
- * Since none of the event handlers have been implemented, nothing would \r
- * actually happen if you were to run the code above.  Normally you would \r
- * override this class or one of the default implementations, but you can \r
+ * Since none of the event handlers have been implemented, nothing would\r
+ * actually happen if you were to run the code above.  Normally you would\r
+ * override this class or one of the default implementations, but you can\r
  * also override the methods you want on an instance of the class...\r
  * <pre>\r
  *  dd.onDragDrop = function(e, id) {\r
- *   alert("dd was dropped on " + id);\r
+ *  &nbsp;&nbsp;alert("dd was dropped on " + id);\r
  *  }\r
  * </pre>\r
+ * @namespace YAHOO.util\r
+ * @class DragDrop\r
  * @constructor\r
  * @param {String} id of the element that is linked to this instance\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DragDrop: \r
+ *                Valid properties for DragDrop:\r
  *                    padding, isTarget, maintainOffset, primaryButtonOnly\r
  */\r
 YAHOO.util.DragDrop = function(id, sGroup, config) {\r
     if (id) {\r
-        this.init(id, sGroup, config); \r
+        this.init(id, sGroup, config);\r
     }\r
 };\r
 \r
 YAHOO.util.DragDrop.prototype = {\r
 \r
     /**\r
-     * The id of the element associated with this object.  This is what we \r
-     * refer to as the "linked element" because the size and position of \r
-     * this element is used to determine when the drag and drop objects have \r
+     * The id of the element associated with this object.  This is what we\r
+     * refer to as the "linked element" because the size and position of\r
+     * this element is used to determine when the drag and drop objects have\r
      * interacted.\r
-     *\r
+     * @property id\r
      * @type String\r
      */\r
     id: null,\r
 \r
     /**\r
      * Configuration attributes passed into the constructor\r
+     * @property config\r
      * @type object\r
      */\r
     config: null,\r
 \r
     /**\r
-     * The id of the element that will be dragged.  By default this is same \r
-     * as the linked element , but could be changed to another element. Ex: \r
+     * The id of the element that will be dragged.  By default this is same\r
+     * as the linked element , but could be changed to another element. Ex:\r
      * YAHOO.util.DDProxy\r
-     *\r
+     * @property dragElId\r
      * @type String\r
      * @private\r
      */\r
-    dragElId: null, \r
+    dragElId: null,\r
 \r
     /**\r
-     * the id of the element that initiates the drag operation.  By default \r
+     * the id of the element that initiates the drag operation.  By default\r
      * this is the linked element, but could be changed to be a child of this\r
-     * element.  This lets us do things like only starting the drag when the \r
+     * element.  This lets us do things like only starting the drag when the\r
      * header element within the linked html element is clicked.\r
-     *\r
+     * @property handleElId\r
      * @type String\r
      * @private\r
      */\r
-    handleElId: null, \r
+    handleElId: null,\r
 \r
     /**\r
      * An associative array of HTML tags that will be ignored if clicked.\r
+     * @property invalidHandleTypes\r
      * @type {string: string}\r
      */\r
-    invalidHandleTypes: null, \r
+    invalidHandleTypes: null,\r
 \r
     /**\r
      * An associative array of ids for elements that will be ignored if clicked\r
+     * @property invalidHandleIds\r
      * @type {string: string}\r
      */\r
-    invalidHandleIds: null, \r
+    invalidHandleIds: null,\r
 \r
     /**\r
      * An indexted array of css class names for elements that will be ignored\r
      * if clicked.\r
+     * @property invalidHandleClasses\r
      * @type string[]\r
      */\r
-    invalidHandleClasses: null, \r
+    invalidHandleClasses: null,\r
 \r
     /**\r
-     * The linked element's absolute X position at the time the drag was \r
+     * The linked element's absolute X position at the time the drag was\r
      * started\r
-     *\r
+     * @property startPageX\r
      * @type int\r
      * @private\r
      */\r
     startPageX: 0,\r
 \r
     /**\r
-     * The linked element's absolute X position at the time the drag was \r
+     * The linked element's absolute X position at the time the drag was\r
      * started\r
-     *\r
+     * @property startPageY\r
      * @type int\r
      * @private\r
      */\r
     startPageY: 0,\r
 \r
     /**\r
-     * The group defines a logical collection of DragDrop objects that are \r
-     * related.  Instances only get events when interacting with other \r
-     * DragDrop object in the same group.  This lets us define multiple \r
+     * The group defines a logical collection of DragDrop objects that are\r
+     * related.  Instances only get events when interacting with other\r
+     * DragDrop object in the same group.  This lets us define multiple\r
      * groups using a single DragDrop subclass if we want.\r
+     * @property groups\r
      * @type {string: string}\r
      */\r
     groups: null,\r
 \r
     /**\r
-     * Individual drag/drop instances can be locked.  This will prevent \r
+     * Individual drag/drop instances can be locked.  This will prevent\r
      * onmousedown start drag.\r
-     *\r
+     * @property locked\r
      * @type boolean\r
      * @private\r
      */\r
@@ -151,18 +162,20 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Lock this instance\r
+     * @method lock\r
      */\r
     lock: function() { this.locked = true; },\r
 \r
     /**\r
      * Unlock this instace\r
+     * @method unlock\r
      */\r
     unlock: function() { this.locked = false; },\r
 \r
     /**\r
      * By default, all insances can be a drop target.  This can be disabled by\r
      * setting isTarget to false.\r
-     *\r
+     * @method isTarget\r
      * @type boolean\r
      */\r
     isTarget: true,\r
@@ -170,24 +183,28 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * The padding configured for this drag and drop object for calculating\r
      * the drop zone intersection with this object.\r
+     * @method padding\r
      * @type int[]\r
      */\r
     padding: null,\r
 \r
     /**\r
+     * Cached reference to the linked element\r
+     * @property _domRef\r
      * @private\r
      */\r
     _domRef: null,\r
 \r
     /**\r
      * Internal typeof flag\r
+     * @property __ygDragDrop\r
      * @private\r
      */\r
     __ygDragDrop: true,\r
 \r
     /**\r
      * Set to true when horizontal contraints are applied\r
-     *\r
+     * @property constrainX\r
      * @type boolean\r
      * @private\r
      */\r
@@ -195,7 +212,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Set to true when vertical contraints are applied\r
-     *\r
+     * @property constrainY\r
      * @type boolean\r
      * @private\r
      */\r
@@ -203,7 +220,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * The left constraint\r
-     *\r
+     * @property minX\r
      * @type int\r
      * @private\r
      */\r
@@ -211,47 +228,53 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * The right constraint\r
-     *\r
+     * @property maxX\r
      * @type int\r
      * @private\r
      */\r
     maxX: 0,\r
 \r
     /**\r
-     * The up constraint \r
-     *\r
+     * The up constraint\r
+     * @property minY\r
+     * @type int\r
      * @type int\r
      * @private\r
      */\r
     minY: 0,\r
 \r
     /**\r
-     * The down constraint \r
-     *\r
+     * The down constraint\r
+     * @property maxY\r
      * @type int\r
      * @private\r
      */\r
     maxY: 0,\r
 \r
     /**\r
-     * Maintain offsets when we resetconstraints.  Used to maintain the \r
-     * slider thumb value, and this needs to be fixed.\r
+     * Maintain offsets when we resetconstraints.  Set to true when you want\r
+     * the position of the element relative to its parent to stay the same\r
+     * when the page changes\r
+     *\r
+     * @property maintainOffset\r
      * @type boolean\r
      */\r
     maintainOffset: false,\r
 \r
     /**\r
-     * Array of pixel locations the element will snap to if we specified a \r
+     * Array of pixel locations the element will snap to if we specified a\r
      * horizontal graduation/interval.  This array is generated automatically\r
      * when you define a tick interval.\r
+     * @property xTicks\r
      * @type int[]\r
      */\r
     xTicks: null,\r
 \r
     /**\r
-     * Array of pixel locations the element will snap to if we specified a \r
-     * vertical graduation/interval.  This array is generated automatically \r
+     * Array of pixel locations the element will snap to if we specified a\r
+     * vertical graduation/interval.  This array is generated automatically\r
      * when you define a tick interval.\r
+     * @property yTicks\r
      * @type int[]\r
      */\r
     yTicks: null,\r
@@ -261,18 +284,34 @@ YAHOO.util.DragDrop.prototype = {
      * button click (left button for a right-handed mouse).  Set to true to\r
      * allow drag and drop to start with any mouse click that is propogated\r
      * by the browser\r
+     * @property primaryButtonOnly\r
      * @type boolean\r
      */\r
     primaryButtonOnly: true,\r
 \r
     /**\r
      * The availabe property is false until the linked dom element is accessible.\r
+     * @property available\r
      * @type boolean\r
      */\r
     available: false,\r
 \r
+    /**\r
+     * By default, drags can only be initiated if the mousedown occurs in the\r
+     * region the linked element is.  This is done in part to work around a\r
+     * bug in some browsers that mis-report the mousedown if the previous\r
+     * mouseup happened outside of the window.  This property is set to true\r
+     * if outer handles are defined.\r
+     *\r
+     * @property hasOuterHandles\r
+     * @type boolean\r
+     * @default false\r
+     */\r
+    hasOuterHandles: false,\r
+\r
     /**\r
      * Code that executes immediately before the startDrag event\r
+     * @method b4StartDrag\r
      * @private\r
      */\r
     b4StartDrag: function(x, y) { },\r
@@ -280,7 +319,7 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Abstract method called after a drag/drop object is clicked\r
      * and the drag or mousedown time thresholds have beeen met.\r
-     *\r
+     * @method startDrag\r
      * @param {int} X click location\r
      * @param {int} Y click location\r
      */\r
@@ -288,134 +327,144 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Code that executes immediately before the onDrag event\r
+     * @method b4Drag\r
      * @private\r
      */\r
     b4Drag: function(e) { },\r
 \r
     /**\r
-     * Abstract method called during the onMouseMove event while dragging an \r
+     * Abstract method called during the onMouseMove event while dragging an\r
      * object.\r
-     *\r
-     * @param {Event} e\r
+     * @method onDrag\r
+     * @param {Event} e the mousemove event\r
      */\r
     onDrag: function(e) { /* override this */ },\r
 \r
     /**\r
-     * Code that executes immediately before the onDragEnter event\r
-     * @private\r
-     */\r
-    // b4DragEnter: function(e) { },\r
-\r
-    /**\r
-     * Abstract method called when this element fist begins hovering over \r
+     * Abstract method called when this element fist begins hovering over\r
      * another DragDrop obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this is hovering over.  In INTERSECT mode, an array of one or more \r
+     * @method onDragEnter\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this is hovering over.  In INTERSECT mode, an array of one or more\r
      * dragdrop items being hovered over.\r
      */\r
     onDragEnter: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragOver event\r
+     * @method b4DragOver\r
      * @private\r
      */\r
     b4DragOver: function(e) { },\r
 \r
     /**\r
-     * Abstract method called when this element is hovering over another \r
+     * Abstract method called when this element is hovering over another\r
      * DragDrop obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this is hovering over.  In INTERSECT mode, an array of dd items \r
+     * @method onDragOver\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this is hovering over.  In INTERSECT mode, an array of dd items\r
      * being hovered over.\r
      */\r
     onDragOver: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragOut event\r
+     * @method b4DragOut\r
      * @private\r
      */\r
     b4DragOut: function(e) { },\r
 \r
     /**\r
      * Abstract method called when we are no longer hovering over an element\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this was hovering over.  In INTERSECT mode, an array of dd items \r
+     * @method onDragOut\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this was hovering over.  In INTERSECT mode, an array of dd items\r
      * that the mouse is no longer over.\r
      */\r
     onDragOut: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragDrop event\r
+     * @method b4DragDrop\r
      * @private\r
      */\r
     b4DragDrop: function(e) { },\r
 \r
     /**\r
-     * Abstract method called when this item is dropped on another DragDrop \r
+     * Abstract method called when this item is dropped on another DragDrop\r
      * obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this was dropped on.  In INTERSECT mode, an array of dd items this \r
+     * @method onDragDrop\r
+     * @param {Event} e the mouseup event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this\r
      * was dropped on.\r
      */\r
     onDragDrop: function(e, id) { /* override this */ },\r
 \r
+    /**\r
+     * Abstract method called when this item is dropped on an area with no\r
+     * drop target\r
+     * @method onInvalidDrop\r
+     * @param {Event} e the mouseup event\r
+     */\r
+    onInvalidDrop: function(e) { /* override this */ },\r
+\r
     /**\r
      * Code that executes immediately before the endDrag event\r
+     * @method b4EndDrag\r
      * @private\r
      */\r
     b4EndDrag: function(e) { },\r
 \r
     /**\r
      * Fired when we are done dragging the object\r
-     *\r
-     * @param {Event} e\r
+     * @method endDrag\r
+     * @param {Event} e the mouseup event\r
      */\r
     endDrag: function(e) { /* override this */ },\r
 \r
     /**\r
      * Code executed immediately before the onMouseDown event\r
-\r
-     * @param {Event} e\r
+     * @method b4MouseDown\r
+     * @param {Event} e the mousedown event\r
      * @private\r
      */\r
     b4MouseDown: function(e) {  },\r
 \r
     /**\r
      * Event handler that fires when a drag/drop obj gets a mousedown\r
-     * @param {Event} e\r
+     * @method onMouseDown\r
+     * @param {Event} e the mousedown event\r
      */\r
     onMouseDown: function(e) { /* override this */ },\r
 \r
     /**\r
      * Event handler that fires when a drag/drop obj gets a mouseup\r
-     * @param {Event} e\r
+     * @method onMouseUp\r
+     * @param {Event} e the mouseup event\r
      */\r
     onMouseUp: function(e) { /* override this */ },\r
-   \r
+\r
     /**\r
      * Override the onAvailable method to do what is needed after the initial\r
      * position was determined.\r
+     * @method onAvailable\r
      */\r
-    onAvailable: function () { \r
-        this.logger.log("onAvailable (base)"); \r
+    onAvailable: function () {\r
+        this.logger.log("onAvailable (base)");\r
     },\r
 \r
     /**\r
      * Returns a reference to the linked element\r
-     *\r
-     * @return {HTMLElement} the html element \r
+     * @method getEl\r
+     * @return {HTMLElement} the html element\r
      */\r
-    getEl: function() { \r
+    getEl: function() {\r
         if (!this._domRef) {\r
-            this._domRef = YAHOO.util.Dom.get(this.id); \r
+            this._domRef = Dom.get(this.id);\r
         }\r
 \r
         return this._domRef;\r
@@ -423,40 +472,40 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Returns a reference to the actual element to drag.  By default this is\r
-     * the same as the html element, but it can be assigned to another \r
+     * the same as the html element, but it can be assigned to another\r
      * element. An example of this can be found in YAHOO.util.DDProxy\r
-     *\r
-     * @return {HTMLElement} the html element \r
+     * @method getDragEl\r
+     * @return {HTMLElement} the html element\r
      */\r
     getDragEl: function() {\r
-        return YAHOO.util.Dom.get(this.dragElId);\r
+        return Dom.get(this.dragElId);\r
     },\r
 \r
     /**\r
      * Sets up the DragDrop object.  Must be called in the constructor of any\r
      * YAHOO.util.DragDrop subclass\r
-     *\r
+     * @method init\r
      * @param id the id of the linked element\r
      * @param {String} sGroup the group of related items\r
      * @param {object} config configuration attributes\r
      */\r
     init: function(id, sGroup, config) {\r
         this.initTarget(id, sGroup, config);\r
-        YAHOO.util.Event.addListener(this.id, "mousedown", \r
-                                          this.handleMouseDown, this, true);\r
+        Event.on(this.id, "mousedown", this.handleMouseDown, this, true);\r
+        // Event.on(this.id, "selectstart", Event.preventDefault);\r
     },\r
 \r
     /**\r
      * Initializes Targeting functionality only... the object does not\r
      * get a mousedown handler.\r
-     *\r
+     * @method initTarget\r
      * @param id the id of the linked element\r
      * @param {String} sGroup the group of related items\r
      * @param {object} config configuration attributes\r
      */\r
     initTarget: function(id, sGroup, config) {\r
 \r
-        // configuration attributes \r
+        // configuration attributes\r
         this.config = config || {};\r
 \r
         // create a local reference to the drag and drop manager\r
@@ -464,6 +513,13 @@ YAHOO.util.DragDrop.prototype = {
         // initialize the groups array\r
         this.groups = {};\r
 \r
+        // assume that we have an element reference instead of an id if the\r
+        // parameter is not a string\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
+\r
         // set the id\r
         this.id = id;\r
 \r
@@ -474,15 +530,16 @@ YAHOO.util.DragDrop.prototype = {
         // so we just set the id rather than calling the setter.\r
         this.handleElId = id;\r
 \r
-        YAHOO.util.Event.onAvailable(id, this.handleOnAvailable, this, true);\r
+        Event.onAvailable(id, this.handleOnAvailable, this, true);\r
 \r
         // create a logger instance\r
-        this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+        this.logger = (YAHOO.widget.LogWriter) ?\r
+                new YAHOO.widget.LogWriter(this.toString()) : YAHOO;\r
 \r
         // the linked element is the element that gets dragged by default\r
-        this.setDragElId(id); \r
+        this.setDragElId(id);\r
 \r
-        // by default, clicked anchors will not start drag operations. \r
+        // by default, clicked anchors will not start drag operations.\r
         // @TODO what else should be here?  Probably form fields.\r
         this.invalidHandleTypes = { A: "A" };\r
         this.invalidHandleIds = {};\r
@@ -494,13 +551,14 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Applies the configuration parameters that were passed into the constructor.\r
      * This is supposed to happen at each level through the inheritance chain.  So\r
-     * a DDProxy implentation will execute apply config on DDProxy, DD, and \r
+     * a DDProxy implentation will execute apply config on DDProxy, DD, and\r
      * DragDrop in order to get all of the parameters that are available in\r
      * each object.\r
+     * @method applyConfig\r
      */\r
     applyConfig: function() {\r
 \r
-        // configurable properties: \r
+        // configurable properties:\r
         //    padding, isTarget, maintainOffset, primaryButtonOnly\r
         this.padding           = this.config.padding || [0, 0, 0, 0];\r
         this.isTarget          = (this.config.isTarget !== false);\r
@@ -511,6 +569,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Executed when the linked element is available\r
+     * @method handleOnAvailable\r
      * @private\r
      */\r
     handleOnAvailable: function() {\r
@@ -522,10 +581,11 @@ YAHOO.util.DragDrop.prototype = {
 \r
      /**\r
      * Configures the padding for the target zone in px.  Effectively expands\r
-     * (or reduces) the virtual object size for targeting calculations.  \r
+     * (or reduces) the virtual object size for targeting calculations.\r
      * Supports css-style shorthand; if only one parameter is passed, all sides\r
      * will have that padding, and if only two are passed, the top and bottom\r
      * will have the first param, the left and right the second.\r
+     * @method setPadding\r
      * @param {int} iTop    Top pad\r
      * @param {int} iRight  Right pad\r
      * @param {int} iBot    Bot pad\r
@@ -543,7 +603,10 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Stores the initial placement of the dd element\r
+     * Stores the initial placement of the linked element.\r
+     * @method setInitialPosition\r
+     * @param {int} diffX   the X offset, default 0\r
+     * @param {int} diffY   the Y offset, default 0\r
      */\r
     setInitPosition: function(diffX, diffY) {\r
         var el = this.getEl();\r
@@ -556,7 +619,7 @@ YAHOO.util.DragDrop.prototype = {
         var dx = diffX || 0;\r
         var dy = diffY || 0;\r
 \r
-        var p = YAHOO.util.Dom.getXY( el );\r
+        var p = Dom.getXY( el );\r
 \r
         this.initPageX = p[0] - dx;\r
         this.initPageY = p[1] - dy;\r
@@ -564,10 +627,9 @@ YAHOO.util.DragDrop.prototype = {
         this.lastPageX = p[0];\r
         this.lastPageY = p[1];\r
 \r
-        this.logger.log(this.id + " inital position: " + this.initPageX + \r
+        this.logger.log(this.id + " inital position: " + this.initPageX +\r
                 ", " + this.initPageY);\r
 \r
-        this.deltaSetXY = null;\r
 \r
         this.setStartPosition(p);\r
     },\r
@@ -575,21 +637,23 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Sets the start position of the element.  This is set when the obj\r
      * is initialized, the reset when a drag is started.\r
+     * @method setStartPosition\r
      * @param pos current position (from previous lookup)\r
      * @private\r
      */\r
     setStartPosition: function(pos) {\r
-        var p = pos || YAHOO.util.Dom.getXY( this.getEl() );\r
+        var p = pos || Dom.getXY( this.getEl() );\r
+        this.deltaSetXY = null;\r
 \r
         this.startPageX = p[0];\r
         this.startPageY = p[1];\r
     },\r
 \r
     /**\r
-     * Add this instance to a group of related drag/drop objects.  All \r
-     * instances belong to at least one group, and can belong to as many \r
+     * Add this instance to a group of related drag/drop objects.  All\r
+     * instances belong to at least one group, and can belong to as many\r
      * groups as needed.\r
-     *\r
+     * @method addToGroup\r
      * @param sGroup {string} the name of the group\r
      */\r
     addToGroup: function(sGroup) {\r
@@ -599,6 +663,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Remove's this instance from the supplied interaction group\r
+     * @method removeFromGroup\r
      * @param {string}  sGroup  The group to drop\r
      */\r
     removeFromGroup: function(sGroup) {\r
@@ -611,47 +676,61 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Allows you to specify that an element other than the linked element \r
+     * Allows you to specify that an element other than the linked element\r
      * will be moved with the cursor during a drag\r
-     *\r
-     * @param id the id of the element that will be used to initiate the drag\r
+     * @method setDragElId\r
+     * @param id {string} the id of the element that will be used to initiate the drag\r
      */\r
     setDragElId: function(id) {\r
         this.dragElId = id;\r
     },\r
 \r
     /**\r
-     * Allows you to specify a child of the linked element that should be \r
-     * used to initiate the drag operation.  An example of this would be if \r
-     * you have a content div with text and links.  Clicking anywhere in the \r
+     * Allows you to specify a child of the linked element that should be\r
+     * used to initiate the drag operation.  An example of this would be if\r
+     * you have a content div with text and links.  Clicking anywhere in the\r
      * content area would normally start the drag operation.  Use this method\r
-     * to specify that an element inside of the content div is the element \r
+     * to specify that an element inside of the content div is the element\r
      * that starts the drag operation.\r
-     *\r
-     * @param id the id of the element that will be used to initiate the drag\r
+     * @method setHandleElId\r
+     * @param id {string} the id of the element that will be used to\r
+     * initiate the drag.\r
      */\r
     setHandleElId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         this.handleElId = id;\r
         this.DDM.regHandle(this.id, id);\r
     },\r
 \r
     /**\r
-     * Allows you to set an element outside of the linked element as a drag \r
+     * Allows you to set an element outside of the linked element as a drag\r
      * handle\r
+     * @method setOuterHandleElId\r
+     * @param id the id of the element that will be used to initiate the drag\r
      */\r
     setOuterHandleElId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         this.logger.log("Adding outer handle event: " + id);\r
-        YAHOO.util.Event.addListener(id, "mousedown", \r
+        Event.on(id, "mousedown",\r
                 this.handleMouseDown, this, true);\r
         this.setHandleElId(id);\r
+\r
+        this.hasOuterHandles = true;\r
     },\r
 \r
     /**\r
      * Remove all drag and drop hooks for this element\r
+     * @method unreg\r
      */\r
     unreg: function() {\r
         this.logger.log("DragDrop obj cleanup " + this.id);\r
-        YAHOO.util.Event.removeListener(this.id, "mousedown", \r
+        Event.removeListener(this.id, "mousedown",\r
                 this.handleMouseDown);\r
         this._domRef = null;\r
         this.DDM._remove(this);\r
@@ -660,8 +739,8 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Returns true if this instance is locked, or the drag drop mgr is locked\r
      * (meaning that all drag/drop is disabled on the page.)\r
-     *\r
-     * @return {boolean} true if this obj or all drag/drop is locked, else \r
+     * @method isLocked\r
+     * @return {boolean} true if this obj or all drag/drop is locked, else\r
      * false\r
      */\r
     isLocked: function() {\r
@@ -670,17 +749,13 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Fired when this object is clicked\r
-     *\r
-     * @param {Event} e \r
+     * @method handleMouseDown\r
+     * @param {Event} e\r
      * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)\r
      * @private\r
      */\r
     handleMouseDown: function(e, oDD) {\r
 \r
-        this.logger.log("isLocked: " + this.isLocked());\r
-\r
-        var EU = YAHOO.util.Event;\r
-\r
         var button = e.which || e.button;\r
         this.logger.log("button: " + button);\r
 \r
@@ -699,23 +774,17 @@ YAHOO.util.DragDrop.prototype = {
         // var self = this;\r
         // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);\r
 \r
-        // Only process the event if we really clicked within the linked \r
-        // element.  The reason we make this check is that in the case that \r
-        // another element was moved between the clicked element and the \r
-        // cursor in the time between the mousedown and mouseup events. When \r
-        // this happens, the element gets the next mousedown event \r
-        // regardless of where on the screen it happened.  \r
-        var pt = new YAHOO.util.Point(EU.getPageX(e), EU.getPageY(e));\r
-        if ( this.DDM.isOverTarget(pt, this) )  {\r
-\r
-            this.logger.log("click is over target");\r
-\r
-            //  check to see if the handle was clicked\r
-            var srcEl = EU.getTarget(e);\r
-\r
-            if (this.isValidHandleChild(srcEl) &&\r
-                    (this.id == this.handleElId || \r
-                     this.DDM.handleWasClicked(srcEl, this.id)) ) {\r
+        // Only process the event if we really clicked within the linked\r
+        // element.  The reason we make this check is that in the case that\r
+        // another element was moved between the clicked element and the\r
+        // cursor in the time between the mousedown and mouseup events. When\r
+        // this happens, the element gets the next mousedown event\r
+        // regardless of where on the screen it happened.\r
+        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));\r
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {\r
+                this.logger.log("Click was not over the element: " + this.id);\r
+        } else {\r
+            if (this.clickValidator(e)) {\r
 \r
                 this.logger.log("click was a valid handle");\r
 \r
@@ -724,21 +793,31 @@ YAHOO.util.DragDrop.prototype = {
 \r
                 this.logger.log("firing onMouseDown events");\r
 \r
-\r
                 this.b4MouseDown(e);\r
                 this.onMouseDown(e);\r
                 this.DDM.handleMouseDown(e, this);\r
 \r
                 this.DDM.stopEvent(e);\r
+            } else {\r
+\r
+this.logger.log("clickValidator returned false, drag not initiated");\r
+\r
             }\r
         }\r
     },\r
 \r
+    clickValidator: function(e) {\r
+        var target = Event.getTarget(e);\r
+        return ( this.isValidHandleChild(target) &&\r
+                    (this.id == this.handleElId ||\r
+                        this.DDM.handleWasClicked(target, this.id)) );\r
+    },\r
+\r
     /**\r
      * Allows you to specify a tag name that should not start a drag operation\r
      * when clicked.  This is designed to facilitate embedding links within a\r
      * drag handle that do something other than start the drag.\r
-     * \r
+     * @method addInvalidHandleType\r
      * @param {string} tagName the type of element to exclude\r
      */\r
     addInvalidHandleType: function(tagName) {\r
@@ -749,15 +828,21 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Lets you to specify an element id for a child of a drag handle\r
      * that should not initiate a drag\r
+     * @method addInvalidHandleId\r
      * @param {string} id the element id of the element you wish to ignore\r
      */\r
     addInvalidHandleId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         this.invalidHandleIds[id] = id;\r
     },\r
 \r
 \r
     /**\r
      * Lets you specify a css class of elements that will not initiate a drag\r
+     * @method addInvalidHandleClass\r
      * @param {string} cssClass the class of the elements you wish to ignore\r
      */\r
     addInvalidHandleClass: function(cssClass) {\r
@@ -766,7 +851,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Unsets an excluded tag name set by addInvalidHandleType\r
-     * \r
+     * @method removeInvalidHandleType\r
      * @param {string} tagName the type of element to unexclude\r
      */\r
     removeInvalidHandleType: function(tagName) {\r
@@ -774,18 +859,25 @@ YAHOO.util.DragDrop.prototype = {
         // this.invalidHandleTypes[type] = null;\r
         delete this.invalidHandleTypes[type];\r
     },\r
-    \r
+\r
     /**\r
      * Unsets an invalid handle id\r
-     * @param {string} the id of the element to re-enable\r
+     * @method removeInvalidHandleId\r
+     * @param {string} id the id of the element to re-enable\r
      */\r
     removeInvalidHandleId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         delete this.invalidHandleIds[id];\r
     },\r
 \r
     /**\r
      * Unsets an invalid css class\r
-     * @param {string} the class of the element(s) you wish to re-enable\r
+     * @method removeInvalidHandleClass\r
+     * @param {string} cssClass the class of the element(s) you wish to\r
+     * re-enable\r
      */\r
     removeInvalidHandleClass: function(cssClass) {\r
         for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {\r
@@ -797,8 +889,8 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Checks the tag exclusion list to see if this click should be ignored\r
-     *\r
-     * @param {ygNode} node\r
+     * @method isValidHandleChild\r
+     * @param {HTMLElement} node the HTMLElement to evaluate\r
      * @return {boolean} true if this is a valid tag type, false if not\r
      */\r
     isValidHandleChild: function(node) {\r
@@ -815,7 +907,7 @@ YAHOO.util.DragDrop.prototype = {
         valid = valid && !this.invalidHandleIds[node.id];\r
 \r
         for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {\r
-            valid = !YAHOO.util.Dom.hasClass(node, this.invalidHandleClasses[i]);\r
+            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);\r
         }\r
 \r
         this.logger.log("Valid handle? ... " + valid);\r
@@ -827,13 +919,13 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Create the array of horizontal tick marks if an interval was specified\r
      * in setXConstraint().\r
-     *\r
+     * @method setXTicks\r
      * @private\r
      */\r
     setXTicks: function(iStartX, iTickSize) {\r
         this.xTicks = [];\r
         this.xTickSize = iTickSize;\r
-        \r
+\r
         var tickMap = {};\r
 \r
         for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {\r
@@ -855,9 +947,9 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Create the array of vertical tick marks if an interval was specified in \r
+     * Create the array of vertical tick marks if an interval was specified in\r
      * setYConstraint().\r
-     *\r
+     * @method setYTicks\r
      * @private\r
      */\r
     setYTicks: function(iStartY, iTickSize) {\r
@@ -887,14 +979,14 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * By default, the element can be dragged any place on the screen.  Use \r
-     * this method to limit the horizontal travel of the element.  Pass in \r
+     * By default, the element can be dragged any place on the screen.  Use\r
+     * this method to limit the horizontal travel of the element.  Pass in\r
      * 0,0 for the parameters if you want to lock the drag to the y axis.\r
-     *\r
+     * @method setXConstraint\r
      * @param {int} iLeft the number of pixels the element can move to the left\r
-     * @param {int} iRight the number of pixels the element can move to the \r
+     * @param {int} iRight the number of pixels the element can move to the\r
      * right\r
-     * @param {int} iTickSize optional parameter for specifying that the \r
+     * @param {int} iTickSize optional parameter for specifying that the\r
      * element\r
      * should move iTickSize pixels at a time.\r
      */\r
@@ -907,13 +999,14 @@ YAHOO.util.DragDrop.prototype = {
         if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }\r
 \r
         this.constrainX = true;\r
-        this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX + \r
+        this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX +\r
                 " maxX:" + this.maxX);\r
     },\r
 \r
     /**\r
      * Clears any constraints applied to this instance.  Also clears ticks\r
      * since they can't exist independent of a constraint at this time.\r
+     * @method clearConstraints\r
      */\r
     clearConstraints: function() {\r
         this.logger.log("Clearing constraints");\r
@@ -924,6 +1017,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Clears any tick interval defined for this instance\r
+     * @method clearTicks\r
      */\r
     clearTicks: function() {\r
         this.logger.log("Clearing ticks");\r
@@ -934,13 +1028,13 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * By default, the element can be dragged any place on the screen.  Set \r
+     * By default, the element can be dragged any place on the screen.  Set\r
      * this to limit the vertical travel of the element.  Pass in 0,0 for the\r
      * parameters if you want to lock the drag to the x axis.\r
-     *\r
+     * @method setYConstraint\r
      * @param {int} iUp the number of pixels the element can move up\r
      * @param {int} iDown the number of pixels the element can move down\r
-     * @param {int} iTickSize optional parameter for specifying that the \r
+     * @param {int} iTickSize optional parameter for specifying that the\r
      * element should move iTickSize pixels at a time.\r
      */\r
     setYConstraint: function(iUp, iDown, iTickSize) {\r
@@ -953,13 +1047,14 @@ YAHOO.util.DragDrop.prototype = {
         if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }\r
 \r
         this.constrainY = true;\r
-        \r
-        this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY + \r
+\r
+        this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY +\r
                 " maxY:" + this.maxY);\r
     },\r
 \r
     /**\r
      * resetConstraints must be called if you manually reposition a dd element.\r
+     * @method resetConstraints\r
      * @param {boolean} maintainOffset\r
      */\r
     resetConstraints: function() {\r
@@ -968,9 +1063,9 @@ YAHOO.util.DragDrop.prototype = {
 \r
         // Maintain offsets if necessary\r
         if (this.initPageX || this.initPageX === 0) {\r
-            this.logger.log("init pagexy: " + this.initPageX + ", " + \r
+            this.logger.log("init pagexy: " + this.initPageX + ", " +\r
                                this.initPageY);\r
-            this.logger.log("last pagexy: " + this.lastPageX + ", " + \r
+            this.logger.log("last pagexy: " + this.lastPageX + ", " +\r
                                this.lastPageY);\r
             // figure out how much this thing has moved\r
             var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;\r
@@ -984,23 +1079,23 @@ YAHOO.util.DragDrop.prototype = {
         }\r
 \r
         if (this.constrainX) {\r
-            this.setXConstraint( this.leftConstraint, \r
-                                 this.rightConstraint, \r
+            this.setXConstraint( this.leftConstraint,\r
+                                 this.rightConstraint,\r
                                  this.xTickSize        );\r
         }\r
 \r
         if (this.constrainY) {\r
-            this.setYConstraint( this.topConstraint, \r
-                                 this.bottomConstraint, \r
+            this.setYConstraint( this.topConstraint,\r
+                                 this.bottomConstraint,\r
                                  this.yTickSize         );\r
         }\r
     },\r
 \r
     /**\r
-     * Normally the drag element is moved pixel by pixel, but we can specify \r
-     * that it move a number of pixels at a time.  This method resolves the \r
+     * Normally the drag element is moved pixel by pixel, but we can specify\r
+     * that it move a number of pixels at a time.  This method resolves the\r
      * location when we have it set up like this.\r
-     *\r
+     * @method getTick\r
      * @param {int} val where we want to place the object\r
      * @param {int[]} tickArray sorted array of valid points\r
      * @return {int} the closest tick\r
@@ -1009,9 +1104,9 @@ YAHOO.util.DragDrop.prototype = {
     getTick: function(val, tickArray) {\r
 \r
         if (!tickArray) {\r
-            // If tick interval is not defined, it is effectively 1 pixel, \r
+            // If tick interval is not defined, it is effectively 1 pixel,\r
             // so we return the value passed to us.\r
-            return val; \r
+            return val;\r
         } else if (tickArray[0] >= val) {\r
             // The value is lower than the first tick, so we return the first\r
             // tick.\r
@@ -1034,6 +1129,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * toString method\r
+     * @method toString\r
      * @return {string} string representation of the dd obj\r
      */\r
     toString: function() {\r
@@ -1042,144 +1138,177 @@ YAHOO.util.DragDrop.prototype = {
 \r
 };\r
 \r
-// Only load the library once.  Rewriting the manager class would orphan \r
+})();\r
+/**\r
+ * The drag and drop utility provides a framework for building drag and drop\r
+ * applications.  In addition to enabling drag and drop for specific elements,\r
+ * the drag and drop elements are tracked by the manager class, and the\r
+ * interactions between the various elements are tracked during the drag and\r
+ * the implementing code is notified about these important moments.\r
+ * @module dragdrop\r
+ * @title Drag and Drop\r
+ * @requires yahoo,dom,event\r
+ * @namespace YAHOO.util\r
+ */\r
+\r
+// Only load the library once.  Rewriting the manager class would orphan\r
 // existing drag and drop instances.\r
 if (!YAHOO.util.DragDropMgr) {\r
 \r
-    /**\r
-     * Handles the element interaction for all DragDrop items in the \r
-     * window.  Generally, you will not call this class directly, but it does\r
-     * have helper methods that could be useful in your DragDrop \r
-     * implementations.  This class should not be instantiated; all methods \r
-     * are are static.\r
-     *\r
-     * @constructor\r
-     */\r
-    YAHOO.util.DragDropMgr = new function() {\r
+/**\r
+ * DragDropMgr is a singleton that tracks the element interaction for\r
+ * all DragDrop items in the window.  Generally, you will not call\r
+ * this class directly, but it does have helper methods that could\r
+ * be useful in your DragDrop implementations.\r
+ * @class DragDropMgr\r
+ * @static\r
+ */\r
+YAHOO.util.DragDropMgr = function() {\r
+\r
+    var Event = YAHOO.util.Event;\r
+\r
+    return {\r
 \r
         /**\r
-         * Two dimensional Array of registered DragDrop objects.  The first \r
-         * dimension is the DragDrop item group, the second the DragDrop \r
+         * Two dimensional Array of registered DragDrop objects.  The first\r
+         * dimension is the DragDrop item group, the second the DragDrop\r
          * object.\r
-         *\r
+         * @property ids\r
          * @type {string: string}\r
          * @private\r
+         * @static\r
          */\r
-        this.ids = {};\r
+        ids: {},\r
 \r
         /**\r
-         * Array of element ids defined as drag handles.  Used to determine \r
-         * if the element that generated the mousedown event is actually the \r
+         * Array of element ids defined as drag handles.  Used to determine\r
+         * if the element that generated the mousedown event is actually the\r
          * handle and not the html element itself.\r
-         *\r
+         * @property handleIds\r
          * @type {string: string}\r
          * @private\r
+         * @static\r
          */\r
-        this.handleIds = {};\r
+        handleIds: {},\r
 \r
         /**\r
          * the DragDrop object that is currently being dragged\r
-         *\r
+         * @property dragCurrent\r
          * @type DragDrop\r
          * @private\r
+         * @static\r
          **/\r
-        this.dragCurrent = null;\r
+        dragCurrent: null,\r
 \r
         /**\r
          * the DragDrop object(s) that are being hovered over\r
-         *\r
+         * @property dragOvers\r
          * @type Array\r
          * @private\r
+         * @static\r
          */\r
-        this.dragOvers = {};\r
-\r
-        /**\r
-         * @private\r
-         */\r
-        this.logger = null;\r
+        dragOvers: {},\r
 \r
         /**\r
          * the X distance between the cursor and the object being dragged\r
-         *\r
+         * @property deltaX\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.deltaX = 0;\r
+        deltaX: 0,\r
 \r
         /**\r
          * the Y distance between the cursor and the object being dragged\r
-         *\r
+         * @property deltaY\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.deltaY = 0;\r
+        deltaY: 0,\r
 \r
         /**\r
          * Flag to determine if we should prevent the default behavior of the\r
-         * events we define. By default this is true, but this can be set to \r
+         * events we define. By default this is true, but this can be set to\r
          * false if you need the default behavior (not recommended)\r
-         *\r
+         * @property preventDefault\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.preventDefault = true;\r
+        preventDefault: true,\r
 \r
         /**\r
-         * Flag to determine if we should stop the propagation of the events \r
+         * Flag to determine if we should stop the propagation of the events\r
          * we generate. This is true by default but you may want to set it to\r
          * false if the html element contains other features that require the\r
          * mouse click.\r
-         *\r
+         * @property stopPropagation\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.stopPropagation = true;\r
+        stopPropagation: true,\r
 \r
         /**\r
+         * Internal flag that is set to true when drag and drop has been\r
+         * intialized\r
+         * @property initialized\r
          * @private\r
+         * @static\r
          */\r
-        this.initalized = false;\r
+        initalized: false,\r
 \r
         /**\r
          * All drag and drop can be disabled.\r
-         *\r
+         * @property locked\r
          * @private\r
+         * @static\r
          */\r
-        this.locked = false;\r
-        \r
+        locked: false,\r
+\r
         /**\r
          * Called the first time an element is registered.\r
-         *\r
+         * @method init\r
          * @private\r
+         * @static\r
          */\r
-        this.init = function() {\r
-            this.logger = this.logger || new YAHOO.widget.LogWriter("DragDropMgr");\r
+        init: function() {\r
+            this.logger = new YAHOO.widget.LogWriter("DragDropMgr");\r
             this.initialized = true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * In point mode, drag and drop interaction is defined by the \r
+         * In point mode, drag and drop interaction is defined by the\r
          * location of the cursor during the drag/drop\r
+         * @property POINT\r
          * @type int\r
+         * @static\r
          */\r
-        this.POINT     = 0;\r
+        POINT: 0,\r
 \r
         /**\r
-         * In intersect mode, drag and drop interactio nis defined by the \r
+         * In intersect mode, drag and drop interactio nis defined by the\r
          * overlap of two or more drag and drop objects.\r
+         * @property INTERSECT\r
          * @type int\r
+         * @static\r
          */\r
-        this.INTERSECT = 1;\r
+        INTERSECT: 1,\r
 \r
         /**\r
-         * The current drag and drop mode.  Default it point mode\r
+         * The current drag and drop mode.  Default: POINT\r
+         * @property mode\r
          * @type int\r
+         * @static\r
          */\r
-        this.mode = this.POINT;\r
+        mode: 0,\r
 \r
         /**\r
          * Runs method on all drag and drop objects\r
+         * @method _execOnAll\r
          * @private\r
+         * @static\r
          */\r
-        this._execOnAll = function(sMethod, args) {\r
+        _execOnAll: function(sMethod, args) {\r
             for (var i in this.ids) {\r
                 for (var j in this.ids[i]) {\r
                     var oDD = this.ids[i][j];\r
@@ -1189,136 +1318,161 @@ if (!YAHOO.util.DragDropMgr) {
                     oDD[sMethod].apply(oDD, args);\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
          * Drag and drop initialization.  Sets up the global event handlers\r
+         * @method _onLoad\r
          * @private\r
+         * @static\r
          */\r
-        this._onLoad = function() {\r
+        _onLoad: function() {\r
 \r
             this.init();\r
 \r
             this.logger.log("DDM onload");\r
 \r
-            var EU = YAHOO.util.Event;\r
-\r
-            EU.on(document, "mouseup",   this.handleMouseUp, this, true);\r
-            EU.on(document, "mousemove", this.handleMouseMove, this, true);\r
-            EU.on(window,   "unload",    this._onUnload, this, true);\r
-            EU.on(window,   "resize",    this._onResize, this, true);\r
-            // EU.on(window,   "mouseout",    this._test);\r
+            Event.on(document, "mouseup",   this.handleMouseUp, this, true);\r
+            Event.on(document, "mousemove", this.handleMouseMove, this, true);\r
+            Event.on(window,   "unload",    this._onUnload, this, true);\r
+            Event.on(window,   "resize",    this._onResize, this, true);\r
+            // Event.on(window,   "mouseout",    this._test);\r
 \r
-        };\r
+        },\r
 \r
         /**\r
          * Reset constraints on all drag and drop objs\r
+         * @method _onResize\r
          * @private\r
+         * @static\r
          */\r
-        this._onResize = function(e) {\r
+        _onResize: function(e) {\r
             this.logger.log("window resize");\r
             this._execOnAll("resetConstraints", []);\r
-        };\r
+        },\r
 \r
         /**\r
          * Lock all drag and drop functionality\r
+         * @method lock\r
+         * @static\r
          */\r
-        this.lock = function() { this.locked = true; };\r
+        lock: function() { this.locked = true; },\r
 \r
         /**\r
          * Unlock all drag and drop functionality\r
+         * @method unlock\r
+         * @static\r
          */\r
-        this.unlock = function() { this.locked = false; };\r
+        unlock: function() { this.locked = false; },\r
 \r
         /**\r
          * Is drag and drop locked?\r
-         *\r
+         * @method isLocked\r
          * @return {boolean} True if drag and drop is locked, false otherwise.\r
+         * @static\r
          */\r
-        this.isLocked = function() { return this.locked; };\r
+        isLocked: function() { return this.locked; },\r
 \r
         /**\r
          * Location cache that is set for all drag drop objects when a drag is\r
          * initiated, cleared when the drag is finished.\r
-         *\r
+         * @property locationCache\r
          * @private\r
+         * @static\r
          */\r
-        this.locationCache = {};\r
+        locationCache: {},\r
 \r
         /**\r
          * Set useCache to false if you want to force object the lookup of each\r
          * drag and drop linked element constantly during a drag.\r
+         * @property useCache\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.useCache = true;\r
+        useCache: true,\r
 \r
         /**\r
-         * The number of pixels that the mouse needs to move after the \r
+         * The number of pixels that the mouse needs to move after the\r
          * mousedown before the drag is initiated.  Default=3;\r
+         * @property clickPixelThresh\r
          * @type int\r
+         * @static\r
          */\r
-        this.clickPixelThresh = 3;\r
+        clickPixelThresh: 3,\r
 \r
         /**\r
          * The number of milliseconds after the mousedown event to initiate the\r
          * drag if we don't get a mouseup event. Default=1000\r
+         * @property clickTimeThresh\r
          * @type int\r
+         * @static\r
          */\r
-        this.clickTimeThresh = 1000;\r
+        clickTimeThresh: 1000,\r
 \r
         /**\r
-         * Flag that indicates that either the drag pixel threshold or the \r
+         * Flag that indicates that either the drag pixel threshold or the\r
          * mousdown time threshold has been met\r
+         * @property dragThreshMet\r
          * @type boolean\r
          * @private\r
+         * @static\r
          */\r
-        this.dragThreshMet = false;\r
+        dragThreshMet: false,\r
 \r
         /**\r
          * Timeout used for the click time threshold\r
+         * @property clickTimeout\r
          * @type Object\r
          * @private\r
+         * @static\r
          */\r
-        this.clickTimeout = null;\r
+        clickTimeout: null,\r
 \r
         /**\r
-         * The X position of the mousedown event stored for later use when a \r
+         * The X position of the mousedown event stored for later use when a\r
          * drag threshold is met.\r
+         * @property startX\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.startX = 0;\r
+        startX: 0,\r
 \r
         /**\r
-         * The Y position of the mousedown event stored for later use when a \r
+         * The Y position of the mousedown event stored for later use when a\r
          * drag threshold is met.\r
+         * @property startY\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.startY = 0;\r
+        startY: 0,\r
 \r
         /**\r
-         * Each DragDrop instance must be registered with the DragDropMgr.  \r
+         * Each DragDrop instance must be registered with the DragDropMgr.\r
          * This is executed in DragDrop.init()\r
-         *\r
+         * @method regDragDrop\r
          * @param {DragDrop} oDD the DragDrop object to register\r
          * @param {String} sGroup the name of the group this element belongs to\r
+         * @static\r
          */\r
-        this.regDragDrop = function(oDD, sGroup) {\r
+        regDragDrop: function(oDD, sGroup) {\r
             if (!this.initialized) { this.init(); }\r
-            \r
+\r
             if (!this.ids[sGroup]) {\r
                 this.ids[sGroup] = {};\r
             }\r
             this.ids[sGroup][oDD.id] = oDD;\r
-        };\r
+        },\r
 \r
         /**\r
          * Removes the supplied dd instance from the supplied group. Executed\r
-         * by DragDrop.removeFromGroup.\r
+         * by DragDrop.removeFromGroup, so don't call this function directly.\r
+         * @method removeDDFromGroup\r
          * @private\r
+         * @static\r
          */\r
-        this.removeDDFromGroup = function(oDD, sGroup) {\r
+        removeDDFromGroup: function(oDD, sGroup) {\r
             if (!this.ids[sGroup]) {\r
                 this.ids[sGroup] = {};\r
             }\r
@@ -1327,58 +1481,64 @@ if (!YAHOO.util.DragDropMgr) {
             if (obj && obj[oDD.id]) {\r
                 delete obj[oDD.id];\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
-         * Unregisters a drag and drop item.  This is executed in \r
+         * Unregisters a drag and drop item.  This is executed in\r
          * DragDrop.unreg, use that method instead of calling this directly.\r
+         * @method _remove\r
          * @private\r
+         * @static\r
          */\r
-        this._remove = function(oDD) {\r
+        _remove: function(oDD) {\r
             for (var g in oDD.groups) {\r
                 if (g && this.ids[g][oDD.id]) {\r
                     delete this.ids[g][oDD.id];\r
+                    //this.logger.log("NEW LEN " + this.ids.length, "warn");\r
                 }\r
             }\r
             delete this.handleIds[oDD.id];\r
-        };\r
+        },\r
 \r
         /**\r
          * Each DragDrop handle element must be registered.  This is done\r
          * automatically when executing DragDrop.setHandleElId()\r
-         *\r
+         * @method regHandle\r
          * @param {String} sDDId the DragDrop id this element is a handle for\r
-         * @param {String} sHandleId the id of the element that is the drag \r
+         * @param {String} sHandleId the id of the element that is the drag\r
          * handle\r
+         * @static\r
          */\r
-        this.regHandle = function(sDDId, sHandleId) {\r
+        regHandle: function(sDDId, sHandleId) {\r
             if (!this.handleIds[sDDId]) {\r
                 this.handleIds[sDDId] = {};\r
             }\r
             this.handleIds[sDDId][sHandleId] = sHandleId;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility function to determine if a given element has been \r
+         * Utility function to determine if a given element has been\r
          * registered as a drag drop item.\r
-         *\r
+         * @method isDragDrop\r
          * @param {String} id the element id to check\r
-         * @return {boolean} true if this element is a DragDrop item, \r
+         * @return {boolean} true if this element is a DragDrop item,\r
          * false otherwise\r
+         * @static\r
          */\r
-        this.isDragDrop = function(id) {\r
+        isDragDrop: function(id) {\r
             return ( this.getDDById(id) ) ? true : false;\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the drag and drop instances that are in all groups the\r
          * passed in instance belongs to.\r
-         *\r
+         * @method getRelated\r
          * @param {DragDrop} p_oDD the obj to get related data for\r
          * @param {boolean} bTargetsOnly if true, only return targetable objs\r
          * @return {DragDrop[]} the related instances\r
+         * @static\r
          */\r
-        this.getRelated = function(p_oDD, bTargetsOnly) {\r
+        getRelated: function(p_oDD, bTargetsOnly) {\r
             var oDDs = [];\r
             for (var i in p_oDD.groups) {\r
                 for (j in this.ids[i]) {\r
@@ -1393,18 +1553,19 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return oDDs;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Returns true if the specified dd target is a legal target for \r
+         * Returns true if the specified dd target is a legal target for\r
          * the specifice drag obj\r
-         *\r
+         * @method isLegalTarget\r
          * @param {DragDrop} the drag obj\r
-         * @param {DragDrop) the target\r
-         * @return {boolean} true if the target is a legal target for the \r
+         * @param {DragDrop} the target\r
+         * @return {boolean} true if the target is a legal target for the\r
          * dd obj\r
+         * @static\r
          */\r
-        this.isLegalTarget = function (oDD, oTargetDD) {\r
+        isLegalTarget: function (oDD, oTargetDD) {\r
             var targets = this.getRelated(oDD, true);\r
             for (var i=0, len=targets.length;i<len;++i) {\r
                 if (targets[i].id == oTargetDD.id) {\r
@@ -1413,59 +1574,63 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
+        },\r
 \r
         /**\r
          * My goal is to be able to transparently determine if an object is\r
-         * typeof DragDrop, and the exact subclass of DragDrop.  typeof \r
+         * typeof DragDrop, and the exact subclass of DragDrop.  typeof\r
          * returns "object", oDD.constructor.toString() always returns\r
          * "DragDrop" and not the name of the subclass.  So for now it just\r
          * evaluates a well-known variable in DragDrop.\r
-         *\r
+         * @method isTypeOfDD\r
          * @param {Object} the object to evaluate\r
          * @return {boolean} true if typeof oDD = DragDrop\r
+         * @static\r
          */\r
-        this.isTypeOfDD = function (oDD) {\r
+        isTypeOfDD: function (oDD) {\r
             return (oDD && oDD.__ygDragDrop);\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility function to determine if a given element has been \r
+         * Utility function to determine if a given element has been\r
          * registered as a drag drop handle for the given Drag Drop object.\r
-         *\r
+         * @method isHandle\r
          * @param {String} id the element id to check\r
-         * @return {boolean} true if this element is a DragDrop handle, false \r
+         * @return {boolean} true if this element is a DragDrop handle, false\r
          * otherwise\r
+         * @static\r
          */\r
-        this.isHandle = function(sDDId, sHandleId) {\r
-            return ( this.handleIds[sDDId] && \r
+        isHandle: function(sDDId, sHandleId) {\r
+            return ( this.handleIds[sDDId] &&\r
                             this.handleIds[sDDId][sHandleId] );\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the DragDrop instance for a given id\r
-         *\r
+         * @method getDDById\r
          * @param {String} id the id of the DragDrop object\r
          * @return {DragDrop} the drag drop object, null if it is not found\r
+         * @static\r
          */\r
-        this.getDDById = function(id) {\r
+        getDDById: function(id) {\r
             for (var i in this.ids) {\r
                 if (this.ids[i][id]) {\r
                     return this.ids[i][id];\r
                 }\r
             }\r
             return null;\r
-        };\r
+        },\r
 \r
         /**\r
          * Fired after a registered DragDrop object gets the mousedown event.\r
          * Sets up the events required to track the object being dragged\r
-         *\r
+         * @method handleMouseDown\r
          * @param {Event} e the event\r
          * @param oDD the DragDrop object being dragged\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseDown = function(e, oDD) {\r
+        handleMouseDown: function(e, oDD) {\r
 \r
             this.currentTarget = YAHOO.util.Event.getTarget(e);\r
 \r
@@ -1483,22 +1648,23 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.dragThreshMet = false;\r
 \r
-            this.clickTimeout = setTimeout( \r
-                    function() { \r
+            this.clickTimeout = setTimeout(\r
+                    function() {\r
                         var DDM = YAHOO.util.DDM;\r
-                        DDM.startDrag(DDM.startX, DDM.startY); \r
-                    }, \r
+                        DDM.startDrag(DDM.startX, DDM.startY);\r
+                    },\r
                     this.clickTimeThresh );\r
-        };\r
+        },\r
 \r
         /**\r
-         * Fired when either the drag pixel threshol or the mousedown hold \r
+         * Fired when either the drag pixel threshol or the mousedown hold\r
          * time threshold has been met.\r
-         * \r
+         * @method startDrag\r
          * @param x {int} the X position of the original mousedown\r
          * @param y {int} the Y position of the original mousedown\r
+         * @static\r
          */\r
-        this.startDrag = function(x, y) {\r
+        startDrag: function(x, y) {\r
             this.logger.log("firing drag start events");\r
             clearTimeout(this.clickTimeout);\r
             if (this.dragCurrent) {\r
@@ -1506,16 +1672,17 @@ if (!YAHOO.util.DragDropMgr) {
                 this.dragCurrent.startDrag(x, y);\r
             }\r
             this.dragThreshMet = true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Internal function to handle the mouseup event.  Will be invoked \r
+         * Internal function to handle the mouseup event.  Will be invoked\r
          * from the context of the document.\r
-         *\r
+         * @method handleMouseUp\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseUp = function(e) {\r
+        handleMouseUp: function(e) {\r
 \r
             if (! this.dragCurrent) {\r
                 return;\r
@@ -1533,15 +1700,16 @@ if (!YAHOO.util.DragDropMgr) {
             this.stopDrag(e);\r
 \r
             this.stopEvent(e);\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility to stop event propagation and event default, if these \r
+         * Utility to stop event propagation and event default, if these\r
          * features are turned on.\r
-         *\r
+         * @method stopEvent\r
          * @param {Event} e the event as returned by this.getEvent()\r
+         * @static\r
          */\r
-        this.stopEvent = function(e) {\r
+        stopEvent: function(e) {\r
             if (this.stopPropagation) {\r
                 YAHOO.util.Event.stopPropagation(e);\r
             }\r
@@ -1549,16 +1717,17 @@ if (!YAHOO.util.DragDropMgr) {
             if (this.preventDefault) {\r
                 YAHOO.util.Event.preventDefault(e);\r
             }\r
-        };\r
+        },\r
 \r
-        /** \r
-         * Internal function to clean up event handlers after the drag \r
+        /**\r
+         * Internal function to clean up event handlers after the drag\r
          * operation is complete\r
-         *\r
+         * @method stopDrag\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.stopDrag = function(e) {\r
+        stopDrag: function(e) {\r
             // this.logger.log("mouseup - removing event handlers");\r
 \r
             // Fire the drag end event for the item that was dragged\r
@@ -1575,26 +1744,28 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.dragCurrent = null;\r
             this.dragOvers = {};\r
-        };\r
+        },\r
 \r
 \r
-        /** \r
-         * Internal function to handle the mousemove event.  Will be invoked \r
+        /**\r
+         * Internal function to handle the mousemove event.  Will be invoked\r
          * from the context of the html element.\r
          *\r
-         * @TODO figure out what we can do about mouse events lost when the \r
-         * user drags objects beyond the window boundary.  Currently we can \r
-         * detect this in internet explorer by verifying that the mouse is \r
-         * down during the mousemove event.  Firefox doesn't give us the \r
+         * @TODO figure out what we can do about mouse events lost when the\r
+         * user drags objects beyond the window boundary.  Currently we can\r
+         * detect this in internet explorer by verifying that the mouse is\r
+         * down during the mousemove event.  Firefox doesn't give us the\r
          * button state on the mousemove event.\r
-         *\r
+         * @method handleMouseMove\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseMove = function(e) {\r
+        handleMouseMove: function(e) {\r
+            //this.logger.log("handlemousemove");\r
             if (! this.dragCurrent) {\r
                 // this.logger.log("no current drag obj");\r
-                return false;\r
+                return true;\r
             }\r
 \r
             // var button = e.which || e.button;\r
@@ -1611,7 +1782,7 @@ if (!YAHOO.util.DragDropMgr) {
                 var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));\r
                 var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));\r
                 // this.logger.log("diffX: " + diffX + "diffY: " + diffY);\r
-                if (diffX > this.clickPixelThresh || \r
+                if (diffX > this.clickPixelThresh ||\r
                             diffY > this.clickPixelThresh) {\r
                     this.logger.log("pixel threshold met");\r
                     this.startDrag(this.startX, this.startY);\r
@@ -1627,20 +1798,21 @@ if (!YAHOO.util.DragDropMgr) {
             this.stopEvent(e);\r
 \r
             return true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Iterates over all of the DragDrop elements to find ones we are \r
+         * Iterates over all of the DragDrop elements to find ones we are\r
          * hovering over or dropping on\r
-         *\r
+         * @method fireEvents\r
          * @param {Event} e the event\r
          * @param {boolean} isDrop is this a drop op or a mouseover op?\r
          * @private\r
+         * @static\r
          */\r
-        this.fireEvents = function(e, isDrop) {\r
+        fireEvents: function(e, isDrop) {\r
             var dc = this.dragCurrent;\r
 \r
-            // If the user did the mouse up outside of the window, we could \r
+            // If the user did the mouse up outside of the window, we could\r
             // get here even though we have ended the drag.\r
             if (!dc || dc.isLocked()) {\r
                 return;\r
@@ -1658,7 +1830,7 @@ if (!YAHOO.util.DragDropMgr) {
             var dropEvts  = [];\r
             var enterEvts = [];\r
 \r
-            // Check to see if the object(s) we were hovering over is no longer \r
+            // Check to see if the object(s) we were hovering over is no longer\r
             // being hovered over so we can fire the onDragOut event\r
             for (var i in this.dragOvers) {\r
 \r
@@ -1678,7 +1850,7 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             for (var sGroup in dc.groups) {\r
                 // this.logger.log("Processing group " + sGroup);\r
-                \r
+\r
                 if ("string" != typeof sGroup) {\r
                     continue;\r
                 }\r
@@ -1744,14 +1916,14 @@ if (!YAHOO.util.DragDropMgr) {
                     dc.b4DragOut(e, outEvts[i].id);\r
                     dc.onDragOut(e, outEvts[i].id);\r
                 }\r
-                 \r
+\r
                 // fire enter events\r
                 for (i=0,len=enterEvts.length; i<len; ++i) {\r
                     this.logger.log(dc.id + " onDragEnter " + enterEvts[i].id);\r
                     // dc.b4DragEnter(e, oDD.id);\r
                     dc.onDragEnter(e, enterEvts[i].id);\r
                 }\r
-         \r
+\r
                 // fire over events\r
                 for (i=0,len=overEvts.length; i<len; ++i) {\r
                     this.logger.log(dc.id + " onDragOver " + overEvts[i].id);\r
@@ -1768,20 +1940,27 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             }\r
 \r
-        };\r
+            // notify about a drop that did not find a target\r
+            if (isDrop && !dropEvts.length) {\r
+                this.logger.log(dc.id + " dropped, but not on a target");\r
+                dc.onInvalidDrop(e);\r
+            }\r
+\r
+        },\r
 \r
         /**\r
-         * Helper function for getting the best match from the list of drag \r
-         * and drop objects returned by the drag and drop events when we are \r
-         * in INTERSECT mode.  It returns either the first object that the \r
-         * cursor is over, or the object that has the greatest overlap with \r
+         * Helper function for getting the best match from the list of drag\r
+         * and drop objects returned by the drag and drop events when we are\r
+         * in INTERSECT mode.  It returns either the first object that the\r
+         * cursor is over, or the object that has the greatest overlap with\r
          * the dragged element.\r
-         *\r
-         * @param  {DragDrop[]} dds The array of drag and drop objects \r
+         * @method getBestMatch\r
+         * @param  {DragDrop[]} dds The array of drag and drop objects\r
          * targeted\r
          * @return {DragDrop}       The best single match\r
+         * @static\r
          */\r
-        this.getBestMatch = function(dds) {\r
+        getBestMatch: function(dds) {\r
             var winner = null;\r
             // Return null if the input is not what we expect\r
             //if (!dds || !dds.length || dds.length == 0) {\r
@@ -1797,7 +1976,7 @@ if (!YAHOO.util.DragDropMgr) {
                 // Loop through the targeted items\r
                 for (var i=0; i<len; ++i) {\r
                     var dd = dds[i];\r
-                    // If the cursor is over the object, it wins.  If the \r
+                    // If the cursor is over the object, it wins.  If the\r
                     // cursor is over multiple matches, the first one we come\r
                     // to wins.\r
                     if (dd.cursorIsOver) {\r
@@ -1805,7 +1984,7 @@ if (!YAHOO.util.DragDropMgr) {
                         break;\r
                     // Otherwise the object with the most overlap wins\r
                     } else {\r
-                        if (!winner || \r
+                        if (!winner ||\r
                             winner.overlap.getArea() < dd.overlap.getArea()) {\r
                             winner = dd;\r
                         }\r
@@ -1814,21 +1993,33 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return winner;\r
-        };\r
-\r
-        /**\r
-         * Refreshes the cache of the top-left and bottom-right points of the \r
-         * drag and drop objects in the specified groups\r
-         *\r
+        },\r
+\r
+        /**\r
+         * Refreshes the cache of the top-left and bottom-right points of the\r
+         * drag and drop objects in the specified group(s).  This is in the\r
+         * format that is stored in the drag and drop instance, so typical\r
+         * usage is:\r
+         * <code>\r
+         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);\r
+         * </code>\r
+         * Alternatively:\r
+         * <code>\r
+         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});\r
+         * </code>\r
+         * @TODO this really should be an indexed array.  Alternatively this\r
+         * method could accept both.\r
+         * @method refreshCache\r
          * @param {Object} groups an associative array of groups to refresh\r
+         * @static\r
          */\r
-        this.refreshCache = function(groups) {\r
+        refreshCache: function(groups) {\r
             this.logger.log("refreshing element location cache");\r
-            for (sGroup in groups) {\r
+            for (var sGroup in groups) {\r
                 if ("string" != typeof sGroup) {\r
                     continue;\r
                 }\r
-                for (i in this.ids[sGroup]) {\r
+                for (var i in this.ids[sGroup]) {\r
                     var oDD = this.ids[sGroup][i];\r
 \r
                     if (this.isTypeOfDD(oDD)) {\r
@@ -1847,17 +2038,19 @@ if (!YAHOO.util.DragDropMgr) {
                     }\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
          * This checks to make sure an element exists and is in the DOM.  The\r
          * main purpose is to handle cases where innerHTML is used to remove\r
          * drag and drop objects from the DOM.  IE provides an 'unspecified\r
          * error' when trying to access the offsetParent of such an element\r
+         * @method verifyEl\r
          * @param {HTMLElement} el the element to check\r
          * @return {boolean} true if the element looks usable\r
+         * @static\r
          */\r
-        this.verifyEl = function(el) {\r
+        verifyEl: function(el) {\r
             try {\r
                 if (el) {\r
                     var parent = el.offsetParent;\r
@@ -1870,68 +2063,59 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
-        \r
+        },\r
+\r
         /**\r
-         * Returns the an array containing the drag and drop element's position\r
-         * and size, including the DragDrop.padding configured for it\r
-         *\r
-         * @param {DragDrop} oDD the drag and drop object to get the \r
-         * location for\r
-         * @return array containing the top left and bottom right points of the \r
-         * element \r
+         * Returns a Region object containing the drag and drop element's position\r
+         * and size, including the padding configured for it\r
+         * @method getLocation\r
+         * @param {DragDrop} oDD the drag and drop object to get the\r
+         *                       location for\r
+         * @return {YAHOO.util.Region} a Region object representing the total area\r
+         *                             the element occupies, including any padding\r
+         *                             the instance is configured for.\r
+         * @static\r
          */\r
-        this.getLocation = function(oDD) {\r
+        getLocation: function(oDD) {\r
             if (! this.isTypeOfDD(oDD)) {\r
                 this.logger.log(oDD + " is not a DD obj");\r
                 return null;\r
             }\r
 \r
-            var el = oDD.getEl();\r
-\r
-            // element will not have an offsetparent if it was removed from the\r
-            // document or display=none\r
-            // if (!this.verifyEl(el)) {\r
-                // this.logger.log(oDD + " element is not usable");\r
-                // return null;\r
-            // }\r
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;\r
 \r
-            // this.logger.log(oDD.id + " padding: " + oDD.padding);\r
-\r
-            // var aPos = ygPos.getPos(el);\r
-            var aPos = null;\r
             try {\r
-                aPos= YAHOO.util.Dom.getXY(el);\r
+                pos= YAHOO.util.Dom.getXY(el);\r
             } catch (e) { }\r
 \r
-            if (!aPos) {\r
+            if (!pos) {\r
+                this.logger.log("getXY failed");\r
                 return null;\r
             }\r
 \r
-            x1 = aPos[0];\r
+            x1 = pos[0];\r
             x2 = x1 + el.offsetWidth;\r
-\r
-            y1 = aPos[1];\r
+            y1 = pos[1];\r
             y2 = y1 + el.offsetHeight;\r
 \r
-            var t = y1 - oDD.padding[0];\r
-            var r = x2 + oDD.padding[1];\r
-            var b = y2 + oDD.padding[2];\r
-            var l = x1 - oDD.padding[3];\r
+            t = y1 - oDD.padding[0];\r
+            r = x2 + oDD.padding[1];\r
+            b = y2 + oDD.padding[2];\r
+            l = x1 - oDD.padding[3];\r
 \r
             return new YAHOO.util.Region( t, r, b, l );\r
-\r
-        };\r
+        },\r
 \r
         /**\r
          * Checks the cursor location to see if it over the target\r
-         * \r
+         * @method isOverTarget\r
          * @param {YAHOO.util.Point} pt The point to evaluate\r
          * @param {DragDrop} oTarget the DragDrop object we are inspecting\r
          * @return {boolean} true if the mouse is over the target\r
          * @private\r
+         * @static\r
          */\r
-        this.isOverTarget = function(pt, oTarget, intersect) {\r
+        isOverTarget: function(pt, oTarget, intersect) {\r
             // use cache if available\r
             var loc = this.locationCache[oTarget.id];\r
             if (!loc || !this.useCache) {\r
@@ -1943,18 +2127,21 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             if (!loc) {\r
+                this.logger.log("could not get the location of the element");\r
                 return false;\r
             }\r
 \r
+            //this.logger.log("loc: " + loc + ", pt: " + pt);\r
             oTarget.cursorIsOver = loc.contains( pt );\r
 \r
             // DragDrop is using this as a sanity check for the initial mousedown\r
             // in this case we are done.  In POINT mode, if the drag obj has no\r
-            // contraints, we are also done. Otherwise we need to evaluate the \r
+            // contraints, we are also done. Otherwise we need to evaluate the\r
             // location of the target as related to the actual location of the\r
             // dragged element.\r
             var dc = this.dragCurrent;\r
-            if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) {\r
+            if (!dc || !dc.getTargetCoord ||\r
+                    (!intersect && !dc.constrainX && !dc.constrainY)) {\r
                 return oTarget.cursorIsOver;\r
             }\r
 \r
@@ -1967,9 +2154,9 @@ if (!YAHOO.util.DragDropMgr) {
             var pos = dc.getTargetCoord(pt.x, pt.y);\r
 \r
             var el = dc.getDragEl();\r
-            var curRegion = new YAHOO.util.Region( pos.y, \r
+            var curRegion = new YAHOO.util.Region( pos.y,\r
                                                    pos.x + el.offsetWidth,\r
-                                                   pos.y + el.offsetHeight, \r
+                                                   pos.y + el.offsetHeight,\r
                                                    pos.x );\r
 \r
             var overlap = curRegion.intersect(loc);\r
@@ -1980,20 +2167,25 @@ if (!YAHOO.util.DragDropMgr) {
             } else {\r
                 return false;\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
+         * unload event handler\r
+         * @method _onUnload\r
          * @private\r
+         * @static\r
          */\r
-        this._onUnload = function(e, me) {\r
+        _onUnload: function(e, me) {\r
             this.unregAll();\r
-        };\r
+        },\r
 \r
         /**\r
          * Cleans up the drag and drop events and objects.\r
+         * @method unregAll\r
          * @private\r
+         * @static\r
          */\r
-        this.unregAll = function() {\r
+        unregAll: function() {\r
             this.logger.log("unregister all");\r
 \r
             if (this.dragCurrent) {\r
@@ -2009,220 +2201,268 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.elementCache = {};\r
             this.ids = {};\r
-        };\r
+        },\r
 \r
         /**\r
          * A cache of DOM elements\r
+         * @property elementCache\r
          * @private\r
+         * @static\r
          */\r
-        this.elementCache = {};\r
-        \r
+        elementCache: {},\r
+\r
         /**\r
          * Get the wrapper for the DOM element specified\r
-         *\r
-         * @param {String} id the id of the elment to get\r
+         * @method getElWrapper\r
+         * @param {String} id the id of the element to get\r
          * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element\r
          * @private\r
-         * @deprecated\r
+         * @deprecated This wrapper isn't that useful\r
+         * @static\r
          */\r
-        this.getElWrapper = function(id) {\r
+        getElWrapper: function(id) {\r
             var oWrapper = this.elementCache[id];\r
             if (!oWrapper || !oWrapper.el) {\r
-                oWrapper = this.elementCache[id] = \r
+                oWrapper = this.elementCache[id] =\r
                     new this.ElementWrapper(YAHOO.util.Dom.get(id));\r
             }\r
             return oWrapper;\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the actual DOM element\r
-         *\r
+         * @method getElement\r
          * @param {String} id the id of the elment to get\r
          * @return {Object} The element\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.get instead\r
+         * @static\r
          */\r
-        this.getElement = function(id) {\r
+        getElement: function(id) {\r
             return YAHOO.util.Dom.get(id);\r
-        };\r
-        \r
+        },\r
+\r
         /**\r
-         * Returns the style property for the DOM element (i.e., \r
+         * Returns the style property for the DOM element (i.e.,\r
          * document.getElById(id).style)\r
-         *\r
+         * @method getCss\r
          * @param {String} id the id of the elment to get\r
          * @return {Object} The style property of the element\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom instead\r
+         * @static\r
          */\r
-        this.getCss = function(id) {\r
+        getCss: function(id) {\r
             var el = YAHOO.util.Dom.get(id);\r
             return (el) ? el.style : null;\r
-        };\r
+        },\r
 \r
         /**\r
          * Inner class for cached elements\r
+         * @class DragDropMgr.ElementWrapper\r
+         * @for DragDropMgr\r
          * @private\r
          * @deprecated\r
          */\r
-        this.ElementWrapper = function(el) {\r
+        ElementWrapper: function(el) {\r
                 /**\r
-                 * @private\r
+                 * The element\r
+                 * @property el\r
                  */\r
                 this.el = el || null;\r
                 /**\r
-                 * @private\r
+                 * The element id\r
+                 * @property id\r
                  */\r
                 this.id = this.el && el.id;\r
                 /**\r
-                 * @private\r
+                 * A reference to the style property\r
+                 * @property css\r
                  */\r
                 this.css = this.el && el.style;\r
-            };\r
+            },\r
 \r
         /**\r
          * Returns the X position of an html element\r
+         * @method getPosX\r
          * @param el the element for which to get the position\r
          * @return {int} the X coordinate\r
-         * @deprecated\r
+         * @for DragDropMgr\r
+         * @deprecated use YAHOO.util.Dom.getX instead\r
+         * @static\r
          */\r
-        this.getPosX = function(el) {\r
+        getPosX: function(el) {\r
             return YAHOO.util.Dom.getX(el);\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the Y position of an html element\r
+         * @method getPosY\r
          * @param el the element for which to get the position\r
          * @return {int} the Y coordinate\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getY instead\r
+         * @static\r
          */\r
-        this.getPosY = function(el) {\r
-            return YAHOO.util.Dom.getY(el); \r
-        };\r
+        getPosY: function(el) {\r
+            return YAHOO.util.Dom.getY(el);\r
+        },\r
 \r
         /**\r
-         * Swap two nodes.  In IE, we use the native method, for others we \r
+         * Swap two nodes.  In IE, we use the native method, for others we\r
          * emulate the IE behavior\r
-         *\r
+         * @method swapNode\r
          * @param n1 the first node to swap\r
          * @param n2 the other node to swap\r
+         * @static\r
          */\r
-        this.swapNode = function(n1, n2) {\r
+        swapNode: function(n1, n2) {\r
             if (n1.swapNode) {\r
                 n1.swapNode(n2);\r
             } else {\r
-                // the node reference order for the swap is a little tricky. \r
                 var p = n2.parentNode;\r
                 var s = n2.nextSibling;\r
-                n1.parentNode.replaceChild(n2, n1);\r
-                p.insertBefore(n1,s);\r
+\r
+                if (s == n1) {\r
+                    p.insertBefore(n1, n2);\r
+                } else if (n2 == n1.nextSibling) {\r
+                    p.insertBefore(n2, n1);\r
+                } else {\r
+                    n1.parentNode.replaceChild(n2, n1);\r
+                    p.insertBefore(n1, s);\r
+                }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
+         * Returns the current scroll position\r
+         * @method getScroll\r
          * @private\r
-         */\r
-        this.getScroll = function () {\r
-            var t, l;\r
-            if (document.documentElement && document.documentElement.scrollTop) {\r
-                t = document.documentElement.scrollTop;\r
-                l = document.documentElement.scrollLeft;\r
-            } else if (document.body) {\r
-                t = document.body.scrollTop;\r
-                l = document.body.scrollLeft;\r
+         * @static\r
+         */\r
+        getScroll: function () {\r
+            var t, l, dde=document.documentElement, db=document.body;\r
+            if (dde && (dde.scrollTop || dde.scrollLeft)) {\r
+                t = dde.scrollTop;\r
+                l = dde.scrollLeft;\r
+            } else if (db) {\r
+                t = db.scrollTop;\r
+                l = db.scrollLeft;\r
+            } else {\r
+                YAHOO.log("could not get scroll property");\r
             }\r
             return { top: t, left: l };\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the specified element style property\r
+         * @method getStyle\r
          * @param {HTMLElement} el          the element\r
          * @param {string}      styleProp   the style property\r
          * @return {string} The value of the style property\r
-         * @deprecated, use YAHOO.util.Dom.getStyle\r
+         * @deprecated use YAHOO.util.Dom.getStyle\r
+         * @static\r
          */\r
-        this.getStyle = function(el, styleProp) {\r
+        getStyle: function(el, styleProp) {\r
             return YAHOO.util.Dom.getStyle(el, styleProp);\r
-        };\r
+        },\r
 \r
         /**\r
          * Gets the scrollTop\r
+         * @method getScrollTop\r
          * @return {int} the document's scrollTop\r
+         * @static\r
          */\r
-        this.getScrollTop = function () { return this.getScroll().top; };\r
+        getScrollTop: function () { return this.getScroll().top; },\r
 \r
         /**\r
          * Gets the scrollLeft\r
+         * @method getScrollLeft\r
          * @return {int} the document's scrollTop\r
+         * @static\r
          */\r
-        this.getScrollLeft = function () { return this.getScroll().left; };\r
+        getScrollLeft: function () { return this.getScroll().left; },\r
 \r
         /**\r
          * Sets the x/y position of an element to the location of the\r
          * target element.\r
+         * @method moveToEl\r
          * @param {HTMLElement} moveEl      The element to move\r
          * @param {HTMLElement} targetEl    The position reference element\r
+         * @static\r
          */\r
-        this.moveToEl = function (moveEl, targetEl) {\r
+        moveToEl: function (moveEl, targetEl) {\r
             var aCoord = YAHOO.util.Dom.getXY(targetEl);\r
             this.logger.log("moveToEl: " + aCoord);\r
             YAHOO.util.Dom.setXY(moveEl, aCoord);\r
-        };\r
+        },\r
 \r
         /**\r
          * Gets the client height\r
+         * @method getClientHeight\r
          * @return {int} client height in px\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getViewportHeight instead\r
+         * @static\r
          */\r
-        this.getClientHeight = function() {\r
-            return YAHOO.util.Dom.getClientHeight();\r
-        };\r
+        getClientHeight: function() {\r
+            return YAHOO.util.Dom.getViewportHeight();\r
+        },\r
 \r
         /**\r
          * Gets the client width\r
+         * @method getClientWidth\r
          * @return {int} client width in px\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getViewportWidth instead\r
+         * @static\r
          */\r
-        this.getClientWidth = function() {\r
-            return YAHOO.util.Dom.getClientWidth();\r
-        };\r
+        getClientWidth: function() {\r
+            return YAHOO.util.Dom.getViewportWidth();\r
+        },\r
 \r
         /**\r
-         * numeric array sort function\r
+         * Numeric array sort function\r
+         * @method numericSort\r
+         * @static\r
          */\r
-        this.numericSort = function(a, b) { return (a - b); };\r
+        numericSort: function(a, b) { return (a - b); },\r
 \r
         /**\r
+         * Internal counter\r
+         * @property _timeoutCount\r
          * @private\r
+         * @static\r
          */\r
-        this._timeoutCount = 0;\r
+        _timeoutCount: 0,\r
 \r
         /**\r
          * Trying to make the load order less important.  Without this we get\r
          * an error if this file is loaded before the Event Utility.\r
+         * @method _addListeners\r
          * @private\r
+         * @static\r
          */\r
-        this._addListeners = function() {\r
+        _addListeners: function() {\r
+            var DDM = YAHOO.util.DDM;\r
             if ( YAHOO.util.Event && document ) {\r
-                this._onLoad();\r
+                DDM._onLoad();\r
             } else {\r
-                if (this._timeoutCount > 1000) {\r
-                    this.logger.log("DragDrop requires the Event Utility");\r
+                if (DDM._timeoutCount > 2000) {\r
+                    DDM.logger.log("DragDrop requires the Event Utility");\r
                 } else {\r
-                    var DDM = YAHOO.util.DDM;\r
-                    setTimeout( function() { DDM._addListeners(); }, 10);\r
+                    setTimeout(DDM._addListeners, 10);\r
                     if (document && document.body) {\r
-                        this._timeoutCount += 1;\r
+                        DDM._timeoutCount += 1;\r
                     }\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
-         * Recursively searches the immediate parent and all child nodes for \r
-         * the handle element in order to determine wheter or not it was \r
+         * Recursively searches the immediate parent and all child nodes for\r
+         * the handle element in order to determine wheter or not it was\r
          * clicked.\r
+         * @method handleWasClicked\r
          * @param node the html element to inspect\r
+         * @static\r
          */\r
-        this.handleWasClicked = function(node, id) {\r
+        handleWasClicked: function(node, id) {\r
             if (this.isHandle(id, node.id)) {\r
                 this.logger.log("clicked node is a handle");\r
                 return true;\r
@@ -2242,26 +2482,28 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
+        }\r
+\r
+    };\r
 \r
-    } ();\r
+}();\r
 \r
-    // shorter alias, save a few bytes\r
-    YAHOO.util.DDM = YAHOO.util.DragDropMgr;\r
-    YAHOO.util.DDM._addListeners();\r
+// shorter alias, save a few bytes\r
+YAHOO.util.DDM = YAHOO.util.DragDropMgr;\r
+YAHOO.util.DDM._addListeners();\r
 \r
 }\r
 \r
 /**\r
- * A DragDrop implementation where the linked element follows the \r
+ * A DragDrop implementation where the linked element follows the\r
  * mouse cursor during a drag.\r
- *\r
+ * @class DD\r
  * @extends YAHOO.util.DragDrop\r
  * @constructor\r
- * @param {String} id the id of the linked element \r
+ * @param {String} id the id of the linked element\r
  * @param {String} sGroup the group of related DragDrop items\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DD: \r
+ *                Valid properties for DD:\r
  *                    scroll\r
  */\r
 YAHOO.util.DD = function(id, sGroup, config) {\r
@@ -2270,304 +2512,297 @@ YAHOO.util.DD = function(id, sGroup, config) {
     }\r
 };\r
 \r
-// YAHOO.util.DD.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop);\r
-\r
-/**\r
- * When set to true, the utility automatically tries to scroll the browser\r
- * window wehn a drag and drop element is dragged near the viewport boundary.\r
- * Defaults to true.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DD.prototype.scroll = true; \r
+YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {\r
 \r
-/**\r
- * Sets the pointer offset to the distance between the linked element's top \r
- * left corner and the location the element was clicked\r
- *\r
- * @param {int} iPageX the X coordinate of the click\r
- * @param {int} iPageY the Y coordinate of the click\r
- */\r
-YAHOO.util.DD.prototype.autoOffset = function(iPageX, iPageY) {\r
-    // var el = this.getEl();\r
-    // var aCoord = YAHOO.util.Dom.getXY(el);\r
-    // var x = iPageX - aCoord[0];\r
-    // var y = iPageY - aCoord[1];\r
-    var x = iPageX - this.startPageX;\r
-    var y = iPageY - this.startPageY;\r
-    this.setDelta(x, y);\r
-    // this.logger.log("autoOffset el pos: " + aCoord + ", delta: " + x + "," + y);\r
-};\r
+    /**\r
+     * When set to true, the utility automatically tries to scroll the browser\r
+     * window wehn a drag and drop element is dragged near the viewport boundary.\r
+     * Defaults to true.\r
+     * @property scroll\r
+     * @type boolean\r
+     */\r
+    scroll: true,\r
 \r
-/** \r
- * Sets the pointer offset.  You can call this directly to force the offset to\r
- * be in a particular location (e.g., pass in 0,0 to set it to the center of the\r
- * object, as done in YAHOO.widget.Slider)\r
- *\r
- * @param {int} iDeltaX the distance from the left\r
- * @param {int} iDeltaY the distance from the top\r
- */\r
-YAHOO.util.DD.prototype.setDelta = function(iDeltaX, iDeltaY) {\r
-    this.deltaX = iDeltaX;\r
-    this.deltaY = iDeltaY;\r
-    this.logger.log("deltaX:" + this.deltaX + ", deltaY:" + this.deltaY);\r
-};\r
+    /**\r
+     * Sets the pointer offset to the distance between the linked element's top\r
+     * left corner and the location the element was clicked\r
+     * @method autoOffset\r
+     * @param {int} iPageX the X coordinate of the click\r
+     * @param {int} iPageY the Y coordinate of the click\r
+     */\r
+    autoOffset: function(iPageX, iPageY) {\r
+        var x = iPageX - this.startPageX;\r
+        var y = iPageY - this.startPageY;\r
+        this.setDelta(x, y);\r
+        // this.logger.log("autoOffset el pos: " + aCoord + ", delta: " + x + "," + y);\r
+    },\r
 \r
-/**\r
- * Sets the drag element to the location of the mousedown or click event, \r
- * maintaining the cursor location relative to the location on the element \r
- * that was clicked.  Override this if you want to place the element in a \r
- * location other than where the cursor is.\r
- *\r
- * @param {int} iPageX the X coordinate of the mousedown or drag event\r
- * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
- */\r
+    /**\r
+     * Sets the pointer offset.  You can call this directly to force the\r
+     * offset to be in a particular location (e.g., pass in 0,0 to set it\r
+     * to the center of the object, as done in YAHOO.widget.Slider)\r
+     * @method setDelta\r
+     * @param {int} iDeltaX the distance from the left\r
+     * @param {int} iDeltaY the distance from the top\r
+     */\r
+    setDelta: function(iDeltaX, iDeltaY) {\r
+        this.deltaX = iDeltaX;\r
+        this.deltaY = iDeltaY;\r
+        this.logger.log("deltaX:" + this.deltaX + ", deltaY:" + this.deltaY);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.setDragElPos = function(iPageX, iPageY) {\r
-    // the first time we do this, we are going to check to make sure\r
-    // the element has css positioning\r
+    /**\r
+     * Sets the drag element to the location of the mousedown or click event,\r
+     * maintaining the cursor location relative to the location on the element\r
+     * that was clicked.  Override this if you want to place the element in a\r
+     * location other than where the cursor is.\r
+     * @method setDragElPos\r
+     * @param {int} iPageX the X coordinate of the mousedown or drag event\r
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
+     */\r
+    setDragElPos: function(iPageX, iPageY) {\r
+        // the first time we do this, we are going to check to make sure\r
+        // the element has css positioning\r
 \r
-    var el = this.getDragEl();\r
+        var el = this.getDragEl();\r
+        this.alignElWithMouse(el, iPageX, iPageY);\r
+    },\r
 \r
-    // if (!this.cssVerified) {\r
-        // var pos = el.style.position;\r
-        // this.logger.log("drag element position: " + pos);\r
-    // }\r
+    /**\r
+     * Sets the element to the location of the mousedown or click event,\r
+     * maintaining the cursor location relative to the location on the element\r
+     * that was clicked.  Override this if you want to place the element in a\r
+     * location other than where the cursor is.\r
+     * @method alignElWithMouse\r
+     * @param {HTMLElement} el the element to move\r
+     * @param {int} iPageX the X coordinate of the mousedown or drag event\r
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
+     */\r
+    alignElWithMouse: function(el, iPageX, iPageY) {\r
+        var oCoord = this.getTargetCoord(iPageX, iPageY);\r
+        // this.logger.log("****alignElWithMouse : " + el.id + ", " + aCoord + ", " + el.style.display);\r
 \r
-    this.alignElWithMouse(el, iPageX, iPageY);\r
-};\r
+        if (!this.deltaSetXY) {\r
+            var aCoord = [oCoord.x, oCoord.y];\r
+            YAHOO.util.Dom.setXY(el, aCoord);\r
+            var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+            var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
 \r
-/**\r
- * Sets the element to the location of the mousedown or click event, \r
- * maintaining the cursor location relative to the location on the element \r
- * that was clicked.  Override this if you want to place the element in a \r
- * location other than where the cursor is.\r
- *\r
- * @param {HTMLElement} el the element to move\r
- * @param {int} iPageX the X coordinate of the mousedown or drag event\r
- * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
- */\r
-YAHOO.util.DD.prototype.alignElWithMouse = function(el, iPageX, iPageY) {\r
-    var oCoord = this.getTargetCoord(iPageX, iPageY);\r
-    // this.logger.log("****alignElWithMouse : " + el.id + ", " + aCoord + ", " + el.style.display);\r
-\r
-    // this.deltaSetXY = null;\r
-    if (!this.deltaSetXY) {\r
-        var aCoord = [oCoord.x, oCoord.y];\r
-        YAHOO.util.Dom.setXY(el, aCoord);\r
-        var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
-        var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
-\r
-        this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];\r
-\r
-        // this.logger.log("css X: " + YAHOO.util.Dom.getStyle(el, "left"));\r
-        // this.logger.log("css Y: " + YAHOO.util.Dom.getStyle(el, "top"));\r
-        // this.logger.log("deltaSetXY: " + this.deltaSetXY);\r
-    } else {\r
-        YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
-        YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");\r
-    }\r
-    \r
+            this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];\r
+        } else {\r
+            YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
+            YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");\r
+        }\r
 \r
-    this.cachePosition(oCoord.x, oCoord.y);\r
+        this.cachePosition(oCoord.x, oCoord.y);\r
+        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
+    },\r
 \r
-    this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
-};\r
+    /**\r
+     * Saves the most recent position so that we can reset the constraints and\r
+     * tick marks on-demand.  We need to know this so that we can calculate the\r
+     * number of pixels the element is offset from its original position.\r
+     * @method cachePosition\r
+     * @param iPageX the current x position (optional, this just makes it so we\r
+     * don't have to look it up again)\r
+     * @param iPageY the current y position (optional, this just makes it so we\r
+     * don't have to look it up again)\r
+     */\r
+    cachePosition: function(iPageX, iPageY) {\r
+        if (iPageX) {\r
+            this.lastPageX = iPageX;\r
+            this.lastPageY = iPageY;\r
+        } else {\r
+            var aCoord = YAHOO.util.Dom.getXY(this.getEl());\r
+            this.lastPageX = aCoord[0];\r
+            this.lastPageY = aCoord[1];\r
+        }\r
+    },\r
 \r
-/**\r
- * Saves the most recent position so that we can reset the constraints and\r
- * tick marks on-demand.  We need to know this so that we can calculate the\r
- * number of pixels the element is offset from its original position.\r
- */\r
-YAHOO.util.DD.prototype.cachePosition = function(iPageX, iPageY) {\r
-    if (iPageX) {\r
-        this.lastPageX = iPageX;\r
-        this.lastPageY = iPageY;\r
-    } else {\r
-        var aCoord = YAHOO.util.Dom.getXY(this.getEl());\r
-        this.lastPageX = aCoord[0];\r
-        this.lastPageY = aCoord[1];\r
-    }\r
-};\r
+    /**\r
+     * Auto-scroll the window if the dragged object has been moved beyond the\r
+     * visible window boundary.\r
+     * @method autoScroll\r
+     * @param {int} x the drag element's x position\r
+     * @param {int} y the drag element's y position\r
+     * @param {int} h the height of the drag element\r
+     * @param {int} w the width of the drag element\r
+     * @private\r
+     */\r
+    autoScroll: function(x, y, h, w) {\r
 \r
-/**\r
- * Auto-scroll the window if the dragged object has been moved beyond the \r
- * visible window boundary.\r
- *\r
- * @param {int} x the drag element's x position\r
- * @param {int} y the drag element's y position\r
- * @param {int} h the height of the drag element\r
- * @param {int} w the width of the drag element\r
- * @private\r
- */\r
-YAHOO.util.DD.prototype.autoScroll = function(x, y, h, w) {\r
+        if (this.scroll) {\r
+            // The client height\r
+            var clientH = this.DDM.getClientHeight();\r
 \r
-    if (this.scroll) {\r
-        // The client height\r
-        var clientH = this.DDM.getClientHeight();\r
+            // The client width\r
+            var clientW = this.DDM.getClientWidth();\r
 \r
-        // The client width\r
-        var clientW = this.DDM.getClientWidth();\r
+            // The amt scrolled down\r
+            var st = this.DDM.getScrollTop();\r
 \r
-        // The amt scrolled down\r
-        var st = this.DDM.getScrollTop();\r
+            // The amt scrolled right\r
+            var sl = this.DDM.getScrollLeft();\r
 \r
-        // The amt scrolled right\r
-        var sl = this.DDM.getScrollLeft();\r
+            // Location of the bottom of the element\r
+            var bot = h + y;\r
 \r
-        // Location of the bottom of the element\r
-        var bot = h + y;\r
+            // Location of the right of the element\r
+            var right = w + x;\r
 \r
-        // Location of the right of the element\r
-        var right = w + x;\r
+            // The distance from the cursor to the bottom of the visible area,\r
+            // adjusted so that we don't scroll if the cursor is beyond the\r
+            // element drag constraints\r
+            var toBot = (clientH + st - y - this.deltaY);\r
 \r
-        // The distance from the cursor to the bottom of the visible area, \r
-        // adjusted so that we don't scroll if the cursor is beyond the\r
-        // element drag constraints\r
-        var toBot = (clientH + st - y - this.deltaY);\r
+            // The distance from the cursor to the right of the visible area\r
+            var toRight = (clientW + sl - x - this.deltaX);\r
 \r
-        // The distance from the cursor to the right of the visible area\r
-        var toRight = (clientW + sl - x - this.deltaX);\r
+            // this.logger.log( " x: " + x + " y: " + y + " h: " + h +\r
+            // " clientH: " + clientH + " clientW: " + clientW +\r
+            // " st: " + st + " sl: " + sl + " bot: " + bot +\r
+            // " right: " + right + " toBot: " + toBot + " toRight: " + toRight);\r
 \r
-        // this.logger.log( " x: " + x + " y: " + y + " h: " + h + \r
-        // " clientH: " + clientH + " clientW: " + clientW + \r
-        // " st: " + st + " sl: " + sl + " bot: " + bot + \r
-        // " right: " + right + " toBot: " + toBot + " toRight: " + toRight);\r
+            // How close to the edge the cursor must be before we scroll\r
+            // var thresh = (document.all) ? 100 : 40;\r
+            var thresh = 40;\r
 \r
-        // How close to the edge the cursor must be before we scroll\r
-        // var thresh = (document.all) ? 100 : 40;\r
-        var thresh = 40;\r
+            // How many pixels to scroll per autoscroll op.  This helps to reduce\r
+            // clunky scrolling. IE is more sensitive about this ... it needs this\r
+            // value to be higher.\r
+            var scrAmt = (document.all) ? 80 : 30;\r
 \r
-        // How many pixels to scroll per autoscroll op.  This helps to reduce \r
-        // clunky scrolling. IE is more sensitive about this ... it needs this \r
-        // value to be higher.\r
-        var scrAmt = (document.all) ? 80 : 30;\r
+            // Scroll down if we are near the bottom of the visible page and the\r
+            // obj extends below the crease\r
+            if ( bot > clientH && toBot < thresh ) {\r
+                window.scrollTo(sl, st + scrAmt);\r
+            }\r
 \r
-        // Scroll down if we are near the bottom of the visible page and the \r
-        // obj extends below the crease\r
-        if ( bot > clientH && toBot < thresh ) { \r
-            window.scrollTo(sl, st + scrAmt); \r
-        }\r
+            // Scroll up if the window is scrolled down and the top of the object\r
+            // goes above the top border\r
+            if ( y < st && st > 0 && y - st < thresh ) {\r
+                window.scrollTo(sl, st - scrAmt);\r
+            }\r
 \r
-        // Scroll up if the window is scrolled down and the top of the object\r
-        // goes above the top border\r
-        if ( y < st && st > 0 && y - st < thresh ) { \r
-            window.scrollTo(sl, st - scrAmt); \r
-        }\r
+            // Scroll right if the obj is beyond the right border and the cursor is\r
+            // near the border.\r
+            if ( right > clientW && toRight < thresh ) {\r
+                window.scrollTo(sl + scrAmt, st);\r
+            }\r
 \r
-        // Scroll right if the obj is beyond the right border and the cursor is\r
-        // near the border.\r
-        if ( right > clientW && toRight < thresh ) { \r
-            window.scrollTo(sl + scrAmt, st); \r
+            // Scroll left if the window has been scrolled to the right and the obj\r
+            // extends past the left border\r
+            if ( x < sl && sl > 0 && x - sl < thresh ) {\r
+                window.scrollTo(sl - scrAmt, st);\r
+            }\r
         }\r
+    },\r
 \r
-        // Scroll left if the window has been scrolled to the right and the obj\r
-        // extends past the left border\r
-        if ( x < sl && sl > 0 && x - sl < thresh ) { \r
-            window.scrollTo(sl - scrAmt, st);\r
-        }\r
-    }\r
-};\r
+    /**\r
+     * Finds the location the element should be placed if we want to move\r
+     * it to where the mouse location less the click offset would place us.\r
+     * @method getTargetCoord\r
+     * @param {int} iPageX the X coordinate of the click\r
+     * @param {int} iPageY the Y coordinate of the click\r
+     * @return an object that contains the coordinates (Object.x and Object.y)\r
+     * @private\r
+     */\r
+    getTargetCoord: function(iPageX, iPageY) {\r
 \r
-/**\r
- * Finds the location the element should be placed if we want to move\r
- * it to where the mouse location less the click offset would place us.\r
- *\r
- * @param {int} iPageX the X coordinate of the click\r
- * @param {int} iPageY the Y coordinate of the click\r
- * @return an object that contains the coordinates (Object.x and Object.y)\r
- * @private\r
- */\r
-YAHOO.util.DD.prototype.getTargetCoord = function(iPageX, iPageY) {\r
+        // this.logger.log("getTargetCoord: " + iPageX + ", " + iPageY);\r
 \r
-    // this.logger.log("getTargetCoord: " + iPageX + ", " + iPageY);\r
+        var x = iPageX - this.deltaX;\r
+        var y = iPageY - this.deltaY;\r
 \r
-    var x = iPageX - this.deltaX;\r
-    var y = iPageY - this.deltaY;\r
+        if (this.constrainX) {\r
+            if (x < this.minX) { x = this.minX; }\r
+            if (x > this.maxX) { x = this.maxX; }\r
+        }\r
 \r
-    if (this.constrainX) {\r
-        if (x < this.minX) { x = this.minX; }\r
-        if (x > this.maxX) { x = this.maxX; }\r
-    }\r
+        if (this.constrainY) {\r
+            if (y < this.minY) { y = this.minY; }\r
+            if (y > this.maxY) { y = this.maxY; }\r
+        }\r
 \r
-    if (this.constrainY) {\r
-        if (y < this.minY) { y = this.minY; }\r
-        if (y > this.maxY) { y = this.maxY; }\r
-    }\r
+        x = this.getTick(x, this.xTicks);\r
+        y = this.getTick(y, this.yTicks);\r
 \r
-    x = this.getTick(x, this.xTicks);\r
-    y = this.getTick(y, this.yTicks);\r
+        // this.logger.log("getTargetCoord " +\r
+                // " iPageX: " + iPageX +\r
+                // " iPageY: " + iPageY +\r
+                // " x: " + x + ", y: " + y);\r
 \r
-    // this.logger.log("getTargetCoord " + \r
-            // " iPageX: " + iPageX +\r
-            // " iPageY: " + iPageY +\r
-            // " x: " + x + ", y: " + y);\r
+        return {x:x, y:y};\r
+    },\r
 \r
-    return {x:x, y:y};\r
-};\r
+    /*\r
+     * Sets up config options specific to this class. Overrides\r
+     * YAHOO.util.DragDrop, but all versions of this method through the\r
+     * inheritance chain are called\r
+     */\r
+    applyConfig: function() {\r
+        YAHOO.util.DD.superclass.applyConfig.call(this);\r
+        this.scroll = (this.config.scroll !== false);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.applyConfig = function() {\r
-    YAHOO.util.DD.superclass.applyConfig.call(this);\r
-    this.scroll = (this.config.scroll !== false);\r
-};\r
+    /*\r
+     * Event that fires prior to the onMouseDown event.  Overrides\r
+     * YAHOO.util.DragDrop.\r
+     */\r
+    b4MouseDown: function(e) {\r
+        // this.resetConstraints();\r
+        this.autoOffset(YAHOO.util.Event.getPageX(e),\r
+                            YAHOO.util.Event.getPageY(e));\r
+    },\r
 \r
-/** \r
- * Event that fires prior to the onMouseDown event.  Overrides \r
- * YAHOO.util.DragDrop.\r
- */\r
-YAHOO.util.DD.prototype.b4MouseDown = function(e) {\r
-    // this.resetConstraints();\r
-    this.autoOffset(YAHOO.util.Event.getPageX(e), \r
-                        YAHOO.util.Event.getPageY(e));\r
-};\r
+    /*\r
+     * Event that fires prior to the onDrag event.  Overrides\r
+     * YAHOO.util.DragDrop.\r
+     */\r
+    b4Drag: function(e) {\r
+        this.setDragElPos(YAHOO.util.Event.getPageX(e),\r
+                            YAHOO.util.Event.getPageY(e));\r
+    },\r
 \r
-/** \r
- * Event that fires prior to the onDrag event.  Overrides \r
- * YAHOO.util.DragDrop.\r
- */\r
-YAHOO.util.DD.prototype.b4Drag = function(e) {\r
-    this.setDragElPos(YAHOO.util.Event.getPageX(e), \r
-                        YAHOO.util.Event.getPageY(e));\r
-};\r
+    toString: function() {\r
+        return ("DD " + this.id);\r
+    }\r
 \r
-YAHOO.util.DD.prototype.toString = function() {\r
-    return ("DD " + this.id);\r
-};\r
+    //////////////////////////////////////////////////////////////////////////\r
+    // Debugging ygDragDrop events that can be overridden\r
+    //////////////////////////////////////////////////////////////////////////\r
+    /*\r
+    startDrag: function(x, y) {\r
+        this.logger.log(this.id.toString()  + " startDrag");\r
+    },\r
 \r
-///////////////////////////////////////////////////////////////////////////////\r
-// Debugging ygDragDrop events that can be overridden\r
-///////////////////////////////////////////////////////////////////////////////\r
-/*\r
-YAHOO.util.DD.prototype.startDrag = function(x, y) {\r
-    this.logger.log(this.id.toString()  + " startDrag");\r
-};\r
+    onDrag: function(e) {\r
+        this.logger.log(this.id.toString() + " onDrag");\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDrag = function(e) {\r
-    this.logger.log(this.id.toString() + " onDrag");\r
-};\r
+    onDragEnter: function(e, id) {\r
+        this.logger.log(this.id.toString() + " onDragEnter: " + id);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragEnter = function(e, id) {\r
-    this.logger.log(this.id.toString() + " onDragEnter: " + id);\r
-};\r
+    onDragOver: function(e, id) {\r
+        this.logger.log(this.id.toString() + " onDragOver: " + id);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragOver = function(e, id) {\r
-    this.logger.log(this.id.toString() + " onDragOver: " + id);\r
-};\r
+    onDragOut: function(e, id) {\r
+        this.logger.log(this.id.toString() + " onDragOut: " + id);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragOut = function(e, id) {\r
-    this.logger.log(this.id.toString() + " onDragOut: " + id);\r
-};\r
+    onDragDrop: function(e, id) {\r
+        this.logger.log(this.id.toString() + " onDragDrop: " + id);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragDrop = function(e, id) {\r
-    this.logger.log(this.id.toString() + " onDragDrop: " + id);\r
-};\r
+    endDrag: function(e) {\r
+        this.logger.log(this.id.toString() + " endDrag");\r
+    }\r
 \r
-YAHOO.util.DD.prototype.endDrag = function(e) {\r
-    this.logger.log(this.id.toString() + " endDrag");\r
-};\r
-*/\r
+    */\r
 \r
+});\r
 /**\r
  * A DragDrop implementation that inserts an empty, bordered div into\r
  * the document that follows the cursor during drag operations.  At the time of\r
@@ -2578,233 +2813,226 @@ YAHOO.util.DD.prototype.endDrag = function(e) {
  * was created to be dragged in place of all DDProxy elements on the\r
  * page.\r
  *\r
+ * @class DDProxy\r
  * @extends YAHOO.util.DD\r
  * @constructor\r
  * @param {String} id the id of the linked html element\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DDProxy in addition to those in DragDrop: \r
+ *                Valid properties for DDProxy in addition to those in DragDrop:\r
  *                   resizeFrame, centerFrame, dragElId\r
  */\r
 YAHOO.util.DDProxy = function(id, sGroup, config) {\r
     if (id) {\r
         this.init(id, sGroup, config);\r
-        this.initFrame(); \r
+        this.initFrame();\r
     }\r
 };\r
 \r
-YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD);\r
-\r
 /**\r
  * The default drag frame div id\r
+ * @property YAHOO.util.DDProxy.dragElId\r
  * @type String\r
+ * @static\r
  */\r
 YAHOO.util.DDProxy.dragElId = "ygddfdiv";\r
 \r
-/**\r
- * By default we resize the drag frame to be the same size as the element\r
- * we want to drag (this is to get the frame effect).  We can turn it off\r
- * if we want a different behavior.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DDProxy.prototype.resizeFrame = true;\r
-\r
-/**\r
- * By default the frame is positioned exactly where the drag element is, so\r
- * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if\r
- * you do not have constraints on the obj is to have the drag frame centered\r
- * around the cursor.  Set centerFrame to true for this effect.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DDProxy.prototype.centerFrame = false;\r
+YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {\r
 \r
-/**\r
- * Previous proxy element size.\r
- * @private\r
- */\r
-YAHOO.util.DDProxy.prototype._previousSize = [-1, -1];\r
-\r
-/**\r
- * Create the drag frame if needed\r
- */\r
-YAHOO.util.DDProxy.prototype.createFrame = function() {\r
-    var self = this;\r
-    var body = document.body;\r
-\r
-    if (!body || !body.firstChild) {\r
-        setTimeout( function() { self.createFrame(); }, 50 );\r
-        return;\r
-    }\r
-\r
-    var div = this.getDragEl();\r
+    /**\r
+     * By default we resize the drag frame to be the same size as the element\r
+     * we want to drag (this is to get the frame effect).  We can turn it off\r
+     * if we want a different behavior.\r
+     * @property resizeFrame\r
+     * @type boolean\r
+     */\r
+    resizeFrame: true,\r
 \r
-    if (!div) {\r
-        div    = document.createElement("div");\r
-        div.id = this.dragElId;\r
-        var s  = div.style;\r
+    /**\r
+     * By default the frame is positioned exactly where the drag element is, so\r
+     * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if\r
+     * you do not have constraints on the obj is to have the drag frame centered\r
+     * around the cursor.  Set centerFrame to true for this effect.\r
+     * @property centerFrame\r
+     * @type boolean\r
+     */\r
+    centerFrame: false,\r
 \r
-        s.position   = "absolute";\r
-        s.visibility = "hidden";\r
-        s.cursor     = "move";\r
-        s.border     = "2px solid #aaa";\r
-        s.zIndex     = 999;\r
+    /**\r
+     * Creates the proxy element if it does not yet exist\r
+     * @method createFrame\r
+     */\r
+    createFrame: function() {\r
+        var self = this;\r
+        var body = document.body;\r
 \r
-        // appendChild can blow up IE if invoked prior to the window load event\r
-        // while rendering a table.  It is possible there are other scenarios \r
-        // that would cause this to happen as well.\r
-        body.insertBefore(div, body.firstChild);\r
-    }\r
-};\r
+        if (!body || !body.firstChild) {\r
+            setTimeout( function() { self.createFrame(); }, 50 );\r
+            return;\r
+        }\r
 \r
-/**\r
- * Initialization for the drag frame element.  Must be called in the\r
- * constructor of all subclasses\r
- */\r
-YAHOO.util.DDProxy.prototype.initFrame = function() {\r
-    // YAHOO.util.DDProxy.createFrame();\r
-    // this.setDragElId(YAHOO.util.DDProxy.dragElId);\r
+        var div = this.getDragEl();\r
 \r
-    this.createFrame();\r
+        if (!div) {\r
+            div    = document.createElement("div");\r
+            div.id = this.dragElId;\r
+            var s  = div.style;\r
 \r
-};\r
+            s.position   = "absolute";\r
+            s.visibility = "hidden";\r
+            s.cursor     = "move";\r
+            s.border     = "2px solid #aaa";\r
+            s.zIndex     = 999;\r
 \r
-YAHOO.util.DDProxy.prototype.applyConfig = function() {\r
-    this.logger.log("DDProxy applyConfig");\r
-    YAHOO.util.DDProxy.superclass.applyConfig.call(this);\r
+            // appendChild can blow up IE if invoked prior to the window load event\r
+            // while rendering a table.  It is possible there are other scenarios\r
+            // that would cause this to happen as well.\r
+            body.insertBefore(div, body.firstChild);\r
+        }\r
+    },\r
 \r
-    this.resizeFrame = (this.config.resizeFrame !== false);\r
-    this.centerFrame = (this.config.centerFrame);\r
-    this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId);\r
+    /**\r
+     * Initialization for the drag frame element.  Must be called in the\r
+     * constructor of all subclasses\r
+     * @method initFrame\r
+     */\r
+    initFrame: function() {\r
+        this.createFrame();\r
+    },\r
 \r
-    //this.logger.log("dragElId: " + this.dragElId);\r
-};\r
+    applyConfig: function() {\r
+        this.logger.log("DDProxy applyConfig");\r
+        YAHOO.util.DDProxy.superclass.applyConfig.call(this);\r
 \r
-/**\r
- * Resizes the drag frame to the dimensions of the clicked object, positions \r
- * it over the object, and finally displays it\r
- *\r
- * @param {int} iPageX X click position\r
- * @param {int} iPageY Y click position\r
- * @private\r
- */\r
-YAHOO.util.DDProxy.prototype.showFrame = function(iPageX, iPageY) {\r
-    var el = this.getEl();\r
-    var dragEl = this.getDragEl();\r
-    var s = dragEl.style;\r
+        this.resizeFrame = (this.config.resizeFrame !== false);\r
+        this.centerFrame = (this.config.centerFrame);\r
+        this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId);\r
+    },\r
 \r
-    this._resizeProxy();\r
+    /**\r
+     * Resizes the drag frame to the dimensions of the clicked object, positions\r
+     * it over the object, and finally displays it\r
+     * @method showFrame\r
+     * @param {int} iPageX X click position\r
+     * @param {int} iPageY Y click position\r
+     * @private\r
+     */\r
+    showFrame: function(iPageX, iPageY) {\r
+        var el = this.getEl();\r
+        var dragEl = this.getDragEl();\r
+        var s = dragEl.style;\r
 \r
-    if (this.centerFrame) {\r
-        this.setDelta( Math.round(parseInt(s.width,  10)/2), \r
-                       Math.round(parseInt(s.height, 10)/2) );\r
-    }\r
+        this._resizeProxy();\r
 \r
-    this.setDragElPos(iPageX, iPageY);\r
+        if (this.centerFrame) {\r
+            this.setDelta( Math.round(parseInt(s.width,  10)/2),\r
+                           Math.round(parseInt(s.height, 10)/2) );\r
+        }\r
 \r
-    // s.visibility = "";\r
-    YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); \r
-};\r
+        this.setDragElPos(iPageX, iPageY);\r
 \r
-YAHOO.util.DDProxy.prototype._resizeProxy = function() {\r
-    var DOM    = YAHOO.util.Dom;\r
-    var el     = this.getEl();\r
-    var dragEl = this.getDragEl();\r
+        YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible");\r
+    },\r
 \r
-    if (this.resizeFrame) {\r
-        var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth"    ), 10);\r
-        var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth"  ), 10);\r
-        var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10);\r
-        var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth"   ), 10);\r
+    /**\r
+     * The proxy is automatically resized to the dimensions of the linked\r
+     * element when a drag is initiated, unless resizeFrame is set to false\r
+     * @method _resizeProxy\r
+     * @private\r
+     */\r
+    _resizeProxy: function() {\r
+        if (this.resizeFrame) {\r
+            var DOM    = YAHOO.util.Dom;\r
+            var el     = this.getEl();\r
+            var dragEl = this.getDragEl();\r
 \r
-        if (isNaN(bt)) { bt = 0; }\r
-        if (isNaN(br)) { br = 0; }\r
-        if (isNaN(bb)) { bb = 0; }\r
-        if (isNaN(bl)) { bl = 0; }\r
+            var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth"    ), 10);\r
+            var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth"  ), 10);\r
+            var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10);\r
+            var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth"   ), 10);\r
 \r
-        this.logger.log("proxy size: " + bt + "  " + br + " " + bb + " " + bl);\r
+            if (isNaN(bt)) { bt = 0; }\r
+            if (isNaN(br)) { br = 0; }\r
+            if (isNaN(bb)) { bb = 0; }\r
+            if (isNaN(bl)) { bl = 0; }\r
 \r
-        var newWidth  = el.offsetWidth - br - bl;\r
-        var newHeight = el.offsetHeight - bt - bb;\r
+            this.logger.log("proxy size: " + bt + "  " + br + " " + bb + " " + bl);\r
 \r
-        if (this._previousSize[0] !== newWidth && \r
-                        this._previousSize[1] !== newHeight) {\r
+            var newWidth  = Math.max(0, el.offsetWidth  - br - bl);\r
+            var newHeight = Math.max(0, el.offsetHeight - bt - bb);\r
 \r
             this.logger.log("Resizing proxy element");\r
 \r
             DOM.setStyle( dragEl, "width",  newWidth  + "px" );\r
             DOM.setStyle( dragEl, "height", newHeight + "px" );\r
-\r
-            this._previousSize = [newWidth, newHeight];\r
         }\r
-    }\r
-};\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4MouseDown = function(e) {\r
-    var x = YAHOO.util.Event.getPageX(e);\r
-    var y = YAHOO.util.Event.getPageY(e);\r
-    this.autoOffset(x, y);\r
-    this.setDragElPos(x, y);\r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4MouseDown: function(e) {\r
+        var x = YAHOO.util.Event.getPageX(e);\r
+        var y = YAHOO.util.Event.getPageY(e);\r
+        this.autoOffset(x, y);\r
+        this.setDragElPos(x, y);\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4StartDrag = function(x, y) {\r
-    // show the drag frame\r
-    this.logger.log("start drag show frame, x: " + x + ", y: " + y);\r
-    this.showFrame(x, y);\r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4StartDrag: function(x, y) {\r
+        // show the drag frame\r
+        this.logger.log("start drag show frame, x: " + x + ", y: " + y);\r
+        this.showFrame(x, y);\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4EndDrag = function(e) {\r
-    this.logger.log(this.id + " b4EndDrag");\r
-    YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); \r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4EndDrag: function(e) {\r
+        this.logger.log(this.id + " b4EndDrag");\r
+        YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden");\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-// By default we try to move the element to the last location of the frame.  \r
-// This is so that the default behavior mirrors that of YAHOO.util.DD.  \r
-YAHOO.util.DDProxy.prototype.endDrag = function(e) {\r
-    var DOM = YAHOO.util.Dom;\r
-    this.logger.log(this.id + " endDrag");\r
-    var lel = this.getEl();\r
-    var del = this.getDragEl();\r
-\r
-    // Show the drag frame briefly so we can get its position\r
-    // del.style.visibility = "";\r
-    DOM.setStyle(del, "visibility", ""); \r
-\r
-    // Hide the linked element before the move to get around a Safari \r
-    // rendering bug.\r
-    //lel.style.visibility = "hidden";\r
-    DOM.setStyle(lel, "visibility", "hidden"); \r
-    YAHOO.util.DDM.moveToEl(lel, del);\r
-    //del.style.visibility = "hidden";\r
-    DOM.setStyle(del, "visibility", "hidden"); \r
-    //lel.style.visibility = "";\r
-    DOM.setStyle(lel, "visibility", ""); \r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    // By default we try to move the element to the last location of the frame.\r
+    // This is so that the default behavior mirrors that of YAHOO.util.DD.\r
+    endDrag: function(e) {\r
+        var DOM = YAHOO.util.Dom;\r
+        this.logger.log(this.id + " endDrag");\r
+        var lel = this.getEl();\r
+        var del = this.getDragEl();\r
+\r
+        // Show the drag frame briefly so we can get its position\r
+        // del.style.visibility = "";\r
+        DOM.setStyle(del, "visibility", "");\r
+\r
+        // Hide the linked element before the move to get around a Safari\r
+        // rendering bug.\r
+        //lel.style.visibility = "hidden";\r
+        DOM.setStyle(lel, "visibility", "hidden");\r
+        YAHOO.util.DDM.moveToEl(lel, del);\r
+        //del.style.visibility = "hidden";\r
+        DOM.setStyle(del, "visibility", "hidden");\r
+        //lel.style.visibility = "";\r
+        DOM.setStyle(lel, "visibility", "");\r
+    },\r
 \r
-YAHOO.util.DDProxy.prototype.toString = function() {\r
-    return ("DDProxy " + this.id);\r
-};\r
+    toString: function() {\r
+        return ("DDProxy " + this.id);\r
+    }\r
 \r
+});\r
 /**\r
- * A DragDrop implementation that does not move, but can be a drop \r
- * target.  You would get the same result by simply omitting implementation \r
- * for the event callbacks, but this way we reduce the processing cost of the \r
+ * A DragDrop implementation that does not move, but can be a drop\r
+ * target.  You would get the same result by simply omitting implementation\r
+ * for the event callbacks, but this way we reduce the processing cost of the\r
  * event listener and the callbacks.\r
- *\r
- * @extends YAHOO.util.DragDrop \r
+ * @class DDTarget\r
+ * @extends YAHOO.util.DragDrop\r
  * @constructor\r
  * @param {String} id the id of the element that is a drop target\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DDTarget in addition to those in DragDrop: \r
- *                  none\r
+ *                 Valid properties for DDTarget in addition to those in\r
+ *                 DragDrop:\r
+ *                    none\r
  */\r
\r
 YAHOO.util.DDTarget = function(id, sGroup, config) {\r
     if (id) {\r
         this.initTarget(id, sGroup, config);\r
@@ -2812,9 +3040,8 @@ YAHOO.util.DDTarget = function(id, sGroup, config) {
 };\r
 \r
 // YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop);\r
-\r
-YAHOO.util.DDTarget.prototype.toString = function() {\r
-    return ("DDTarget " + this.id);\r
-};\r
-\r
+YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {\r
+    toString: function() {\r
+        return ("DDTarget " + this.id);\r
+    }\r
+});\r
index 4d5c7e69b56369359084f5f7b35cea5483320e0b..56293cf8fa0574276ef2288c27e6714d44e4f2a6 100755 (executable)
@@ -1 +1 @@
-/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ YAHOO.util.DragDrop=function(id,_2,_3){if(id){this.init(id,_2,_3);}};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,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,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){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=YAHOO.util.Dom.get(this.id);}return this._domRef;},getDragEl:function(){return YAHOO.util.Dom.get(this.dragElId);},init:function(id,_7,_8){this.initTarget(id,_7,_8);YAHOO.util.Event.addListener(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_9,_10){this.config=_10||{};this.DDM=YAHOO.util.DDM;this.groups={};this.id=id;this.addToGroup((_9)?_9:"default");this.handleElId=id;YAHOO.util.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(_11,_12,_13,_14){if(!_12&&0!==_12){this.padding=[_11,_11,_11,_11];}else{if(!_13&&0!==_13){this.padding=[_11,_12,_11,_12];}else{this.padding=[_11,_12,_13,_14];}}},setInitPosition:function(_15,_16){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_15||0;var dy=_16||0;var p=YAHOO.util.Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.deltaSetXY=null;this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||YAHOO.util.Dom.getXY(this.getEl());this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_22){this.groups[_22]=true;this.DDM.regDragDrop(this,_22);},removeFromGroup:function(_23){if(this.groups[_23]){delete this.groups[_23];}this.DDM.removeDDFromGroup(this,_23);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){YAHOO.util.Event.addListener(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);},unreg:function(){YAHOO.util.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 EU=YAHOO.util.Event;var _26=e.which||e.button;if(this.primaryButtonOnly&&_26>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(EU.getPageX(e),EU.getPageY(e));if(this.DDM.isOverTarget(pt,this)){var _28=EU.getTarget(e);if(this.isValidHandleChild(_28)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_28,this.id))){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}}},addInvalidHandleType:function(_29){var _30=_29.toUpperCase();this.invalidHandleTypes[_30]=_30;},addInvalidHandleId:function(id){this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_31){this.invalidHandleClasses.push(_31);},removeInvalidHandleType:function(_32){var _33=_32.toUpperCase();delete this.invalidHandleTypes[_33];},removeInvalidHandleId:function(id){delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_34){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_34){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_36){var _37=true;var _38;try{_38=_36.nodeName.toUpperCase();}catch(e){_38=_36.nodeName;}_37=_37&&!this.invalidHandleTypes[_38];_37=_37&&!this.invalidHandleIds[_36.id];for(var i=0,len=this.invalidHandleClasses.length;_37&&i<len;++i){_37=!YAHOO.util.Dom.hasClass(_36,this.invalidHandleClasses[i]);}return _37;},setXTicks:function(_39,_40){this.xTicks=[];this.xTickSize=_40;var _41={};for(var i=this.initPageX;i>=this.minX;i=i-_40){if(!_41[i]){this.xTicks[this.xTicks.length]=i;_41[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_40){if(!_41[i]){this.xTicks[this.xTicks.length]=i;_41[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_42,_43){this.yTicks=[];this.yTickSize=_43;var _44={};for(var i=this.initPageY;i>=this.minY;i=i-_43){if(!_44[i]){this.yTicks[this.yTicks.length]=i;_44[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_43){if(!_44[i]){this.yTicks[this.yTicks.length]=i;_44[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_45,_46,_47){this.leftConstraint=_45;this.rightConstraint=_46;this.minX=this.initPageX-_45;this.maxX=this.initPageX+_46;if(_47){this.setXTicks(this.initPageX,_47);}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,_49,_50){this.topConstraint=iUp;this.bottomConstraint=_49;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_49;if(_50){this.setYTicks(this.initPageY,_50);}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,_52){if(!_52){return val;}else{if(_52[0]>=val){return _52[0];}else{for(var i=0,len=_52.length;i<len;++i){var _53=i+1;if(_52[_53]&&_52[_53]>=val){var _54=val-_52[i];var _55=_52[_53]-val;return (_55>_54)?_52[i]:_52[_53];}}return _52[_52.length-1];}}},toString:function(){return ("DragDrop "+this.id);}};if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=new function(){this.ids={};this.handleIds={};this.dragCurrent=null;this.dragOvers={};this.deltaX=0;this.deltaY=0;this.preventDefault=true;this.stopPropagation=true;this.initalized=false;this.locked=false;this.init=function(){this.initialized=true;};this.POINT=0;this.INTERSECT=1;this.mode=this.POINT;this._execOnAll=function(_56,_57){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[_56].apply(oDD,_57);}}};this._onLoad=function(){this.init();var EU=YAHOO.util.Event;EU.on(document,"mouseup",this.handleMouseUp,this,true);EU.on(document,"mousemove",this.handleMouseMove,this,true);EU.on(window,"unload",this._onUnload,this,true);EU.on(window,"resize",this._onResize,this,true);};this._onResize=function(e){this._execOnAll("resetConstraints",[]);};this.lock=function(){this.locked=true;};this.unlock=function(){this.locked=false;};this.isLocked=function(){return this.locked;};this.locationCache={};this.useCache=true;this.clickPixelThresh=3;this.clickTimeThresh=1000;this.dragThreshMet=false;this.clickTimeout=null;this.startX=0;this.startY=0;this.regDragDrop=function(oDD,_59){if(!this.initialized){this.init();}if(!this.ids[_59]){this.ids[_59]={};}this.ids[_59][oDD.id]=oDD;};this.removeDDFromGroup=function(oDD,_60){if(!this.ids[_60]){this.ids[_60]={};}var obj=this.ids[_60];if(obj&&obj[oDD.id]){delete obj[oDD.id];}};this._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];};this.regHandle=function(_63,_64){if(!this.handleIds[_63]){this.handleIds[_63]={};}this.handleIds[_63][_64]=_64;};this.isDragDrop=function(id){return (this.getDDById(id))?true:false;};this.getRelated=function(_65,_66){var _67=[];for(var i in _65.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_66||dd.isTarget){_67[_67.length]=dd;}}}return _67;};this.isLegalTarget=function(oDD,_69){var _70=this.getRelated(oDD,true);for(var i=0,len=_70.length;i<len;++i){if(_70[i].id==_69.id){return true;}}return false;};this.isTypeOfDD=function(oDD){return (oDD&&oDD.__ygDragDrop);};this.isHandle=function(_71,_72){return (this.handleIds[_71]&&this.handleIds[_71][_72]);};this.getDDById=function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;};this.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);};this.startDrag=function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;};this.handleMouseUp=function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);};this.stopEvent=function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}};this.stopDrag=function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};};this.handleMouseMove=function(e){if(!this.dragCurrent){return false;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _74=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _75=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_74>this.clickPixelThresh||_75>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;};this.fireEvents=function(e,_76){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 _78=[];var _79=[];var _80=[];var _81=[];var _82=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_79.push(ddo);}_78[i]=true;delete this.dragOvers[i];}for(var _84 in dc.groups){if("string"!=typeof _84){continue;}for(i in this.ids[_84]){var oDD=this.ids[_84][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_76){_81.push(oDD);}else{if(!_78[oDD.id]){_82.push(oDD);}else{_80.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_79.length){dc.b4DragOut(e,_79);dc.onDragOut(e,_79);}if(_82.length){dc.onDragEnter(e,_82);}if(_80.length){dc.b4DragOver(e,_80);dc.onDragOver(e,_80);}if(_81.length){dc.b4DragDrop(e,_81);dc.onDragDrop(e,_81);}}else{var len=0;for(i=0,len=_79.length;i<len;++i){dc.b4DragOut(e,_79[i].id);dc.onDragOut(e,_79[i].id);}for(i=0,len=_82.length;i<len;++i){dc.onDragEnter(e,_82[i].id);}for(i=0,len=_80.length;i<len;++i){dc.b4DragOver(e,_80[i].id);dc.onDragOver(e,_80[i].id);}for(i=0,len=_81.length;i<len;++i){dc.b4DragDrop(e,_81[i].id);dc.onDragDrop(e,_81[i].id);}}};this.getBestMatch=function(dds){var _87=null;var len=dds.length;if(len==1){_87=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_87=dd;break;}else{if(!_87||_87.overlap.getArea()<dd.overlap.getArea()){_87=dd;}}}}return _87;};this.refreshCache=function(_88){for(sGroup in _88){if("string"!=typeof sGroup){continue;}for(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];}}}}};this.verifyEl=function(el){try{if(el){var _90=el.offsetParent;if(_90){return true;}}}catch(e){}return false;};this.getLocation=function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl();var _91=null;try{_91=YAHOO.util.Dom.getXY(el);}catch(e){}if(!_91){return null;}x1=_91[0];x2=x1+el.offsetWidth;y1=_91[1];y2=y1+el.offsetHeight;var t=y1-oDD.padding[0];var r=x2+oDD.padding[1];var b=y2+oDD.padding[2];var l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);};this.isOverTarget=function(pt,_96,_97){var loc=this.locationCache[_96.id];if(!loc||!this.useCache){loc=this.getLocation(_96);this.locationCache[_96.id]=loc;}if(!loc){return false;}_96.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!_97&&!dc.constrainX&&!dc.constrainY)){return _96.cursorIsOver;}_96.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _98=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _99=_98.intersect(loc);if(_99){_96.overlap=_99;return (_97)?true:_96.cursorIsOver;}else{return false;}};this._onUnload=function(e,me){this.unregAll();};this.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={};};this.elementCache={};this.getElWrapper=function(id){var _101=this.elementCache[id];if(!_101||!_101.el){_101=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}return _101;};this.getElement=function(id){return YAHOO.util.Dom.get(id);};this.getCss=function(id){var el=YAHOO.util.Dom.get(id);return (el)?el.style:null;};this.ElementWrapper=function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;};this.getPosX=function(el){return YAHOO.util.Dom.getX(el);};this.getPosY=function(el){return YAHOO.util.Dom.getY(el);};this.swapNode=function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}};this.getScroll=function(){var t,l;if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;}else{if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;}}return {top:t,left:l};};this.getStyle=function(el,_105){return YAHOO.util.Dom.getStyle(el,_105);};this.getScrollTop=function(){return this.getScroll().top;};this.getScrollLeft=function(){return this.getScroll().left;};this.moveToEl=function(_106,_107){var _108=YAHOO.util.Dom.getXY(_107);YAHOO.util.Dom.setXY(_106,_108);};this.getClientHeight=function(){return YAHOO.util.Dom.getClientHeight();};this.getClientWidth=function(){return YAHOO.util.Dom.getClientWidth();};this.numericSort=function(a,b){return (a-b);};this._timeoutCount=0;this._addListeners=function(){if(YAHOO.util.Event&&document){this._onLoad();}else{if(this._timeoutCount>1000){}else{var DDM=YAHOO.util.DDM;setTimeout(function(){DDM._addListeners();},10);if(document&&document.body){this._timeoutCount+=1;}}}};this.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();}YAHOO.util.DD=function(id,_111,_112){if(id){this.init(id,_111,_112);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop);YAHOO.util.DD.prototype.scroll=true;YAHOO.util.DD.prototype.autoOffset=function(_113,_114){var x=_113-this.startPageX;var y=_114-this.startPageY;this.setDelta(x,y);};YAHOO.util.DD.prototype.setDelta=function(_115,_116){this.deltaX=_115;this.deltaY=_116;};YAHOO.util.DD.prototype.setDragElPos=function(_117,_118){var el=this.getDragEl();this.alignElWithMouse(el,_117,_118);};YAHOO.util.DD.prototype.alignElWithMouse=function(el,_119,_120){var _121=this.getTargetCoord(_119,_120);if(!this.deltaSetXY){var _122=[_121.x,_121.y];YAHOO.util.Dom.setXY(el,_122);var _123=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var _124=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[_123-_121.x,_124-_121.y];}else{YAHOO.util.Dom.setStyle(el,"left",(_121.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(_121.y+this.deltaSetXY[1])+"px");}this.cachePosition(_121.x,_121.y);this.autoScroll(_121.x,_121.y,el.offsetHeight,el.offsetWidth);};YAHOO.util.DD.prototype.cachePosition=function(_125,_126){if(_125){this.lastPageX=_125;this.lastPageY=_126;}else{var _127=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_127[0];this.lastPageY=_127[1];}};YAHOO.util.DD.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var _130=this.DDM.getClientHeight();var _131=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _135=w+x;var _136=(_130+st-y-this.deltaY);var _137=(_131+sl-x-this.deltaX);var _138=40;var _139=(document.all)?80:30;if(bot>_130&&_136<_138){window.scrollTo(sl,st+_139);}if(y<st&&st>0&&y-st<_138){window.scrollTo(sl,st-_139);}if(_135>_131&&_137<_138){window.scrollTo(sl+_139,st);}if(x<sl&&sl>0&&x-sl<_138){window.scrollTo(sl-_139,st);}}};YAHOO.util.DD.prototype.getTargetCoord=function(_140,_141){var x=_140-this.deltaX;var y=_141-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};};YAHOO.util.DD.prototype.applyConfig=function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);};YAHOO.util.DD.prototype.b4MouseDown=function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.b4Drag=function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.toString=function(){return ("DD "+this.id);};YAHOO.util.DDProxy=function(id,_142,_143){if(id){this.init(id,_142,_143);this.initFrame();}};YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD);YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.util.DDProxy.prototype.resizeFrame=true;YAHOO.util.DDProxy.prototype.centerFrame=false;YAHOO.util.DDProxy.prototype._previousSize=[-1,-1];YAHOO.util.DDProxy.prototype.createFrame=function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();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;body.insertBefore(div,body.firstChild);}};YAHOO.util.DDProxy.prototype.initFrame=function(){this.createFrame();};YAHOO.util.DDProxy.prototype.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);};YAHOO.util.DDProxy.prototype.showFrame=function(_147,_148){var el=this.getEl();var _149=this.getDragEl();var s=_149.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_147,_148);YAHOO.util.Dom.setStyle(_149,"visibility","visible");};YAHOO.util.DDProxy.prototype._resizeProxy=function(){var DOM=YAHOO.util.Dom;var el=this.getEl();var _151=this.getDragEl();if(this.resizeFrame){var bt=parseInt(DOM.getStyle(_151,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(_151,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(_151,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(_151,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}if(isNaN(br)){br=0;}if(isNaN(bb)){bb=0;}if(isNaN(bl)){bl=0;}var _156=el.offsetWidth-br-bl;var _157=el.offsetHeight-bt-bb;if(this._previousSize[0]!==_156&&this._previousSize[1]!==_157){DOM.setStyle(_151,"width",_156+"px");DOM.setStyle(_151,"height",_157+"px");this._previousSize=[_156,_157];}}};YAHOO.util.DDProxy.prototype.b4MouseDown=function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);};YAHOO.util.DDProxy.prototype.b4StartDrag=function(x,y){this.showFrame(x,y);};YAHOO.util.DDProxy.prototype.b4EndDrag=function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");};YAHOO.util.DDProxy.prototype.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","");};YAHOO.util.DDProxy.prototype.toString=function(){return ("DDProxy "+this.id);};YAHOO.util.DDTarget=function(id,_160,_161){if(id){this.initTarget(id,_160,_161);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop);YAHOO.util.DDTarget.prototype.toString=function(){return ("DDTarget "+this.id);};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){var _1=YAHOO.util.Event;var _2=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5);}};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,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,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=_2.get(this.id);}return this._domRef;},getDragEl:function(){return _2.get(this.dragElId);},init:function(id,_9,_10){this.initTarget(id,_9,_10);_1.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_11,_12){this.config=_12||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.id=id;this.addToGroup((_11)?_11:"default");this.handleElId=id;_1.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(_13,_14,_15,_16){if(!_14&&0!==_14){this.padding=[_13,_13,_13,_13];}else{if(!_15&&0!==_15){this.padding=[_13,_14,_13,_14];}else{this.padding=[_13,_14,_15,_16];}}},setInitPosition:function(_17,_18){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_17||0;var dy=_18||0;var p=_2.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||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_24){this.groups[_24]=true;this.DDM.regDragDrop(this,_24);},removeFromGroup:function(_25){if(this.groups[_25]){delete this.groups[_25];}this.DDM.removeDDFromGroup(this,_25);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}_1.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){_1.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 _27=e.which||e.button;if(this.primaryButtonOnly&&_27>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(_1.getPageX(e),_1.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var _29=_1.getTarget(e);return (this.isValidHandleChild(_29)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_29,this.id)));},addInvalidHandleType:function(_30){var _31=_30.toUpperCase();this.invalidHandleTypes[_31]=_31;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_32){this.invalidHandleClasses.push(_32);},removeInvalidHandleType:function(_33){var _34=_33.toUpperCase();delete this.invalidHandleTypes[_34];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_35){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_35){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_37){var _38=true;var _39;try{_39=_37.nodeName.toUpperCase();}catch(e){_39=_37.nodeName;}_38=_38&&!this.invalidHandleTypes[_39];_38=_38&&!this.invalidHandleIds[_37.id];for(var i=0,len=this.invalidHandleClasses.length;_38&&i<len;++i){_38=!_2.hasClass(_37,this.invalidHandleClasses[i]);}return _38;},setXTicks:function(_40,_41){this.xTicks=[];this.xTickSize=_41;var _42={};for(var i=this.initPageX;i>=this.minX;i=i-_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_43,_44){this.yTicks=[];this.yTickSize=_44;var _45={};for(var i=this.initPageY;i>=this.minY;i=i-_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_46,_47,_48){this.leftConstraint=_46;this.rightConstraint=_47;this.minX=this.initPageX-_46;this.maxX=this.initPageX+_47;if(_48){this.setXTicks(this.initPageX,_48);}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,_50,_51){this.topConstraint=iUp;this.bottomConstraint=_50;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_50;if(_51){this.setYTicks(this.initPageY,_51);}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,_53){if(!_53){return val;}else{if(_53[0]>=val){return _53[0];}else{for(var i=0,len=_53.length;i<len;++i){var _54=i+1;if(_53[_54]&&_53[_54]>=val){var _55=val-_53[i];var _56=_53[_54]-val;return (_56>_55)?_53[i]:_53[_54];}}return _53[_53.length-1];}}},toString:function(){return ("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var _57=YAHOO.util.Event;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_58,_59){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[_58].apply(oDD,_59);}}},_onLoad:function(){this.init();_57.on(document,"mouseup",this.handleMouseUp,this,true);_57.on(document,"mousemove",this.handleMouseMove,this,true);_57.on(window,"unload",this._onUnload,this,true);_57.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,_61){if(!this.initialized){this.init();}if(!this.ids[_61]){this.ids[_61]={};}this.ids[_61][oDD.id]=oDD;},removeDDFromGroup:function(oDD,_62){if(!this.ids[_62]){this.ids[_62]={};}var obj=this.ids[_62];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(_65,_66){if(!this.handleIds[_65]){this.handleIds[_65]={};}this.handleIds[_65][_66]=_66;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(_67,_68){var _69=[];for(var i in _67.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_68||dd.isTarget){_69[_69.length]=dd;}}}return _69;},isLegalTarget:function(oDD,_71){var _72=this.getRelated(oDD,true);for(var i=0,len=_72.length;i<len;++i){if(_72[i].id==_71.id){return true;}}return false;},isTypeOfDD:function(oDD){return (oDD&&oDD.__ygDragDrop);},isHandle:function(_73,_74){return (this.handleIds[_73]&&this.handleIds[_73][_74]);},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);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}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){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _76=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _77=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_76>this.clickPixelThresh||_77>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;},fireEvents:function(e,_78){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 _80=[];var _81=[];var _82=[];var _83=[];var _84=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_81.push(ddo);}_80[i]=true;delete this.dragOvers[i];}for(var _86 in dc.groups){if("string"!=typeof _86){continue;}for(i in this.ids[_86]){var oDD=this.ids[_86][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_78){_83.push(oDD);}else{if(!_80[oDD.id]){_84.push(oDD);}else{_82.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_81.length){dc.b4DragOut(e,_81);dc.onDragOut(e,_81);}if(_84.length){dc.onDragEnter(e,_84);}if(_82.length){dc.b4DragOver(e,_82);dc.onDragOver(e,_82);}if(_83.length){dc.b4DragDrop(e,_83);dc.onDragDrop(e,_83);}}else{var len=0;for(i=0,len=_81.length;i<len;++i){dc.b4DragOut(e,_81[i].id);dc.onDragOut(e,_81[i].id);}for(i=0,len=_84.length;i<len;++i){dc.onDragEnter(e,_84[i].id);}for(i=0,len=_82.length;i<len;++i){dc.b4DragOver(e,_82[i].id);dc.onDragOver(e,_82[i].id);}for(i=0,len=_83.length;i<len;++i){dc.b4DragDrop(e,_83[i].id);dc.onDragDrop(e,_83[i].id);}}if(_78&&!_83.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var _89=null;var len=dds.length;if(len==1){_89=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_89=dd;break;}else{if(!_89||_89.overlap.getArea()<dd.overlap.getArea()){_89=dd;}}}}return _89;},refreshCache:function(_90){for(var _91 in _90){if("string"!=typeof _91){continue;}for(var i in this.ids[_91]){var oDD=this.ids[_91][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 _93=el.offsetParent;if(_93){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,_94,_95){var loc=this.locationCache[_94.id];if(!loc||!this.useCache){loc=this.getLocation(_94);this.locationCache[_94.id]=loc;}if(!loc){return false;}_94.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_95&&!dc.constrainX&&!dc.constrainY)){return _94.cursorIsOver;}_94.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _96=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _97=_96.intersect(loc);if(_97){_94.overlap=_97;return (_95)?true:_94.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 _99=this.elementCache[id];if(!_99||!_99.el){_99=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}return _99;},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{YAHOO.log("could not get scroll property");}}return {top:t,left:l};},getStyle:function(el,_104){return YAHOO.util.Dom.getStyle(el,_104);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(_105,_106){var _107=YAHOO.util.Dom.getXY(_106);YAHOO.util.Dom.setXY(_105,_107);},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();}YAHOO.util.DD=function(id,_111,_112){if(id){this.init(id,_111,_112);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(_113,_114){var x=_113-this.startPageX;var y=_114-this.startPageY;this.setDelta(x,y);},setDelta:function(_115,_116){this.deltaX=_115;this.deltaY=_116;},setDragElPos:function(_117,_118){var el=this.getDragEl();this.alignElWithMouse(el,_117,_118);},alignElWithMouse:function(el,_119,_120){var _121=this.getTargetCoord(_119,_120);if(!this.deltaSetXY){var _122=[_121.x,_121.y];YAHOO.util.Dom.setXY(el,_122);var _123=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var _124=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[_123-_121.x,_124-_121.y];}else{YAHOO.util.Dom.setStyle(el,"left",(_121.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(_121.y+this.deltaSetXY[1])+"px");}this.cachePosition(_121.x,_121.y);this.autoScroll(_121.x,_121.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(_125,_126){if(_125){this.lastPageX=_125;this.lastPageY=_126;}else{var _127=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_127[0];this.lastPageY=_127[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var _130=this.DDM.getClientHeight();var _131=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _135=w+x;var _136=(_130+st-y-this.deltaY);var _137=(_131+sl-x-this.deltaX);var _138=40;var _139=(document.all)?80:30;if(bot>_130&&_136<_138){window.scrollTo(sl,st+_139);}if(y<st&&st>0&&y-st<_138){window.scrollTo(sl,st-_139);}if(_135>_131&&_137<_138){window.scrollTo(sl+_139,st);}if(x<sl&&sl>0&&x-sl<_138){window.scrollTo(sl-_139,st);}}},getTargetCoord:function(_140,_141){var x=_140-this.deltaX;var y=_141-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};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){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,_142,_143){if(id){this.init(id,_142,_143);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();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;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(_147,_148){var el=this.getEl();var _149=this.getDragEl();var s=_149.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_147,_148);YAHOO.util.Dom.setStyle(_149,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var _151=this.getDragEl();var bt=parseInt(DOM.getStyle(_151,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(_151,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(_151,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(_151,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}if(isNaN(br)){br=0;}if(isNaN(bb)){bb=0;}if(isNaN(bl)){bl=0;}var _156=Math.max(0,el.offsetWidth-br-bl);var _157=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(_151,"width",_156+"px");DOM.setStyle(_151,"height",_157+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(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,_160,_161){if(id){this.initTarget(id,_160,_161);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return ("DDTarget "+this.id);}});
\ No newline at end of file
index 100de458428c6c5ea054aa9f3c2a55c8db1182af..43a0f61dc2806c63286c8585e262e5365f616e57 100755 (executable)
@@ -1,23 +1,28 @@
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+\r
+(function() {\r
+\r
+var Event=YAHOO.util.Event;\r
+var Dom=YAHOO.util.Dom;\r
 \r
 /**\r
- * Defines the interface and base operation of items that that can be \r
+ * Defines the interface and base operation of items that that can be\r
  * dragged or can be drop targets.  It was designed to be extended, overriding\r
  * the event handlers for startDrag, onDrag, onDragOver, onDragOut.\r
  * Up to three html elements can be associated with a DragDrop instance:\r
  * <ul>\r
  * <li>linked element: the element that is passed into the constructor.\r
- * This is the element which defines the boundaries for interaction with \r
+ * This is the element which defines the boundaries for interaction with\r
  * other DragDrop objects.</li>\r
- * <li>handle element(s): The drag operation only occurs if the element that \r
- * was clicked matches a handle element.  By default this is the linked \r
- * element, but there are times that you will want only a portion of the \r
- * linked element to initiate the drag operation, and the setHandleElId() \r
+ * <li>handle element(s): The drag operation only occurs if the element that\r
+ * was clicked matches a handle element.  By default this is the linked\r
+ * element, but there are times that you will want only a portion of the\r
+ * linked element to initiate the drag operation, and the setHandleElId()\r
  * method provides a way to define this.</li>\r
  * <li>drag element: this represents an the element that would be moved along\r
  * with the cursor during a drag operation.  By default, this is the linked\r
@@ -27,122 +32,129 @@ version: 0.11.0
  * </ul>\r
  * This class should not be instantiated until the onload event to ensure that\r
  * the associated elements are available.\r
- * The following would define a DragDrop obj that would interact with any \r
- * other DragDrop obj in the "group1" group:\r
+ * The following would define a DragDrop obj that would interact with any\r
+ * other DragDrop obj in the "group1" group:\r
  * <pre>\r
  *  dd = new YAHOO.util.DragDrop("div1", "group1");\r
  * </pre>\r
- * Since none of the event handlers have been implemented, nothing would \r
- * actually happen if you were to run the code above.  Normally you would \r
- * override this class or one of the default implementations, but you can \r
+ * Since none of the event handlers have been implemented, nothing would\r
+ * actually happen if you were to run the code above.  Normally you would\r
+ * override this class or one of the default implementations, but you can\r
  * also override the methods you want on an instance of the class...\r
  * <pre>\r
  *  dd.onDragDrop = function(e, id) {\r
- *   alert("dd was dropped on " + id);\r
+ *  &nbsp;&nbsp;alert("dd was dropped on " + id);\r
  *  }\r
  * </pre>\r
+ * @namespace YAHOO.util\r
+ * @class DragDrop\r
  * @constructor\r
  * @param {String} id of the element that is linked to this instance\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DragDrop: \r
+ *                Valid properties for DragDrop:\r
  *                    padding, isTarget, maintainOffset, primaryButtonOnly\r
  */\r
 YAHOO.util.DragDrop = function(id, sGroup, config) {\r
     if (id) {\r
-        this.init(id, sGroup, config); \r
+        this.init(id, sGroup, config);\r
     }\r
 };\r
 \r
 YAHOO.util.DragDrop.prototype = {\r
 \r
     /**\r
-     * The id of the element associated with this object.  This is what we \r
-     * refer to as the "linked element" because the size and position of \r
-     * this element is used to determine when the drag and drop objects have \r
+     * The id of the element associated with this object.  This is what we\r
+     * refer to as the "linked element" because the size and position of\r
+     * this element is used to determine when the drag and drop objects have\r
      * interacted.\r
-     *\r
+     * @property id\r
      * @type String\r
      */\r
     id: null,\r
 \r
     /**\r
      * Configuration attributes passed into the constructor\r
+     * @property config\r
      * @type object\r
      */\r
     config: null,\r
 \r
     /**\r
-     * The id of the element that will be dragged.  By default this is same \r
-     * as the linked element , but could be changed to another element. Ex: \r
+     * The id of the element that will be dragged.  By default this is same\r
+     * as the linked element , but could be changed to another element. Ex:\r
      * YAHOO.util.DDProxy\r
-     *\r
+     * @property dragElId\r
      * @type String\r
      * @private\r
      */\r
-    dragElId: null, \r
+    dragElId: null,\r
 \r
     /**\r
-     * the id of the element that initiates the drag operation.  By default \r
+     * the id of the element that initiates the drag operation.  By default\r
      * this is the linked element, but could be changed to be a child of this\r
-     * element.  This lets us do things like only starting the drag when the \r
+     * element.  This lets us do things like only starting the drag when the\r
      * header element within the linked html element is clicked.\r
-     *\r
+     * @property handleElId\r
      * @type String\r
      * @private\r
      */\r
-    handleElId: null, \r
+    handleElId: null,\r
 \r
     /**\r
      * An associative array of HTML tags that will be ignored if clicked.\r
+     * @property invalidHandleTypes\r
      * @type {string: string}\r
      */\r
-    invalidHandleTypes: null, \r
+    invalidHandleTypes: null,\r
 \r
     /**\r
      * An associative array of ids for elements that will be ignored if clicked\r
+     * @property invalidHandleIds\r
      * @type {string: string}\r
      */\r
-    invalidHandleIds: null, \r
+    invalidHandleIds: null,\r
 \r
     /**\r
      * An indexted array of css class names for elements that will be ignored\r
      * if clicked.\r
+     * @property invalidHandleClasses\r
      * @type string[]\r
      */\r
-    invalidHandleClasses: null, \r
+    invalidHandleClasses: null,\r
 \r
     /**\r
-     * The linked element's absolute X position at the time the drag was \r
+     * The linked element's absolute X position at the time the drag was\r
      * started\r
-     *\r
+     * @property startPageX\r
      * @type int\r
      * @private\r
      */\r
     startPageX: 0,\r
 \r
     /**\r
-     * The linked element's absolute X position at the time the drag was \r
+     * The linked element's absolute X position at the time the drag was\r
      * started\r
-     *\r
+     * @property startPageY\r
      * @type int\r
      * @private\r
      */\r
     startPageY: 0,\r
 \r
     /**\r
-     * The group defines a logical collection of DragDrop objects that are \r
-     * related.  Instances only get events when interacting with other \r
-     * DragDrop object in the same group.  This lets us define multiple \r
+     * The group defines a logical collection of DragDrop objects that are\r
+     * related.  Instances only get events when interacting with other\r
+     * DragDrop object in the same group.  This lets us define multiple\r
      * groups using a single DragDrop subclass if we want.\r
+     * @property groups\r
      * @type {string: string}\r
      */\r
     groups: null,\r
 \r
     /**\r
-     * Individual drag/drop instances can be locked.  This will prevent \r
+     * Individual drag/drop instances can be locked.  This will prevent\r
      * onmousedown start drag.\r
-     *\r
+     * @property locked\r
      * @type boolean\r
      * @private\r
      */\r
@@ -150,18 +162,20 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Lock this instance\r
+     * @method lock\r
      */\r
     lock: function() { this.locked = true; },\r
 \r
     /**\r
      * Unlock this instace\r
+     * @method unlock\r
      */\r
     unlock: function() { this.locked = false; },\r
 \r
     /**\r
      * By default, all insances can be a drop target.  This can be disabled by\r
      * setting isTarget to false.\r
-     *\r
+     * @method isTarget\r
      * @type boolean\r
      */\r
     isTarget: true,\r
@@ -169,24 +183,28 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * The padding configured for this drag and drop object for calculating\r
      * the drop zone intersection with this object.\r
+     * @method padding\r
      * @type int[]\r
      */\r
     padding: null,\r
 \r
     /**\r
+     * Cached reference to the linked element\r
+     * @property _domRef\r
      * @private\r
      */\r
     _domRef: null,\r
 \r
     /**\r
      * Internal typeof flag\r
+     * @property __ygDragDrop\r
      * @private\r
      */\r
     __ygDragDrop: true,\r
 \r
     /**\r
      * Set to true when horizontal contraints are applied\r
-     *\r
+     * @property constrainX\r
      * @type boolean\r
      * @private\r
      */\r
@@ -194,7 +212,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Set to true when vertical contraints are applied\r
-     *\r
+     * @property constrainY\r
      * @type boolean\r
      * @private\r
      */\r
@@ -202,7 +220,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * The left constraint\r
-     *\r
+     * @property minX\r
      * @type int\r
      * @private\r
      */\r
@@ -210,47 +228,53 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * The right constraint\r
-     *\r
+     * @property maxX\r
      * @type int\r
      * @private\r
      */\r
     maxX: 0,\r
 \r
     /**\r
-     * The up constraint \r
-     *\r
+     * The up constraint\r
+     * @property minY\r
+     * @type int\r
      * @type int\r
      * @private\r
      */\r
     minY: 0,\r
 \r
     /**\r
-     * The down constraint \r
-     *\r
+     * The down constraint\r
+     * @property maxY\r
      * @type int\r
      * @private\r
      */\r
     maxY: 0,\r
 \r
     /**\r
-     * Maintain offsets when we resetconstraints.  Used to maintain the \r
-     * slider thumb value, and this needs to be fixed.\r
+     * Maintain offsets when we resetconstraints.  Set to true when you want\r
+     * the position of the element relative to its parent to stay the same\r
+     * when the page changes\r
+     *\r
+     * @property maintainOffset\r
      * @type boolean\r
      */\r
     maintainOffset: false,\r
 \r
     /**\r
-     * Array of pixel locations the element will snap to if we specified a \r
+     * Array of pixel locations the element will snap to if we specified a\r
      * horizontal graduation/interval.  This array is generated automatically\r
      * when you define a tick interval.\r
+     * @property xTicks\r
      * @type int[]\r
      */\r
     xTicks: null,\r
 \r
     /**\r
-     * Array of pixel locations the element will snap to if we specified a \r
-     * vertical graduation/interval.  This array is generated automatically \r
+     * Array of pixel locations the element will snap to if we specified a\r
+     * vertical graduation/interval.  This array is generated automatically\r
      * when you define a tick interval.\r
+     * @property yTicks\r
      * @type int[]\r
      */\r
     yTicks: null,\r
@@ -260,18 +284,34 @@ YAHOO.util.DragDrop.prototype = {
      * button click (left button for a right-handed mouse).  Set to true to\r
      * allow drag and drop to start with any mouse click that is propogated\r
      * by the browser\r
+     * @property primaryButtonOnly\r
      * @type boolean\r
      */\r
     primaryButtonOnly: true,\r
 \r
     /**\r
      * The availabe property is false until the linked dom element is accessible.\r
+     * @property available\r
      * @type boolean\r
      */\r
     available: false,\r
 \r
+    /**\r
+     * By default, drags can only be initiated if the mousedown occurs in the\r
+     * region the linked element is.  This is done in part to work around a\r
+     * bug in some browsers that mis-report the mousedown if the previous\r
+     * mouseup happened outside of the window.  This property is set to true\r
+     * if outer handles are defined.\r
+     *\r
+     * @property hasOuterHandles\r
+     * @type boolean\r
+     * @default false\r
+     */\r
+    hasOuterHandles: false,\r
+\r
     /**\r
      * Code that executes immediately before the startDrag event\r
+     * @method b4StartDrag\r
      * @private\r
      */\r
     b4StartDrag: function(x, y) { },\r
@@ -279,7 +319,7 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Abstract method called after a drag/drop object is clicked\r
      * and the drag or mousedown time thresholds have beeen met.\r
-     *\r
+     * @method startDrag\r
      * @param {int} X click location\r
      * @param {int} Y click location\r
      */\r
@@ -287,133 +327,143 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Code that executes immediately before the onDrag event\r
+     * @method b4Drag\r
      * @private\r
      */\r
     b4Drag: function(e) { },\r
 \r
     /**\r
-     * Abstract method called during the onMouseMove event while dragging an \r
+     * Abstract method called during the onMouseMove event while dragging an\r
      * object.\r
-     *\r
-     * @param {Event} e\r
+     * @method onDrag\r
+     * @param {Event} e the mousemove event\r
      */\r
     onDrag: function(e) { /* override this */ },\r
 \r
     /**\r
-     * Code that executes immediately before the onDragEnter event\r
-     * @private\r
-     */\r
-    // b4DragEnter: function(e) { },\r
-\r
-    /**\r
-     * Abstract method called when this element fist begins hovering over \r
+     * Abstract method called when this element fist begins hovering over\r
      * another DragDrop obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this is hovering over.  In INTERSECT mode, an array of one or more \r
+     * @method onDragEnter\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this is hovering over.  In INTERSECT mode, an array of one or more\r
      * dragdrop items being hovered over.\r
      */\r
     onDragEnter: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragOver event\r
+     * @method b4DragOver\r
      * @private\r
      */\r
     b4DragOver: function(e) { },\r
 \r
     /**\r
-     * Abstract method called when this element is hovering over another \r
+     * Abstract method called when this element is hovering over another\r
      * DragDrop obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this is hovering over.  In INTERSECT mode, an array of dd items \r
+     * @method onDragOver\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this is hovering over.  In INTERSECT mode, an array of dd items\r
      * being hovered over.\r
      */\r
     onDragOver: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragOut event\r
+     * @method b4DragOut\r
      * @private\r
      */\r
     b4DragOut: function(e) { },\r
 \r
     /**\r
      * Abstract method called when we are no longer hovering over an element\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this was hovering over.  In INTERSECT mode, an array of dd items \r
+     * @method onDragOut\r
+     * @param {Event} e the mousemove event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this was hovering over.  In INTERSECT mode, an array of dd items\r
      * that the mouse is no longer over.\r
      */\r
     onDragOut: function(e, id) { /* override this */ },\r
 \r
     /**\r
      * Code that executes immediately before the onDragDrop event\r
+     * @method b4DragDrop\r
      * @private\r
      */\r
     b4DragDrop: function(e) { },\r
 \r
     /**\r
-     * Abstract method called when this item is dropped on another DragDrop \r
+     * Abstract method called when this item is dropped on another DragDrop\r
      * obj\r
-     *\r
-     * @param {Event} e\r
-     * @param {String || YAHOO.util.DragDrop[]} id In POINT mode, the element\r
-     * id this was dropped on.  In INTERSECT mode, an array of dd items this \r
+     * @method onDragDrop\r
+     * @param {Event} e the mouseup event\r
+     * @param {String|DragDrop[]} id In POINT mode, the element\r
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this\r
      * was dropped on.\r
      */\r
     onDragDrop: function(e, id) { /* override this */ },\r
 \r
+    /**\r
+     * Abstract method called when this item is dropped on an area with no\r
+     * drop target\r
+     * @method onInvalidDrop\r
+     * @param {Event} e the mouseup event\r
+     */\r
+    onInvalidDrop: function(e) { /* override this */ },\r
+\r
     /**\r
      * Code that executes immediately before the endDrag event\r
+     * @method b4EndDrag\r
      * @private\r
      */\r
     b4EndDrag: function(e) { },\r
 \r
     /**\r
      * Fired when we are done dragging the object\r
-     *\r
-     * @param {Event} e\r
+     * @method endDrag\r
+     * @param {Event} e the mouseup event\r
      */\r
     endDrag: function(e) { /* override this */ },\r
 \r
     /**\r
      * Code executed immediately before the onMouseDown event\r
-\r
-     * @param {Event} e\r
+     * @method b4MouseDown\r
+     * @param {Event} e the mousedown event\r
      * @private\r
      */\r
     b4MouseDown: function(e) {  },\r
 \r
     /**\r
      * Event handler that fires when a drag/drop obj gets a mousedown\r
-     * @param {Event} e\r
+     * @method onMouseDown\r
+     * @param {Event} e the mousedown event\r
      */\r
     onMouseDown: function(e) { /* override this */ },\r
 \r
     /**\r
      * Event handler that fires when a drag/drop obj gets a mouseup\r
-     * @param {Event} e\r
+     * @method onMouseUp\r
+     * @param {Event} e the mouseup event\r
      */\r
     onMouseUp: function(e) { /* override this */ },\r
-   \r
+\r
     /**\r
      * Override the onAvailable method to do what is needed after the initial\r
      * position was determined.\r
+     * @method onAvailable\r
      */\r
-    onAvailable: function () { \r
+    onAvailable: function () {\r
     },\r
 \r
     /**\r
      * Returns a reference to the linked element\r
-     *\r
-     * @return {HTMLElement} the html element \r
+     * @method getEl\r
+     * @return {HTMLElement} the html element\r
      */\r
-    getEl: function() { \r
+    getEl: function() {\r
         if (!this._domRef) {\r
-            this._domRef = YAHOO.util.Dom.get(this.id); \r
+            this._domRef = Dom.get(this.id);\r
         }\r
 \r
         return this._domRef;\r
@@ -421,40 +471,40 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Returns a reference to the actual element to drag.  By default this is\r
-     * the same as the html element, but it can be assigned to another \r
+     * the same as the html element, but it can be assigned to another\r
      * element. An example of this can be found in YAHOO.util.DDProxy\r
-     *\r
-     * @return {HTMLElement} the html element \r
+     * @method getDragEl\r
+     * @return {HTMLElement} the html element\r
      */\r
     getDragEl: function() {\r
-        return YAHOO.util.Dom.get(this.dragElId);\r
+        return Dom.get(this.dragElId);\r
     },\r
 \r
     /**\r
      * Sets up the DragDrop object.  Must be called in the constructor of any\r
      * YAHOO.util.DragDrop subclass\r
-     *\r
+     * @method init\r
      * @param id the id of the linked element\r
      * @param {String} sGroup the group of related items\r
      * @param {object} config configuration attributes\r
      */\r
     init: function(id, sGroup, config) {\r
         this.initTarget(id, sGroup, config);\r
-        YAHOO.util.Event.addListener(this.id, "mousedown", \r
-                                          this.handleMouseDown, this, true);\r
+        Event.on(this.id, "mousedown", this.handleMouseDown, this, true);\r
+        // Event.on(this.id, "selectstart", Event.preventDefault);\r
     },\r
 \r
     /**\r
      * Initializes Targeting functionality only... the object does not\r
      * get a mousedown handler.\r
-     *\r
+     * @method initTarget\r
      * @param id the id of the linked element\r
      * @param {String} sGroup the group of related items\r
      * @param {object} config configuration attributes\r
      */\r
     initTarget: function(id, sGroup, config) {\r
 \r
-        // configuration attributes \r
+        // configuration attributes\r
         this.config = config || {};\r
 \r
         // create a local reference to the drag and drop manager\r
@@ -462,6 +512,13 @@ YAHOO.util.DragDrop.prototype = {
         // initialize the groups array\r
         this.groups = {};\r
 \r
+        // assume that we have an element reference instead of an id if the\r
+        // parameter is not a string\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
+\r
         // set the id\r
         this.id = id;\r
 \r
@@ -472,13 +529,13 @@ YAHOO.util.DragDrop.prototype = {
         // so we just set the id rather than calling the setter.\r
         this.handleElId = id;\r
 \r
-        YAHOO.util.Event.onAvailable(id, this.handleOnAvailable, this, true);\r
+        Event.onAvailable(id, this.handleOnAvailable, this, true);\r
 \r
 \r
         // the linked element is the element that gets dragged by default\r
-        this.setDragElId(id); \r
+        this.setDragElId(id);\r
 \r
-        // by default, clicked anchors will not start drag operations. \r
+        // by default, clicked anchors will not start drag operations.\r
         // @TODO what else should be here?  Probably form fields.\r
         this.invalidHandleTypes = { A: "A" };\r
         this.invalidHandleIds = {};\r
@@ -490,13 +547,14 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Applies the configuration parameters that were passed into the constructor.\r
      * This is supposed to happen at each level through the inheritance chain.  So\r
-     * a DDProxy implentation will execute apply config on DDProxy, DD, and \r
+     * a DDProxy implentation will execute apply config on DDProxy, DD, and\r
      * DragDrop in order to get all of the parameters that are available in\r
      * each object.\r
+     * @method applyConfig\r
      */\r
     applyConfig: function() {\r
 \r
-        // configurable properties: \r
+        // configurable properties:\r
         //    padding, isTarget, maintainOffset, primaryButtonOnly\r
         this.padding           = this.config.padding || [0, 0, 0, 0];\r
         this.isTarget          = (this.config.isTarget !== false);\r
@@ -507,6 +565,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Executed when the linked element is available\r
+     * @method handleOnAvailable\r
      * @private\r
      */\r
     handleOnAvailable: function() {\r
@@ -517,10 +576,11 @@ YAHOO.util.DragDrop.prototype = {
 \r
      /**\r
      * Configures the padding for the target zone in px.  Effectively expands\r
-     * (or reduces) the virtual object size for targeting calculations.  \r
+     * (or reduces) the virtual object size for targeting calculations.\r
      * Supports css-style shorthand; if only one parameter is passed, all sides\r
      * will have that padding, and if only two are passed, the top and bottom\r
      * will have the first param, the left and right the second.\r
+     * @method setPadding\r
      * @param {int} iTop    Top pad\r
      * @param {int} iRight  Right pad\r
      * @param {int} iBot    Bot pad\r
@@ -538,7 +598,10 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Stores the initial placement of the dd element\r
+     * Stores the initial placement of the linked element.\r
+     * @method setInitialPosition\r
+     * @param {int} diffX   the X offset, default 0\r
+     * @param {int} diffY   the Y offset, default 0\r
      */\r
     setInitPosition: function(diffX, diffY) {\r
         var el = this.getEl();\r
@@ -550,7 +613,7 @@ YAHOO.util.DragDrop.prototype = {
         var dx = diffX || 0;\r
         var dy = diffY || 0;\r
 \r
-        var p = YAHOO.util.Dom.getXY( el );\r
+        var p = Dom.getXY( el );\r
 \r
         this.initPageX = p[0] - dx;\r
         this.initPageY = p[1] - dy;\r
@@ -559,29 +622,29 @@ YAHOO.util.DragDrop.prototype = {
         this.lastPageY = p[1];\r
 \r
 \r
-        this.deltaSetXY = null;\r
-\r
         this.setStartPosition(p);\r
     },\r
 \r
     /**\r
      * Sets the start position of the element.  This is set when the obj\r
      * is initialized, the reset when a drag is started.\r
+     * @method setStartPosition\r
      * @param pos current position (from previous lookup)\r
      * @private\r
      */\r
     setStartPosition: function(pos) {\r
-        var p = pos || YAHOO.util.Dom.getXY( this.getEl() );\r
+        var p = pos || Dom.getXY( this.getEl() );\r
+        this.deltaSetXY = null;\r
 \r
         this.startPageX = p[0];\r
         this.startPageY = p[1];\r
     },\r
 \r
     /**\r
-     * Add this instance to a group of related drag/drop objects.  All \r
-     * instances belong to at least one group, and can belong to as many \r
+     * Add this instance to a group of related drag/drop objects.  All\r
+     * instances belong to at least one group, and can belong to as many\r
      * groups as needed.\r
-     *\r
+     * @method addToGroup\r
      * @param sGroup {string} the name of the group\r
      */\r
     addToGroup: function(sGroup) {\r
@@ -591,6 +654,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Remove's this instance from the supplied interaction group\r
+     * @method removeFromGroup\r
      * @param {string}  sGroup  The group to drop\r
      */\r
     removeFromGroup: function(sGroup) {\r
@@ -602,45 +666,59 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Allows you to specify that an element other than the linked element \r
+     * Allows you to specify that an element other than the linked element\r
      * will be moved with the cursor during a drag\r
-     *\r
-     * @param id the id of the element that will be used to initiate the drag\r
+     * @method setDragElId\r
+     * @param id {string} the id of the element that will be used to initiate the drag\r
      */\r
     setDragElId: function(id) {\r
         this.dragElId = id;\r
     },\r
 \r
     /**\r
-     * Allows you to specify a child of the linked element that should be \r
-     * used to initiate the drag operation.  An example of this would be if \r
-     * you have a content div with text and links.  Clicking anywhere in the \r
+     * Allows you to specify a child of the linked element that should be\r
+     * used to initiate the drag operation.  An example of this would be if\r
+     * you have a content div with text and links.  Clicking anywhere in the\r
      * content area would normally start the drag operation.  Use this method\r
-     * to specify that an element inside of the content div is the element \r
+     * to specify that an element inside of the content div is the element\r
      * that starts the drag operation.\r
-     *\r
-     * @param id the id of the element that will be used to initiate the drag\r
+     * @method setHandleElId\r
+     * @param id {string} the id of the element that will be used to\r
+     * initiate the drag.\r
      */\r
     setHandleElId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         this.handleElId = id;\r
         this.DDM.regHandle(this.id, id);\r
     },\r
 \r
     /**\r
-     * Allows you to set an element outside of the linked element as a drag \r
+     * Allows you to set an element outside of the linked element as a drag\r
      * handle\r
+     * @method setOuterHandleElId\r
+     * @param id the id of the element that will be used to initiate the drag\r
      */\r
     setOuterHandleElId: function(id) {\r
-        YAHOO.util.Event.addListener(id, "mousedown", \r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
+        Event.on(id, "mousedown",\r
                 this.handleMouseDown, this, true);\r
         this.setHandleElId(id);\r
+\r
+        this.hasOuterHandles = true;\r
     },\r
 \r
     /**\r
      * Remove all drag and drop hooks for this element\r
+     * @method unreg\r
      */\r
     unreg: function() {\r
-        YAHOO.util.Event.removeListener(this.id, "mousedown", \r
+        Event.removeListener(this.id, "mousedown",\r
                 this.handleMouseDown);\r
         this._domRef = null;\r
         this.DDM._remove(this);\r
@@ -649,8 +727,8 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Returns true if this instance is locked, or the drag drop mgr is locked\r
      * (meaning that all drag/drop is disabled on the page.)\r
-     *\r
-     * @return {boolean} true if this obj or all drag/drop is locked, else \r
+     * @method isLocked\r
+     * @return {boolean} true if this obj or all drag/drop is locked, else\r
      * false\r
      */\r
     isLocked: function() {\r
@@ -659,16 +737,13 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Fired when this object is clicked\r
-     *\r
-     * @param {Event} e \r
+     * @method handleMouseDown\r
+     * @param {Event} e\r
      * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)\r
      * @private\r
      */\r
     handleMouseDown: function(e, oDD) {\r
 \r
-\r
-        var EU = YAHOO.util.Event;\r
-\r
         var button = e.which || e.button;\r
 \r
         if (this.primaryButtonOnly && button > 1) {\r
@@ -683,22 +758,16 @@ YAHOO.util.DragDrop.prototype = {
         // var self = this;\r
         // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);\r
 \r
-        // Only process the event if we really clicked within the linked \r
-        // element.  The reason we make this check is that in the case that \r
-        // another element was moved between the clicked element and the \r
-        // cursor in the time between the mousedown and mouseup events. When \r
-        // this happens, the element gets the next mousedown event \r
-        // regardless of where on the screen it happened.  \r
-        var pt = new YAHOO.util.Point(EU.getPageX(e), EU.getPageY(e));\r
-        if ( this.DDM.isOverTarget(pt, this) )  {\r
-\r
-\r
-            //  check to see if the handle was clicked\r
-            var srcEl = EU.getTarget(e);\r
-\r
-            if (this.isValidHandleChild(srcEl) &&\r
-                    (this.id == this.handleElId || \r
-                     this.DDM.handleWasClicked(srcEl, this.id)) ) {\r
+        // Only process the event if we really clicked within the linked\r
+        // element.  The reason we make this check is that in the case that\r
+        // another element was moved between the clicked element and the\r
+        // cursor in the time between the mousedown and mouseup events. When\r
+        // this happens, the element gets the next mousedown event\r
+        // regardless of where on the screen it happened.\r
+        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));\r
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {\r
+        } else {\r
+            if (this.clickValidator(e)) {\r
 \r
 \r
                 // set the initial element position\r
@@ -710,15 +779,25 @@ YAHOO.util.DragDrop.prototype = {
                 this.DDM.handleMouseDown(e, this);\r
 \r
                 this.DDM.stopEvent(e);\r
+            } else {\r
+\r
+\r
             }\r
         }\r
     },\r
 \r
+    clickValidator: function(e) {\r
+        var target = Event.getTarget(e);\r
+        return ( this.isValidHandleChild(target) &&\r
+                    (this.id == this.handleElId ||\r
+                        this.DDM.handleWasClicked(target, this.id)) );\r
+    },\r
+\r
     /**\r
      * Allows you to specify a tag name that should not start a drag operation\r
      * when clicked.  This is designed to facilitate embedding links within a\r
      * drag handle that do something other than start the drag.\r
-     * \r
+     * @method addInvalidHandleType\r
      * @param {string} tagName the type of element to exclude\r
      */\r
     addInvalidHandleType: function(tagName) {\r
@@ -729,14 +808,20 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Lets you to specify an element id for a child of a drag handle\r
      * that should not initiate a drag\r
+     * @method addInvalidHandleId\r
      * @param {string} id the element id of the element you wish to ignore\r
      */\r
     addInvalidHandleId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         this.invalidHandleIds[id] = id;\r
     },\r
 \r
     /**\r
      * Lets you specify a css class of elements that will not initiate a drag\r
+     * @method addInvalidHandleClass\r
      * @param {string} cssClass the class of the elements you wish to ignore\r
      */\r
     addInvalidHandleClass: function(cssClass) {\r
@@ -745,7 +830,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Unsets an excluded tag name set by addInvalidHandleType\r
-     * \r
+     * @method removeInvalidHandleType\r
      * @param {string} tagName the type of element to unexclude\r
      */\r
     removeInvalidHandleType: function(tagName) {\r
@@ -753,18 +838,25 @@ YAHOO.util.DragDrop.prototype = {
         // this.invalidHandleTypes[type] = null;\r
         delete this.invalidHandleTypes[type];\r
     },\r
-    \r
+\r
     /**\r
      * Unsets an invalid handle id\r
-     * @param {string} the id of the element to re-enable\r
+     * @method removeInvalidHandleId\r
+     * @param {string} id the id of the element to re-enable\r
      */\r
     removeInvalidHandleId: function(id) {\r
+        if (typeof id !== "string") {\r
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
+            id = Dom.generateId(id);\r
+        }\r
         delete this.invalidHandleIds[id];\r
     },\r
 \r
     /**\r
      * Unsets an invalid css class\r
-     * @param {string} the class of the element(s) you wish to re-enable\r
+     * @method removeInvalidHandleClass\r
+     * @param {string} cssClass the class of the element(s) you wish to\r
+     * re-enable\r
      */\r
     removeInvalidHandleClass: function(cssClass) {\r
         for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {\r
@@ -776,8 +868,8 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Checks the tag exclusion list to see if this click should be ignored\r
-     *\r
-     * @param {ygNode} node\r
+     * @method isValidHandleChild\r
+     * @param {HTMLElement} node the HTMLElement to evaluate\r
      * @return {boolean} true if this is a valid tag type, false if not\r
      */\r
     isValidHandleChild: function(node) {\r
@@ -794,7 +886,7 @@ YAHOO.util.DragDrop.prototype = {
         valid = valid && !this.invalidHandleIds[node.id];\r
 \r
         for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {\r
-            valid = !YAHOO.util.Dom.hasClass(node, this.invalidHandleClasses[i]);\r
+            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);\r
         }\r
 \r
 \r
@@ -805,13 +897,13 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Create the array of horizontal tick marks if an interval was specified\r
      * in setXConstraint().\r
-     *\r
+     * @method setXTicks\r
      * @private\r
      */\r
     setXTicks: function(iStartX, iTickSize) {\r
         this.xTicks = [];\r
         this.xTickSize = iTickSize;\r
-        \r
+\r
         var tickMap = {};\r
 \r
         for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {\r
@@ -832,9 +924,9 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * Create the array of vertical tick marks if an interval was specified in \r
+     * Create the array of vertical tick marks if an interval was specified in\r
      * setYConstraint().\r
-     *\r
+     * @method setYTicks\r
      * @private\r
      */\r
     setYTicks: function(iStartY, iTickSize) {\r
@@ -861,14 +953,14 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * By default, the element can be dragged any place on the screen.  Use \r
-     * this method to limit the horizontal travel of the element.  Pass in \r
+     * By default, the element can be dragged any place on the screen.  Use\r
+     * this method to limit the horizontal travel of the element.  Pass in\r
      * 0,0 for the parameters if you want to lock the drag to the y axis.\r
-     *\r
+     * @method setXConstraint\r
      * @param {int} iLeft the number of pixels the element can move to the left\r
-     * @param {int} iRight the number of pixels the element can move to the \r
+     * @param {int} iRight the number of pixels the element can move to the\r
      * right\r
-     * @param {int} iTickSize optional parameter for specifying that the \r
+     * @param {int} iTickSize optional parameter for specifying that the\r
      * element\r
      * should move iTickSize pixels at a time.\r
      */\r
@@ -886,6 +978,7 @@ YAHOO.util.DragDrop.prototype = {
     /**\r
      * Clears any constraints applied to this instance.  Also clears ticks\r
      * since they can't exist independent of a constraint at this time.\r
+     * @method clearConstraints\r
      */\r
     clearConstraints: function() {\r
         this.constrainX = false;\r
@@ -895,6 +988,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * Clears any tick interval defined for this instance\r
+     * @method clearTicks\r
      */\r
     clearTicks: function() {\r
         this.xTicks = null;\r
@@ -904,13 +998,13 @@ YAHOO.util.DragDrop.prototype = {
     },\r
 \r
     /**\r
-     * By default, the element can be dragged any place on the screen.  Set \r
+     * By default, the element can be dragged any place on the screen.  Set\r
      * this to limit the vertical travel of the element.  Pass in 0,0 for the\r
      * parameters if you want to lock the drag to the x axis.\r
-     *\r
+     * @method setYConstraint\r
      * @param {int} iUp the number of pixels the element can move up\r
      * @param {int} iDown the number of pixels the element can move down\r
-     * @param {int} iTickSize optional parameter for specifying that the \r
+     * @param {int} iTickSize optional parameter for specifying that the\r
      * element should move iTickSize pixels at a time.\r
      */\r
     setYConstraint: function(iUp, iDown, iTickSize) {\r
@@ -922,11 +1016,12 @@ YAHOO.util.DragDrop.prototype = {
         if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }\r
 \r
         this.constrainY = true;\r
-        \r
+\r
     },\r
 \r
     /**\r
      * resetConstraints must be called if you manually reposition a dd element.\r
+     * @method resetConstraints\r
      * @param {boolean} maintainOffset\r
      */\r
     resetConstraints: function() {\r
@@ -946,23 +1041,23 @@ YAHOO.util.DragDrop.prototype = {
         }\r
 \r
         if (this.constrainX) {\r
-            this.setXConstraint( this.leftConstraint, \r
-                                 this.rightConstraint, \r
+            this.setXConstraint( this.leftConstraint,\r
+                                 this.rightConstraint,\r
                                  this.xTickSize        );\r
         }\r
 \r
         if (this.constrainY) {\r
-            this.setYConstraint( this.topConstraint, \r
-                                 this.bottomConstraint, \r
+            this.setYConstraint( this.topConstraint,\r
+                                 this.bottomConstraint,\r
                                  this.yTickSize         );\r
         }\r
     },\r
 \r
     /**\r
-     * Normally the drag element is moved pixel by pixel, but we can specify \r
-     * that it move a number of pixels at a time.  This method resolves the \r
+     * Normally the drag element is moved pixel by pixel, but we can specify\r
+     * that it move a number of pixels at a time.  This method resolves the\r
      * location when we have it set up like this.\r
-     *\r
+     * @method getTick\r
      * @param {int} val where we want to place the object\r
      * @param {int[]} tickArray sorted array of valid points\r
      * @return {int} the closest tick\r
@@ -971,9 +1066,9 @@ YAHOO.util.DragDrop.prototype = {
     getTick: function(val, tickArray) {\r
 \r
         if (!tickArray) {\r
-            // If tick interval is not defined, it is effectively 1 pixel, \r
+            // If tick interval is not defined, it is effectively 1 pixel,\r
             // so we return the value passed to us.\r
-            return val; \r
+            return val;\r
         } else if (tickArray[0] >= val) {\r
             // The value is lower than the first tick, so we return the first\r
             // tick.\r
@@ -996,6 +1091,7 @@ YAHOO.util.DragDrop.prototype = {
 \r
     /**\r
      * toString method\r
+     * @method toString\r
      * @return {string} string representation of the dd obj\r
      */\r
     toString: function() {\r
@@ -1004,142 +1100,176 @@ YAHOO.util.DragDrop.prototype = {
 \r
 };\r
 \r
-// Only load the library once.  Rewriting the manager class would orphan \r
+})();\r
+/**\r
+ * The drag and drop utility provides a framework for building drag and drop\r
+ * applications.  In addition to enabling drag and drop for specific elements,\r
+ * the drag and drop elements are tracked by the manager class, and the\r
+ * interactions between the various elements are tracked during the drag and\r
+ * the implementing code is notified about these important moments.\r
+ * @module dragdrop\r
+ * @title Drag and Drop\r
+ * @requires yahoo,dom,event\r
+ * @namespace YAHOO.util\r
+ */\r
+\r
+// Only load the library once.  Rewriting the manager class would orphan\r
 // existing drag and drop instances.\r
 if (!YAHOO.util.DragDropMgr) {\r
 \r
-    /**\r
-     * Handles the element interaction for all DragDrop items in the \r
-     * window.  Generally, you will not call this class directly, but it does\r
-     * have helper methods that could be useful in your DragDrop \r
-     * implementations.  This class should not be instantiated; all methods \r
-     * are are static.\r
-     *\r
-     * @constructor\r
-     */\r
-    YAHOO.util.DragDropMgr = new function() {\r
+/**\r
+ * DragDropMgr is a singleton that tracks the element interaction for\r
+ * all DragDrop items in the window.  Generally, you will not call\r
+ * this class directly, but it does have helper methods that could\r
+ * be useful in your DragDrop implementations.\r
+ * @class DragDropMgr\r
+ * @static\r
+ */\r
+YAHOO.util.DragDropMgr = function() {\r
+\r
+    var Event = YAHOO.util.Event;\r
+\r
+    return {\r
 \r
         /**\r
-         * Two dimensional Array of registered DragDrop objects.  The first \r
-         * dimension is the DragDrop item group, the second the DragDrop \r
+         * Two dimensional Array of registered DragDrop objects.  The first\r
+         * dimension is the DragDrop item group, the second the DragDrop\r
          * object.\r
-         *\r
+         * @property ids\r
          * @type {string: string}\r
          * @private\r
+         * @static\r
          */\r
-        this.ids = {};\r
+        ids: {},\r
 \r
         /**\r
-         * Array of element ids defined as drag handles.  Used to determine \r
-         * if the element that generated the mousedown event is actually the \r
+         * Array of element ids defined as drag handles.  Used to determine\r
+         * if the element that generated the mousedown event is actually the\r
          * handle and not the html element itself.\r
-         *\r
+         * @property handleIds\r
          * @type {string: string}\r
          * @private\r
+         * @static\r
          */\r
-        this.handleIds = {};\r
+        handleIds: {},\r
 \r
         /**\r
          * the DragDrop object that is currently being dragged\r
-         *\r
+         * @property dragCurrent\r
          * @type DragDrop\r
          * @private\r
+         * @static\r
          **/\r
-        this.dragCurrent = null;\r
+        dragCurrent: null,\r
 \r
         /**\r
          * the DragDrop object(s) that are being hovered over\r
-         *\r
+         * @property dragOvers\r
          * @type Array\r
          * @private\r
+         * @static\r
          */\r
-        this.dragOvers = {};\r
-\r
-        /**\r
-         * @private\r
-         */\r
+        dragOvers: {},\r
 \r
         /**\r
          * the X distance between the cursor and the object being dragged\r
-         *\r
+         * @property deltaX\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.deltaX = 0;\r
+        deltaX: 0,\r
 \r
         /**\r
          * the Y distance between the cursor and the object being dragged\r
-         *\r
+         * @property deltaY\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.deltaY = 0;\r
+        deltaY: 0,\r
 \r
         /**\r
          * Flag to determine if we should prevent the default behavior of the\r
-         * events we define. By default this is true, but this can be set to \r
+         * events we define. By default this is true, but this can be set to\r
          * false if you need the default behavior (not recommended)\r
-         *\r
+         * @property preventDefault\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.preventDefault = true;\r
+        preventDefault: true,\r
 \r
         /**\r
-         * Flag to determine if we should stop the propagation of the events \r
+         * Flag to determine if we should stop the propagation of the events\r
          * we generate. This is true by default but you may want to set it to\r
          * false if the html element contains other features that require the\r
          * mouse click.\r
-         *\r
+         * @property stopPropagation\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.stopPropagation = true;\r
+        stopPropagation: true,\r
 \r
         /**\r
+         * Internal flag that is set to true when drag and drop has been\r
+         * intialized\r
+         * @property initialized\r
          * @private\r
+         * @static\r
          */\r
-        this.initalized = false;\r
+        initalized: false,\r
 \r
         /**\r
          * All drag and drop can be disabled.\r
-         *\r
+         * @property locked\r
          * @private\r
+         * @static\r
          */\r
-        this.locked = false;\r
-        \r
+        locked: false,\r
+\r
         /**\r
          * Called the first time an element is registered.\r
-         *\r
+         * @method init\r
          * @private\r
+         * @static\r
          */\r
-        this.init = function() {\r
+        init: function() {\r
             this.initialized = true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * In point mode, drag and drop interaction is defined by the \r
+         * In point mode, drag and drop interaction is defined by the\r
          * location of the cursor during the drag/drop\r
+         * @property POINT\r
          * @type int\r
+         * @static\r
          */\r
-        this.POINT     = 0;\r
+        POINT: 0,\r
 \r
         /**\r
-         * In intersect mode, drag and drop interactio nis defined by the \r
+         * In intersect mode, drag and drop interactio nis defined by the\r
          * overlap of two or more drag and drop objects.\r
+         * @property INTERSECT\r
          * @type int\r
+         * @static\r
          */\r
-        this.INTERSECT = 1;\r
+        INTERSECT: 1,\r
 \r
         /**\r
-         * The current drag and drop mode.  Default it point mode\r
+         * The current drag and drop mode.  Default: POINT\r
+         * @property mode\r
          * @type int\r
+         * @static\r
          */\r
-        this.mode = this.POINT;\r
+        mode: 0,\r
 \r
         /**\r
          * Runs method on all drag and drop objects\r
+         * @method _execOnAll\r
          * @private\r
+         * @static\r
          */\r
-        this._execOnAll = function(sMethod, args) {\r
+        _execOnAll: function(sMethod, args) {\r
             for (var i in this.ids) {\r
                 for (var j in this.ids[i]) {\r
                     var oDD = this.ids[i][j];\r
@@ -1149,134 +1279,159 @@ if (!YAHOO.util.DragDropMgr) {
                     oDD[sMethod].apply(oDD, args);\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
          * Drag and drop initialization.  Sets up the global event handlers\r
+         * @method _onLoad\r
          * @private\r
+         * @static\r
          */\r
-        this._onLoad = function() {\r
+        _onLoad: function() {\r
 \r
             this.init();\r
 \r
 \r
-            var EU = YAHOO.util.Event;\r
-\r
-            EU.on(document, "mouseup",   this.handleMouseUp, this, true);\r
-            EU.on(document, "mousemove", this.handleMouseMove, this, true);\r
-            EU.on(window,   "unload",    this._onUnload, this, true);\r
-            EU.on(window,   "resize",    this._onResize, this, true);\r
-            // EU.on(window,   "mouseout",    this._test);\r
+            Event.on(document, "mouseup",   this.handleMouseUp, this, true);\r
+            Event.on(document, "mousemove", this.handleMouseMove, this, true);\r
+            Event.on(window,   "unload",    this._onUnload, this, true);\r
+            Event.on(window,   "resize",    this._onResize, this, true);\r
+            // Event.on(window,   "mouseout",    this._test);\r
 \r
-        };\r
+        },\r
 \r
         /**\r
          * Reset constraints on all drag and drop objs\r
+         * @method _onResize\r
          * @private\r
+         * @static\r
          */\r
-        this._onResize = function(e) {\r
+        _onResize: function(e) {\r
             this._execOnAll("resetConstraints", []);\r
-        };\r
+        },\r
 \r
         /**\r
          * Lock all drag and drop functionality\r
+         * @method lock\r
+         * @static\r
          */\r
-        this.lock = function() { this.locked = true; };\r
+        lock: function() { this.locked = true; },\r
 \r
         /**\r
          * Unlock all drag and drop functionality\r
+         * @method unlock\r
+         * @static\r
          */\r
-        this.unlock = function() { this.locked = false; };\r
+        unlock: function() { this.locked = false; },\r
 \r
         /**\r
          * Is drag and drop locked?\r
-         *\r
+         * @method isLocked\r
          * @return {boolean} True if drag and drop is locked, false otherwise.\r
+         * @static\r
          */\r
-        this.isLocked = function() { return this.locked; };\r
+        isLocked: function() { return this.locked; },\r
 \r
         /**\r
          * Location cache that is set for all drag drop objects when a drag is\r
          * initiated, cleared when the drag is finished.\r
-         *\r
+         * @property locationCache\r
          * @private\r
+         * @static\r
          */\r
-        this.locationCache = {};\r
+        locationCache: {},\r
 \r
         /**\r
          * Set useCache to false if you want to force object the lookup of each\r
          * drag and drop linked element constantly during a drag.\r
+         * @property useCache\r
          * @type boolean\r
+         * @static\r
          */\r
-        this.useCache = true;\r
+        useCache: true,\r
 \r
         /**\r
-         * The number of pixels that the mouse needs to move after the \r
+         * The number of pixels that the mouse needs to move after the\r
          * mousedown before the drag is initiated.  Default=3;\r
+         * @property clickPixelThresh\r
          * @type int\r
+         * @static\r
          */\r
-        this.clickPixelThresh = 3;\r
+        clickPixelThresh: 3,\r
 \r
         /**\r
          * The number of milliseconds after the mousedown event to initiate the\r
          * drag if we don't get a mouseup event. Default=1000\r
+         * @property clickTimeThresh\r
          * @type int\r
+         * @static\r
          */\r
-        this.clickTimeThresh = 1000;\r
+        clickTimeThresh: 1000,\r
 \r
         /**\r
-         * Flag that indicates that either the drag pixel threshold or the \r
+         * Flag that indicates that either the drag pixel threshold or the\r
          * mousdown time threshold has been met\r
+         * @property dragThreshMet\r
          * @type boolean\r
          * @private\r
+         * @static\r
          */\r
-        this.dragThreshMet = false;\r
+        dragThreshMet: false,\r
 \r
         /**\r
          * Timeout used for the click time threshold\r
+         * @property clickTimeout\r
          * @type Object\r
          * @private\r
+         * @static\r
          */\r
-        this.clickTimeout = null;\r
+        clickTimeout: null,\r
 \r
         /**\r
-         * The X position of the mousedown event stored for later use when a \r
+         * The X position of the mousedown event stored for later use when a\r
          * drag threshold is met.\r
+         * @property startX\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.startX = 0;\r
+        startX: 0,\r
 \r
         /**\r
-         * The Y position of the mousedown event stored for later use when a \r
+         * The Y position of the mousedown event stored for later use when a\r
          * drag threshold is met.\r
+         * @property startY\r
          * @type int\r
          * @private\r
+         * @static\r
          */\r
-        this.startY = 0;\r
+        startY: 0,\r
 \r
         /**\r
-         * Each DragDrop instance must be registered with the DragDropMgr.  \r
+         * Each DragDrop instance must be registered with the DragDropMgr.\r
          * This is executed in DragDrop.init()\r
-         *\r
+         * @method regDragDrop\r
          * @param {DragDrop} oDD the DragDrop object to register\r
          * @param {String} sGroup the name of the group this element belongs to\r
+         * @static\r
          */\r
-        this.regDragDrop = function(oDD, sGroup) {\r
+        regDragDrop: function(oDD, sGroup) {\r
             if (!this.initialized) { this.init(); }\r
-            \r
+\r
             if (!this.ids[sGroup]) {\r
                 this.ids[sGroup] = {};\r
             }\r
             this.ids[sGroup][oDD.id] = oDD;\r
-        };\r
+        },\r
 \r
         /**\r
          * Removes the supplied dd instance from the supplied group. Executed\r
-         * by DragDrop.removeFromGroup.\r
+         * by DragDrop.removeFromGroup, so don't call this function directly.\r
+         * @method removeDDFromGroup\r
          * @private\r
+         * @static\r
          */\r
-        this.removeDDFromGroup = function(oDD, sGroup) {\r
+        removeDDFromGroup: function(oDD, sGroup) {\r
             if (!this.ids[sGroup]) {\r
                 this.ids[sGroup] = {};\r
             }\r
@@ -1285,58 +1440,63 @@ if (!YAHOO.util.DragDropMgr) {
             if (obj && obj[oDD.id]) {\r
                 delete obj[oDD.id];\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
-         * Unregisters a drag and drop item.  This is executed in \r
+         * Unregisters a drag and drop item.  This is executed in\r
          * DragDrop.unreg, use that method instead of calling this directly.\r
+         * @method _remove\r
          * @private\r
+         * @static\r
          */\r
-        this._remove = function(oDD) {\r
+        _remove: function(oDD) {\r
             for (var g in oDD.groups) {\r
                 if (g && this.ids[g][oDD.id]) {\r
                     delete this.ids[g][oDD.id];\r
                 }\r
             }\r
             delete this.handleIds[oDD.id];\r
-        };\r
+        },\r
 \r
         /**\r
          * Each DragDrop handle element must be registered.  This is done\r
          * automatically when executing DragDrop.setHandleElId()\r
-         *\r
+         * @method regHandle\r
          * @param {String} sDDId the DragDrop id this element is a handle for\r
-         * @param {String} sHandleId the id of the element that is the drag \r
+         * @param {String} sHandleId the id of the element that is the drag\r
          * handle\r
+         * @static\r
          */\r
-        this.regHandle = function(sDDId, sHandleId) {\r
+        regHandle: function(sDDId, sHandleId) {\r
             if (!this.handleIds[sDDId]) {\r
                 this.handleIds[sDDId] = {};\r
             }\r
             this.handleIds[sDDId][sHandleId] = sHandleId;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility function to determine if a given element has been \r
+         * Utility function to determine if a given element has been\r
          * registered as a drag drop item.\r
-         *\r
+         * @method isDragDrop\r
          * @param {String} id the element id to check\r
-         * @return {boolean} true if this element is a DragDrop item, \r
+         * @return {boolean} true if this element is a DragDrop item,\r
          * false otherwise\r
+         * @static\r
          */\r
-        this.isDragDrop = function(id) {\r
+        isDragDrop: function(id) {\r
             return ( this.getDDById(id) ) ? true : false;\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the drag and drop instances that are in all groups the\r
          * passed in instance belongs to.\r
-         *\r
+         * @method getRelated\r
          * @param {DragDrop} p_oDD the obj to get related data for\r
          * @param {boolean} bTargetsOnly if true, only return targetable objs\r
          * @return {DragDrop[]} the related instances\r
+         * @static\r
          */\r
-        this.getRelated = function(p_oDD, bTargetsOnly) {\r
+        getRelated: function(p_oDD, bTargetsOnly) {\r
             var oDDs = [];\r
             for (var i in p_oDD.groups) {\r
                 for (j in this.ids[i]) {\r
@@ -1351,18 +1511,19 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return oDDs;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Returns true if the specified dd target is a legal target for \r
+         * Returns true if the specified dd target is a legal target for\r
          * the specifice drag obj\r
-         *\r
+         * @method isLegalTarget\r
          * @param {DragDrop} the drag obj\r
-         * @param {DragDrop) the target\r
-         * @return {boolean} true if the target is a legal target for the \r
+         * @param {DragDrop} the target\r
+         * @return {boolean} true if the target is a legal target for the\r
          * dd obj\r
+         * @static\r
          */\r
-        this.isLegalTarget = function (oDD, oTargetDD) {\r
+        isLegalTarget: function (oDD, oTargetDD) {\r
             var targets = this.getRelated(oDD, true);\r
             for (var i=0, len=targets.length;i<len;++i) {\r
                 if (targets[i].id == oTargetDD.id) {\r
@@ -1371,59 +1532,63 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
+        },\r
 \r
         /**\r
          * My goal is to be able to transparently determine if an object is\r
-         * typeof DragDrop, and the exact subclass of DragDrop.  typeof \r
+         * typeof DragDrop, and the exact subclass of DragDrop.  typeof\r
          * returns "object", oDD.constructor.toString() always returns\r
          * "DragDrop" and not the name of the subclass.  So for now it just\r
          * evaluates a well-known variable in DragDrop.\r
-         *\r
+         * @method isTypeOfDD\r
          * @param {Object} the object to evaluate\r
          * @return {boolean} true if typeof oDD = DragDrop\r
+         * @static\r
          */\r
-        this.isTypeOfDD = function (oDD) {\r
+        isTypeOfDD: function (oDD) {\r
             return (oDD && oDD.__ygDragDrop);\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility function to determine if a given element has been \r
+         * Utility function to determine if a given element has been\r
          * registered as a drag drop handle for the given Drag Drop object.\r
-         *\r
+         * @method isHandle\r
          * @param {String} id the element id to check\r
-         * @return {boolean} true if this element is a DragDrop handle, false \r
+         * @return {boolean} true if this element is a DragDrop handle, false\r
          * otherwise\r
+         * @static\r
          */\r
-        this.isHandle = function(sDDId, sHandleId) {\r
-            return ( this.handleIds[sDDId] && \r
+        isHandle: function(sDDId, sHandleId) {\r
+            return ( this.handleIds[sDDId] &&\r
                             this.handleIds[sDDId][sHandleId] );\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the DragDrop instance for a given id\r
-         *\r
+         * @method getDDById\r
          * @param {String} id the id of the DragDrop object\r
          * @return {DragDrop} the drag drop object, null if it is not found\r
+         * @static\r
          */\r
-        this.getDDById = function(id) {\r
+        getDDById: function(id) {\r
             for (var i in this.ids) {\r
                 if (this.ids[i][id]) {\r
                     return this.ids[i][id];\r
                 }\r
             }\r
             return null;\r
-        };\r
+        },\r
 \r
         /**\r
          * Fired after a registered DragDrop object gets the mousedown event.\r
          * Sets up the events required to track the object being dragged\r
-         *\r
+         * @method handleMouseDown\r
          * @param {Event} e the event\r
          * @param oDD the DragDrop object being dragged\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseDown = function(e, oDD) {\r
+        handleMouseDown: function(e, oDD) {\r
 \r
             this.currentTarget = YAHOO.util.Event.getTarget(e);\r
 \r
@@ -1440,38 +1605,40 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.dragThreshMet = false;\r
 \r
-            this.clickTimeout = setTimeout( \r
-                    function() { \r
+            this.clickTimeout = setTimeout(\r
+                    function() {\r
                         var DDM = YAHOO.util.DDM;\r
-                        DDM.startDrag(DDM.startX, DDM.startY); \r
-                    }, \r
+                        DDM.startDrag(DDM.startX, DDM.startY);\r
+                    },\r
                     this.clickTimeThresh );\r
-        };\r
+        },\r
 \r
         /**\r
-         * Fired when either the drag pixel threshol or the mousedown hold \r
+         * Fired when either the drag pixel threshol or the mousedown hold\r
          * time threshold has been met.\r
-         * \r
+         * @method startDrag\r
          * @param x {int} the X position of the original mousedown\r
          * @param y {int} the Y position of the original mousedown\r
+         * @static\r
          */\r
-        this.startDrag = function(x, y) {\r
+        startDrag: function(x, y) {\r
             clearTimeout(this.clickTimeout);\r
             if (this.dragCurrent) {\r
                 this.dragCurrent.b4StartDrag(x, y);\r
                 this.dragCurrent.startDrag(x, y);\r
             }\r
             this.dragThreshMet = true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Internal function to handle the mouseup event.  Will be invoked \r
+         * Internal function to handle the mouseup event.  Will be invoked\r
          * from the context of the document.\r
-         *\r
+         * @method handleMouseUp\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseUp = function(e) {\r
+        handleMouseUp: function(e) {\r
 \r
             if (! this.dragCurrent) {\r
                 return;\r
@@ -1487,15 +1654,16 @@ if (!YAHOO.util.DragDropMgr) {
             this.stopDrag(e);\r
 \r
             this.stopEvent(e);\r
-        };\r
+        },\r
 \r
         /**\r
-         * Utility to stop event propagation and event default, if these \r
+         * Utility to stop event propagation and event default, if these\r
          * features are turned on.\r
-         *\r
+         * @method stopEvent\r
          * @param {Event} e the event as returned by this.getEvent()\r
+         * @static\r
          */\r
-        this.stopEvent = function(e) {\r
+        stopEvent: function(e) {\r
             if (this.stopPropagation) {\r
                 YAHOO.util.Event.stopPropagation(e);\r
             }\r
@@ -1503,16 +1671,17 @@ if (!YAHOO.util.DragDropMgr) {
             if (this.preventDefault) {\r
                 YAHOO.util.Event.preventDefault(e);\r
             }\r
-        };\r
+        },\r
 \r
-        /** \r
-         * Internal function to clean up event handlers after the drag \r
+        /**\r
+         * Internal function to clean up event handlers after the drag\r
          * operation is complete\r
-         *\r
+         * @method stopDrag\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.stopDrag = function(e) {\r
+        stopDrag: function(e) {\r
 \r
             // Fire the drag end event for the item that was dragged\r
             if (this.dragCurrent) {\r
@@ -1526,24 +1695,25 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.dragCurrent = null;\r
             this.dragOvers = {};\r
-        };\r
+        },\r
 \r
-        /** \r
-         * Internal function to handle the mousemove event.  Will be invoked \r
+        /**\r
+         * Internal function to handle the mousemove event.  Will be invoked\r
          * from the context of the html element.\r
          *\r
-         * @TODO figure out what we can do about mouse events lost when the \r
-         * user drags objects beyond the window boundary.  Currently we can \r
-         * detect this in internet explorer by verifying that the mouse is \r
-         * down during the mousemove event.  Firefox doesn't give us the \r
+         * @TODO figure out what we can do about mouse events lost when the\r
+         * user drags objects beyond the window boundary.  Currently we can\r
+         * detect this in internet explorer by verifying that the mouse is\r
+         * down during the mousemove event.  Firefox doesn't give us the\r
          * button state on the mousemove event.\r
-         *\r
+         * @method handleMouseMove\r
          * @param {Event} e the event\r
          * @private\r
+         * @static\r
          */\r
-        this.handleMouseMove = function(e) {\r
+        handleMouseMove: function(e) {\r
             if (! this.dragCurrent) {\r
-                return false;\r
+                return true;\r
             }\r
 \r
             // var button = e.which || e.button;\r
@@ -1557,7 +1727,7 @@ if (!YAHOO.util.DragDropMgr) {
             if (!this.dragThreshMet) {\r
                 var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));\r
                 var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));\r
-                if (diffX > this.clickPixelThresh || \r
+                if (diffX > this.clickPixelThresh ||\r
                             diffY > this.clickPixelThresh) {\r
                     this.startDrag(this.startX, this.startY);\r
                 }\r
@@ -1572,20 +1742,21 @@ if (!YAHOO.util.DragDropMgr) {
             this.stopEvent(e);\r
 \r
             return true;\r
-        };\r
+        },\r
 \r
         /**\r
-         * Iterates over all of the DragDrop elements to find ones we are \r
+         * Iterates over all of the DragDrop elements to find ones we are\r
          * hovering over or dropping on\r
-         *\r
+         * @method fireEvents\r
          * @param {Event} e the event\r
          * @param {boolean} isDrop is this a drop op or a mouseover op?\r
          * @private\r
+         * @static\r
          */\r
-        this.fireEvents = function(e, isDrop) {\r
+        fireEvents: function(e, isDrop) {\r
             var dc = this.dragCurrent;\r
 \r
-            // If the user did the mouse up outside of the window, we could \r
+            // If the user did the mouse up outside of the window, we could\r
             // get here even though we have ended the drag.\r
             if (!dc || dc.isLocked()) {\r
                 return;\r
@@ -1603,7 +1774,7 @@ if (!YAHOO.util.DragDropMgr) {
             var dropEvts  = [];\r
             var enterEvts = [];\r
 \r
-            // Check to see if the object(s) we were hovering over is no longer \r
+            // Check to see if the object(s) we were hovering over is no longer\r
             // being hovered over so we can fire the onDragOut event\r
             for (var i in this.dragOvers) {\r
 \r
@@ -1622,7 +1793,7 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             for (var sGroup in dc.groups) {\r
-                \r
+\r
                 if ("string" != typeof sGroup) {\r
                     continue;\r
                 }\r
@@ -1683,13 +1854,13 @@ if (!YAHOO.util.DragDropMgr) {
                     dc.b4DragOut(e, outEvts[i].id);\r
                     dc.onDragOut(e, outEvts[i].id);\r
                 }\r
-                 \r
+\r
                 // fire enter events\r
                 for (i=0,len=enterEvts.length; i<len; ++i) {\r
                     // dc.b4DragEnter(e, oDD.id);\r
                     dc.onDragEnter(e, enterEvts[i].id);\r
                 }\r
-         \r
+\r
                 // fire over events\r
                 for (i=0,len=overEvts.length; i<len; ++i) {\r
                     dc.b4DragOver(e, overEvts[i].id);\r
@@ -1704,20 +1875,26 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             }\r
 \r
-        };\r
+            // notify about a drop that did not find a target\r
+            if (isDrop && !dropEvts.length) {\r
+                dc.onInvalidDrop(e);\r
+            }\r
+\r
+        },\r
 \r
         /**\r
-         * Helper function for getting the best match from the list of drag \r
-         * and drop objects returned by the drag and drop events when we are \r
-         * in INTERSECT mode.  It returns either the first object that the \r
-         * cursor is over, or the object that has the greatest overlap with \r
+         * Helper function for getting the best match from the list of drag\r
+         * and drop objects returned by the drag and drop events when we are\r
+         * in INTERSECT mode.  It returns either the first object that the\r
+         * cursor is over, or the object that has the greatest overlap with\r
          * the dragged element.\r
-         *\r
-         * @param  {DragDrop[]} dds The array of drag and drop objects \r
+         * @method getBestMatch\r
+         * @param  {DragDrop[]} dds The array of drag and drop objects\r
          * targeted\r
          * @return {DragDrop}       The best single match\r
+         * @static\r
          */\r
-        this.getBestMatch = function(dds) {\r
+        getBestMatch: function(dds) {\r
             var winner = null;\r
             // Return null if the input is not what we expect\r
             //if (!dds || !dds.length || dds.length == 0) {\r
@@ -1733,7 +1910,7 @@ if (!YAHOO.util.DragDropMgr) {
                 // Loop through the targeted items\r
                 for (var i=0; i<len; ++i) {\r
                     var dd = dds[i];\r
-                    // If the cursor is over the object, it wins.  If the \r
+                    // If the cursor is over the object, it wins.  If the\r
                     // cursor is over multiple matches, the first one we come\r
                     // to wins.\r
                     if (dd.cursorIsOver) {\r
@@ -1741,7 +1918,7 @@ if (!YAHOO.util.DragDropMgr) {
                         break;\r
                     // Otherwise the object with the most overlap wins\r
                     } else {\r
-                        if (!winner || \r
+                        if (!winner ||\r
                             winner.overlap.getArea() < dd.overlap.getArea()) {\r
                             winner = dd;\r
                         }\r
@@ -1750,20 +1927,32 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return winner;\r
-        };\r
-\r
-        /**\r
-         * Refreshes the cache of the top-left and bottom-right points of the \r
-         * drag and drop objects in the specified groups\r
-         *\r
+        },\r
+\r
+        /**\r
+         * Refreshes the cache of the top-left and bottom-right points of the\r
+         * drag and drop objects in the specified group(s).  This is in the\r
+         * format that is stored in the drag and drop instance, so typical\r
+         * usage is:\r
+         * <code>\r
+         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);\r
+         * </code>\r
+         * Alternatively:\r
+         * <code>\r
+         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});\r
+         * </code>\r
+         * @TODO this really should be an indexed array.  Alternatively this\r
+         * method could accept both.\r
+         * @method refreshCache\r
          * @param {Object} groups an associative array of groups to refresh\r
+         * @static\r
          */\r
-        this.refreshCache = function(groups) {\r
-            for (sGroup in groups) {\r
+        refreshCache: function(groups) {\r
+            for (var sGroup in groups) {\r
                 if ("string" != typeof sGroup) {\r
                     continue;\r
                 }\r
-                for (i in this.ids[sGroup]) {\r
+                for (var i in this.ids[sGroup]) {\r
                     var oDD = this.ids[sGroup][i];\r
 \r
                     if (this.isTypeOfDD(oDD)) {\r
@@ -1780,17 +1969,19 @@ if (!YAHOO.util.DragDropMgr) {
                     }\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
          * This checks to make sure an element exists and is in the DOM.  The\r
          * main purpose is to handle cases where innerHTML is used to remove\r
          * drag and drop objects from the DOM.  IE provides an 'unspecified\r
          * error' when trying to access the offsetParent of such an element\r
+         * @method verifyEl\r
          * @param {HTMLElement} el the element to check\r
          * @return {boolean} true if the element looks usable\r
+         * @static\r
          */\r
-        this.verifyEl = function(el) {\r
+        verifyEl: function(el) {\r
             try {\r
                 if (el) {\r
                     var parent = el.offsetParent;\r
@@ -1802,65 +1993,57 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
-        \r
+        },\r
+\r
         /**\r
-         * Returns the an array containing the drag and drop element's position\r
-         * and size, including the DragDrop.padding configured for it\r
-         *\r
-         * @param {DragDrop} oDD the drag and drop object to get the \r
-         * location for\r
-         * @return array containing the top left and bottom right points of the \r
-         * element \r
+         * Returns a Region object containing the drag and drop element's position\r
+         * and size, including the padding configured for it\r
+         * @method getLocation\r
+         * @param {DragDrop} oDD the drag and drop object to get the\r
+         *                       location for\r
+         * @return {YAHOO.util.Region} a Region object representing the total area\r
+         *                             the element occupies, including any padding\r
+         *                             the instance is configured for.\r
+         * @static\r
          */\r
-        this.getLocation = function(oDD) {\r
+        getLocation: function(oDD) {\r
             if (! this.isTypeOfDD(oDD)) {\r
                 return null;\r
             }\r
 \r
-            var el = oDD.getEl();\r
-\r
-            // element will not have an offsetparent if it was removed from the\r
-            // document or display=none\r
-            // if (!this.verifyEl(el)) {\r
-                // return null;\r
-            // }\r
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;\r
 \r
-\r
-            // var aPos = ygPos.getPos(el);\r
-            var aPos = null;\r
             try {\r
-                aPos= YAHOO.util.Dom.getXY(el);\r
+                pos= YAHOO.util.Dom.getXY(el);\r
             } catch (e) { }\r
 \r
-            if (!aPos) {\r
+            if (!pos) {\r
                 return null;\r
             }\r
 \r
-            x1 = aPos[0];\r
+            x1 = pos[0];\r
             x2 = x1 + el.offsetWidth;\r
-\r
-            y1 = aPos[1];\r
+            y1 = pos[1];\r
             y2 = y1 + el.offsetHeight;\r
 \r
-            var t = y1 - oDD.padding[0];\r
-            var r = x2 + oDD.padding[1];\r
-            var b = y2 + oDD.padding[2];\r
-            var l = x1 - oDD.padding[3];\r
+            t = y1 - oDD.padding[0];\r
+            r = x2 + oDD.padding[1];\r
+            b = y2 + oDD.padding[2];\r
+            l = x1 - oDD.padding[3];\r
 \r
             return new YAHOO.util.Region( t, r, b, l );\r
-\r
-        };\r
+        },\r
 \r
         /**\r
          * Checks the cursor location to see if it over the target\r
-         * \r
+         * @method isOverTarget\r
          * @param {YAHOO.util.Point} pt The point to evaluate\r
          * @param {DragDrop} oTarget the DragDrop object we are inspecting\r
          * @return {boolean} true if the mouse is over the target\r
          * @private\r
+         * @static\r
          */\r
-        this.isOverTarget = function(pt, oTarget, intersect) {\r
+        isOverTarget: function(pt, oTarget, intersect) {\r
             // use cache if available\r
             var loc = this.locationCache[oTarget.id];\r
             if (!loc || !this.useCache) {\r
@@ -1877,11 +2060,12 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             // DragDrop is using this as a sanity check for the initial mousedown\r
             // in this case we are done.  In POINT mode, if the drag obj has no\r
-            // contraints, we are also done. Otherwise we need to evaluate the \r
+            // contraints, we are also done. Otherwise we need to evaluate the\r
             // location of the target as related to the actual location of the\r
             // dragged element.\r
             var dc = this.dragCurrent;\r
-            if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) {\r
+            if (!dc || !dc.getTargetCoord ||\r
+                    (!intersect && !dc.constrainX && !dc.constrainY)) {\r
                 return oTarget.cursorIsOver;\r
             }\r
 \r
@@ -1894,9 +2078,9 @@ if (!YAHOO.util.DragDropMgr) {
             var pos = dc.getTargetCoord(pt.x, pt.y);\r
 \r
             var el = dc.getDragEl();\r
-            var curRegion = new YAHOO.util.Region( pos.y, \r
+            var curRegion = new YAHOO.util.Region( pos.y,\r
                                                    pos.x + el.offsetWidth,\r
-                                                   pos.y + el.offsetHeight, \r
+                                                   pos.y + el.offsetHeight,\r
                                                    pos.x );\r
 \r
             var overlap = curRegion.intersect(loc);\r
@@ -1907,20 +2091,25 @@ if (!YAHOO.util.DragDropMgr) {
             } else {\r
                 return false;\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
+         * unload event handler\r
+         * @method _onUnload\r
          * @private\r
+         * @static\r
          */\r
-        this._onUnload = function(e, me) {\r
+        _onUnload: function(e, me) {\r
             this.unregAll();\r
-        };\r
+        },\r
 \r
         /**\r
          * Cleans up the drag and drop events and objects.\r
+         * @method unregAll\r
          * @private\r
+         * @static\r
          */\r
-        this.unregAll = function() {\r
+        unregAll: function() {\r
 \r
             if (this.dragCurrent) {\r
                 this.stopDrag();\r
@@ -1935,218 +2124,266 @@ if (!YAHOO.util.DragDropMgr) {
 \r
             this.elementCache = {};\r
             this.ids = {};\r
-        };\r
+        },\r
 \r
         /**\r
          * A cache of DOM elements\r
+         * @property elementCache\r
          * @private\r
+         * @static\r
          */\r
-        this.elementCache = {};\r
-        \r
+        elementCache: {},\r
+\r
         /**\r
          * Get the wrapper for the DOM element specified\r
-         *\r
-         * @param {String} id the id of the elment to get\r
+         * @method getElWrapper\r
+         * @param {String} id the id of the element to get\r
          * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element\r
          * @private\r
-         * @deprecated\r
+         * @deprecated This wrapper isn't that useful\r
+         * @static\r
          */\r
-        this.getElWrapper = function(id) {\r
+        getElWrapper: function(id) {\r
             var oWrapper = this.elementCache[id];\r
             if (!oWrapper || !oWrapper.el) {\r
-                oWrapper = this.elementCache[id] = \r
+                oWrapper = this.elementCache[id] =\r
                     new this.ElementWrapper(YAHOO.util.Dom.get(id));\r
             }\r
             return oWrapper;\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the actual DOM element\r
-         *\r
+         * @method getElement\r
          * @param {String} id the id of the elment to get\r
          * @return {Object} The element\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.get instead\r
+         * @static\r
          */\r
-        this.getElement = function(id) {\r
+        getElement: function(id) {\r
             return YAHOO.util.Dom.get(id);\r
-        };\r
-        \r
+        },\r
+\r
         /**\r
-         * Returns the style property for the DOM element (i.e., \r
+         * Returns the style property for the DOM element (i.e.,\r
          * document.getElById(id).style)\r
-         *\r
+         * @method getCss\r
          * @param {String} id the id of the elment to get\r
          * @return {Object} The style property of the element\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom instead\r
+         * @static\r
          */\r
-        this.getCss = function(id) {\r
+        getCss: function(id) {\r
             var el = YAHOO.util.Dom.get(id);\r
             return (el) ? el.style : null;\r
-        };\r
+        },\r
 \r
         /**\r
          * Inner class for cached elements\r
+         * @class DragDropMgr.ElementWrapper\r
+         * @for DragDropMgr\r
          * @private\r
          * @deprecated\r
          */\r
-        this.ElementWrapper = function(el) {\r
+        ElementWrapper: function(el) {\r
                 /**\r
-                 * @private\r
+                 * The element\r
+                 * @property el\r
                  */\r
                 this.el = el || null;\r
                 /**\r
-                 * @private\r
+                 * The element id\r
+                 * @property id\r
                  */\r
                 this.id = this.el && el.id;\r
                 /**\r
-                 * @private\r
+                 * A reference to the style property\r
+                 * @property css\r
                  */\r
                 this.css = this.el && el.style;\r
-            };\r
+            },\r
 \r
         /**\r
          * Returns the X position of an html element\r
+         * @method getPosX\r
          * @param el the element for which to get the position\r
          * @return {int} the X coordinate\r
-         * @deprecated\r
+         * @for DragDropMgr\r
+         * @deprecated use YAHOO.util.Dom.getX instead\r
+         * @static\r
          */\r
-        this.getPosX = function(el) {\r
+        getPosX: function(el) {\r
             return YAHOO.util.Dom.getX(el);\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the Y position of an html element\r
+         * @method getPosY\r
          * @param el the element for which to get the position\r
          * @return {int} the Y coordinate\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getY instead\r
+         * @static\r
          */\r
-        this.getPosY = function(el) {\r
-            return YAHOO.util.Dom.getY(el); \r
-        };\r
+        getPosY: function(el) {\r
+            return YAHOO.util.Dom.getY(el);\r
+        },\r
 \r
         /**\r
-         * Swap two nodes.  In IE, we use the native method, for others we \r
+         * Swap two nodes.  In IE, we use the native method, for others we\r
          * emulate the IE behavior\r
-         *\r
+         * @method swapNode\r
          * @param n1 the first node to swap\r
          * @param n2 the other node to swap\r
+         * @static\r
          */\r
-        this.swapNode = function(n1, n2) {\r
+        swapNode: function(n1, n2) {\r
             if (n1.swapNode) {\r
                 n1.swapNode(n2);\r
             } else {\r
-                // the node reference order for the swap is a little tricky. \r
                 var p = n2.parentNode;\r
                 var s = n2.nextSibling;\r
-                n1.parentNode.replaceChild(n2, n1);\r
-                p.insertBefore(n1,s);\r
+\r
+                if (s == n1) {\r
+                    p.insertBefore(n1, n2);\r
+                } else if (n2 == n1.nextSibling) {\r
+                    p.insertBefore(n2, n1);\r
+                } else {\r
+                    n1.parentNode.replaceChild(n2, n1);\r
+                    p.insertBefore(n1, s);\r
+                }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
+         * Returns the current scroll position\r
+         * @method getScroll\r
          * @private\r
-         */\r
-        this.getScroll = function () {\r
-            var t, l;\r
-            if (document.documentElement && document.documentElement.scrollTop) {\r
-                t = document.documentElement.scrollTop;\r
-                l = document.documentElement.scrollLeft;\r
-            } else if (document.body) {\r
-                t = document.body.scrollTop;\r
-                l = document.body.scrollLeft;\r
+         * @static\r
+         */\r
+        getScroll: function () {\r
+            var t, l, dde=document.documentElement, db=document.body;\r
+            if (dde && (dde.scrollTop || dde.scrollLeft)) {\r
+                t = dde.scrollTop;\r
+                l = dde.scrollLeft;\r
+            } else if (db) {\r
+                t = db.scrollTop;\r
+                l = db.scrollLeft;\r
+            } else {\r
+                YAHOO.log("could not get scroll property");\r
             }\r
             return { top: t, left: l };\r
-        };\r
+        },\r
 \r
         /**\r
          * Returns the specified element style property\r
+         * @method getStyle\r
          * @param {HTMLElement} el          the element\r
          * @param {string}      styleProp   the style property\r
          * @return {string} The value of the style property\r
-         * @deprecated, use YAHOO.util.Dom.getStyle\r
+         * @deprecated use YAHOO.util.Dom.getStyle\r
+         * @static\r
          */\r
-        this.getStyle = function(el, styleProp) {\r
+        getStyle: function(el, styleProp) {\r
             return YAHOO.util.Dom.getStyle(el, styleProp);\r
-        };\r
+        },\r
 \r
         /**\r
          * Gets the scrollTop\r
+         * @method getScrollTop\r
          * @return {int} the document's scrollTop\r
+         * @static\r
          */\r
-        this.getScrollTop = function () { return this.getScroll().top; };\r
+        getScrollTop: function () { return this.getScroll().top; },\r
 \r
         /**\r
          * Gets the scrollLeft\r
+         * @method getScrollLeft\r
          * @return {int} the document's scrollTop\r
+         * @static\r
          */\r
-        this.getScrollLeft = function () { return this.getScroll().left; };\r
+        getScrollLeft: function () { return this.getScroll().left; },\r
 \r
         /**\r
          * Sets the x/y position of an element to the location of the\r
          * target element.\r
+         * @method moveToEl\r
          * @param {HTMLElement} moveEl      The element to move\r
          * @param {HTMLElement} targetEl    The position reference element\r
+         * @static\r
          */\r
-        this.moveToEl = function (moveEl, targetEl) {\r
+        moveToEl: function (moveEl, targetEl) {\r
             var aCoord = YAHOO.util.Dom.getXY(targetEl);\r
             YAHOO.util.Dom.setXY(moveEl, aCoord);\r
-        };\r
+        },\r
 \r
         /**\r
          * Gets the client height\r
+         * @method getClientHeight\r
          * @return {int} client height in px\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getViewportHeight instead\r
+         * @static\r
          */\r
-        this.getClientHeight = function() {\r
-            return YAHOO.util.Dom.getClientHeight();\r
-        };\r
+        getClientHeight: function() {\r
+            return YAHOO.util.Dom.getViewportHeight();\r
+        },\r
 \r
         /**\r
          * Gets the client width\r
+         * @method getClientWidth\r
          * @return {int} client width in px\r
-         * @deprecated\r
+         * @deprecated use YAHOO.util.Dom.getViewportWidth instead\r
+         * @static\r
          */\r
-        this.getClientWidth = function() {\r
-            return YAHOO.util.Dom.getClientWidth();\r
-        };\r
+        getClientWidth: function() {\r
+            return YAHOO.util.Dom.getViewportWidth();\r
+        },\r
 \r
         /**\r
-         * numeric array sort function\r
+         * Numeric array sort function\r
+         * @method numericSort\r
+         * @static\r
          */\r
-        this.numericSort = function(a, b) { return (a - b); };\r
+        numericSort: function(a, b) { return (a - b); },\r
 \r
         /**\r
+         * Internal counter\r
+         * @property _timeoutCount\r
          * @private\r
+         * @static\r
          */\r
-        this._timeoutCount = 0;\r
+        _timeoutCount: 0,\r
 \r
         /**\r
          * Trying to make the load order less important.  Without this we get\r
          * an error if this file is loaded before the Event Utility.\r
+         * @method _addListeners\r
          * @private\r
+         * @static\r
          */\r
-        this._addListeners = function() {\r
+        _addListeners: function() {\r
+            var DDM = YAHOO.util.DDM;\r
             if ( YAHOO.util.Event && document ) {\r
-                this._onLoad();\r
+                DDM._onLoad();\r
             } else {\r
-                if (this._timeoutCount > 1000) {\r
+                if (DDM._timeoutCount > 2000) {\r
                 } else {\r
-                    var DDM = YAHOO.util.DDM;\r
-                    setTimeout( function() { DDM._addListeners(); }, 10);\r
+                    setTimeout(DDM._addListeners, 10);\r
                     if (document && document.body) {\r
-                        this._timeoutCount += 1;\r
+                        DDM._timeoutCount += 1;\r
                     }\r
                 }\r
             }\r
-        };\r
+        },\r
 \r
         /**\r
-         * Recursively searches the immediate parent and all child nodes for \r
-         * the handle element in order to determine wheter or not it was \r
+         * Recursively searches the immediate parent and all child nodes for\r
+         * the handle element in order to determine wheter or not it was\r
          * clicked.\r
+         * @method handleWasClicked\r
          * @param node the html element to inspect\r
+         * @static\r
          */\r
-        this.handleWasClicked = function(node, id) {\r
+        handleWasClicked: function(node, id) {\r
             if (this.isHandle(id, node.id)) {\r
                 return true;\r
             } else {\r
@@ -2163,26 +2400,28 @@ if (!YAHOO.util.DragDropMgr) {
             }\r
 \r
             return false;\r
-        };\r
+        }\r
+\r
+    };\r
 \r
-    } ();\r
+}();\r
 \r
-    // shorter alias, save a few bytes\r
-    YAHOO.util.DDM = YAHOO.util.DragDropMgr;\r
-    YAHOO.util.DDM._addListeners();\r
+// shorter alias, save a few bytes\r
+YAHOO.util.DDM = YAHOO.util.DragDropMgr;\r
+YAHOO.util.DDM._addListeners();\r
 \r
 }\r
 \r
 /**\r
- * A DragDrop implementation where the linked element follows the \r
+ * A DragDrop implementation where the linked element follows the\r
  * mouse cursor during a drag.\r
- *\r
+ * @class DD\r
  * @extends YAHOO.util.DragDrop\r
  * @constructor\r
- * @param {String} id the id of the linked element \r
+ * @param {String} id the id of the linked element\r
  * @param {String} sGroup the group of related DragDrop items\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DD: \r
+ *                Valid properties for DD:\r
  *                    scroll\r
  */\r
 YAHOO.util.DD = function(id, sGroup, config) {\r
@@ -2191,281 +2430,278 @@ YAHOO.util.DD = function(id, sGroup, config) {
     }\r
 };\r
 \r
-// YAHOO.util.DD.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop);\r
+YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {\r
 \r
-/**\r
- * When set to true, the utility automatically tries to scroll the browser\r
- * window wehn a drag and drop element is dragged near the viewport boundary.\r
- * Defaults to true.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DD.prototype.scroll = true; \r
+    /**\r
    * When set to true, the utility automatically tries to scroll the browser\r
    * window wehn a drag and drop element is dragged near the viewport boundary.\r
    * Defaults to true.\r
+     * @property scroll\r
    * @type boolean\r
    */\r
+    scroll: true,\r
 \r
-/**\r
- * Sets the pointer offset to the distance between the linked element's top \r
- * left corner and the location the element was clicked\r
- *\r
- * @param {int} iPageX the X coordinate of the click\r
- * @param {int} iPageY the Y coordinate of the click\r
- */\r
-YAHOO.util.DD.prototype.autoOffset = function(iPageX, iPageY) {\r
-    // var el = this.getEl();\r
-    // var aCoord = YAHOO.util.Dom.getXY(el);\r
-    // var x = iPageX - aCoord[0];\r
-    // var y = iPageY - aCoord[1];\r
-    var x = iPageX - this.startPageX;\r
-    var y = iPageY - this.startPageY;\r
-    this.setDelta(x, y);\r
-};\r
+    /**\r
+     * Sets the pointer offset to the distance between the linked element's top\r
+     * left corner and the location the element was clicked\r
+     * @method autoOffset\r
+     * @param {int} iPageX the X coordinate of the click\r
+     * @param {int} iPageY the Y coordinate of the click\r
+     */\r
+    autoOffset: function(iPageX, iPageY) {\r
+        var x = iPageX - this.startPageX;\r
+        var y = iPageY - this.startPageY;\r
+        this.setDelta(x, y);\r
+    },\r
 \r
-/** \r
- * Sets the pointer offset.  You can call this directly to force the offset to\r
- * be in a particular location (e.g., pass in 0,0 to set it to the center of the\r
* object, as done in YAHOO.widget.Slider)\r
- *\r
- * @param {int} iDeltaX the distance from the left\r
- * @param {int} iDeltaY the distance from the top\r
- */\r
-YAHOO.util.DD.prototype.setDelta = function(iDeltaX, iDeltaY) {\r
-    this.deltaX = iDeltaX;\r
-    this.deltaY = iDeltaY;\r
-};\r
+    /**\r
+     * Sets the pointer offset.  You can call this directly to force the\r
+     * offset to be in a particular location (e.g., pass in 0,0 to set it\r
    * to the center of the object, as done in YAHOO.widget.Slider)\r
+     * @method setDelta\r
    * @param {int} iDeltaX the distance from the left\r
    * @param {int} iDeltaY the distance from the top\r
    */\r
+    setDelta: function(iDeltaX, iDeltaY) {\r
+        this.deltaX = iDeltaX;\r
+        this.deltaY = iDeltaY;\r
+    },\r
 \r
-/**\r
- * Sets the drag element to the location of the mousedown or click event, \r
- * maintaining the cursor location relative to the location on the element \r
- * that was clicked.  Override this if you want to place the element in a \r
- * location other than where the cursor is.\r
- *\r
- * @param {int} iPageX the X coordinate of the mousedown or drag event\r
- * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
- */\r
+    /**\r
+     * Sets the drag element to the location of the mousedown or click event,\r
+     * maintaining the cursor location relative to the location on the element\r
+     * that was clicked.  Override this if you want to place the element in a\r
+     * location other than where the cursor is.\r
+     * @method setDragElPos\r
+     * @param {int} iPageX the X coordinate of the mousedown or drag event\r
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
+     */\r
+    setDragElPos: function(iPageX, iPageY) {\r
+        // the first time we do this, we are going to check to make sure\r
+        // the element has css positioning\r
 \r
-YAHOO.util.DD.prototype.setDragElPos = function(iPageX, iPageY) {\r
-    // the first time we do this, we are going to check to make sure\r
-    // the element has css positioning\r
+        var el = this.getDragEl();\r
+        this.alignElWithMouse(el, iPageX, iPageY);\r
+    },\r
 \r
-    var el = this.getDragEl();\r
+    /**\r
+     * Sets the element to the location of the mousedown or click event,\r
+     * maintaining the cursor location relative to the location on the element\r
+     * that was clicked.  Override this if you want to place the element in a\r
+     * location other than where the cursor is.\r
+     * @method alignElWithMouse\r
+     * @param {HTMLElement} el the element to move\r
+     * @param {int} iPageX the X coordinate of the mousedown or drag event\r
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
+     */\r
+    alignElWithMouse: function(el, iPageX, iPageY) {\r
+        var oCoord = this.getTargetCoord(iPageX, iPageY);\r
 \r
-    // if (!this.cssVerified) {\r
-        // var pos = el.style.position;\r
-    // }\r
+        if (!this.deltaSetXY) {\r
+            var aCoord = [oCoord.x, oCoord.y];\r
+            YAHOO.util.Dom.setXY(el, aCoord);\r
+            var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+            var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
 \r
-    this.alignElWithMouse(el, iPageX, iPageY);\r
-};\r
+            this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];\r
+        } else {\r
+            YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
+            YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");\r
+        }\r
 \r
-/**\r
- * Sets the element to the location of the mousedown or click event, \r
- * maintaining the cursor location relative to the location on the element \r
- * that was clicked.  Override this if you want to place the element in a \r
- * location other than where the cursor is.\r
- *\r
- * @param {HTMLElement} el the element to move\r
- * @param {int} iPageX the X coordinate of the mousedown or drag event\r
- * @param {int} iPageY the Y coordinate of the mousedown or drag event\r
- */\r
-YAHOO.util.DD.prototype.alignElWithMouse = function(el, iPageX, iPageY) {\r
-    var oCoord = this.getTargetCoord(iPageX, iPageY);\r
+        this.cachePosition(oCoord.x, oCoord.y);\r
+        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
+    },\r
 \r
-    // this.deltaSetXY = null;\r
-    if (!this.deltaSetXY) {\r
-        var aCoord = [oCoord.x, oCoord.y];\r
-        YAHOO.util.Dom.setXY(el, aCoord);\r
-        var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
-        var newTop  = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
+    /**\r
+     * Saves the most recent position so that we can reset the constraints and\r
+     * tick marks on-demand.  We need to know this so that we can calculate the\r
+     * number of pixels the element is offset from its original position.\r
+     * @method cachePosition\r
+     * @param iPageX the current x position (optional, this just makes it so we\r
+     * don't have to look it up again)\r
+     * @param iPageY the current y position (optional, this just makes it so we\r
+     * don't have to look it up again)\r
+     */\r
+    cachePosition: function(iPageX, iPageY) {\r
+        if (iPageX) {\r
+            this.lastPageX = iPageX;\r
+            this.lastPageY = iPageY;\r
+        } else {\r
+            var aCoord = YAHOO.util.Dom.getXY(this.getEl());\r
+            this.lastPageX = aCoord[0];\r
+            this.lastPageY = aCoord[1];\r
+        }\r
+    },\r
 \r
-        this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];\r
+    /**\r
+     * Auto-scroll the window if the dragged object has been moved beyond the\r
+     * visible window boundary.\r
+     * @method autoScroll\r
+     * @param {int} x the drag element's x position\r
+     * @param {int} y the drag element's y position\r
+     * @param {int} h the height of the drag element\r
+     * @param {int} w the width of the drag element\r
+     * @private\r
+     */\r
+    autoScroll: function(x, y, h, w) {\r
 \r
-    } else {\r
-        YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
-        YAHOO.util.Dom.setStyle(el, "top",  (oCoord.y + this.deltaSetXY[1]) + "px");\r
-    }\r
-    \r
+        if (this.scroll) {\r
+            // The client height\r
+            var clientH = this.DDM.getClientHeight();\r
 \r
-    this.cachePosition(oCoord.x, oCoord.y);\r
+            // The client width\r
+            var clientW = this.DDM.getClientWidth();\r
 \r
-    this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
-};\r
+            // The amt scrolled down\r
+            var st = this.DDM.getScrollTop();\r
 \r
-/**\r
- * Saves the most recent position so that we can reset the constraints and\r
- * tick marks on-demand.  We need to know this so that we can calculate the\r
- * number of pixels the element is offset from its original position.\r
- */\r
-YAHOO.util.DD.prototype.cachePosition = function(iPageX, iPageY) {\r
-    if (iPageX) {\r
-        this.lastPageX = iPageX;\r
-        this.lastPageY = iPageY;\r
-    } else {\r
-        var aCoord = YAHOO.util.Dom.getXY(this.getEl());\r
-        this.lastPageX = aCoord[0];\r
-        this.lastPageY = aCoord[1];\r
-    }\r
-};\r
+            // The amt scrolled right\r
+            var sl = this.DDM.getScrollLeft();\r
 \r
-/**\r
- * Auto-scroll the window if the dragged object has been moved beyond the \r
- * visible window boundary.\r
- *\r
- * @param {int} x the drag element's x position\r
- * @param {int} y the drag element's y position\r
- * @param {int} h the height of the drag element\r
- * @param {int} w the width of the drag element\r
- * @private\r
- */\r
-YAHOO.util.DD.prototype.autoScroll = function(x, y, h, w) {\r
+            // Location of the bottom of the element\r
+            var bot = h + y;\r
 \r
-    if (this.scroll) {\r
-        // The client height\r
-        var clientH = this.DDM.getClientHeight();\r
+            // Location of the right of the element\r
+            var right = w + x;\r
 \r
-        // The client width\r
-        var clientW = this.DDM.getClientWidth();\r
+            // The distance from the cursor to the bottom of the visible area,\r
+            // adjusted so that we don't scroll if the cursor is beyond the\r
+            // element drag constraints\r
+            var toBot = (clientH + st - y - this.deltaY);\r
 \r
-        // The amt scrolled down\r
-        var st = this.DDM.getScrollTop();\r
+            // The distance from the cursor to the right of the visible area\r
+            var toRight = (clientW + sl - x - this.deltaX);\r
 \r
-        // The amt scrolled right\r
-        var sl = this.DDM.getScrollLeft();\r
 \r
-        // Location of the bottom of the element\r
-        var bot = h + y;\r
+            // How close to the edge the cursor must be before we scroll\r
+            // var thresh = (document.all) ? 100 : 40;\r
+            var thresh = 40;\r
 \r
-        // Location of the right of the element\r
-        var right = w + x;\r
+            // How many pixels to scroll per autoscroll op.  This helps to reduce\r
+            // clunky scrolling. IE is more sensitive about this ... it needs this\r
+            // value to be higher.\r
+            var scrAmt = (document.all) ? 80 : 30;\r
 \r
-        // The distance from the cursor to the bottom of the visible area, \r
-        // adjusted so that we don't scroll if the cursor is beyond the\r
-        // element drag constraints\r
-        var toBot = (clientH + st - y - this.deltaY);\r
+            // Scroll down if we are near the bottom of the visible page and the\r
+            // obj extends below the crease\r
+            if ( bot > clientH && toBot < thresh ) {\r
+                window.scrollTo(sl, st + scrAmt);\r
+            }\r
 \r
-        // The distance from the cursor to the right of the visible area\r
-        var toRight = (clientW + sl - x - this.deltaX);\r
+            // Scroll up if the window is scrolled down and the top of the object\r
+            // goes above the top border\r
+            if ( y < st && st > 0 && y - st < thresh ) {\r
+                window.scrollTo(sl, st - scrAmt);\r
+            }\r
 \r
+            // Scroll right if the obj is beyond the right border and the cursor is\r
+            // near the border.\r
+            if ( right > clientW && toRight < thresh ) {\r
+                window.scrollTo(sl + scrAmt, st);\r
+            }\r
 \r
-        // How close to the edge the cursor must be before we scroll\r
-        // var thresh = (document.all) ? 100 : 40;\r
-        var thresh = 40;\r
+            // Scroll left if the window has been scrolled to the right and the obj\r
+            // extends past the left border\r
+            if ( x < sl && sl > 0 && x - sl < thresh ) {\r
+                window.scrollTo(sl - scrAmt, st);\r
+            }\r
+        }\r
+    },\r
 \r
-        // How many pixels to scroll per autoscroll op.  This helps to reduce \r
-        // clunky scrolling. IE is more sensitive about this ... it needs this \r
-        // value to be higher.\r
-        var scrAmt = (document.all) ? 80 : 30;\r
+    /**\r
+     * Finds the location the element should be placed if we want to move\r
+     * it to where the mouse location less the click offset would place us.\r
+     * @method getTargetCoord\r
+     * @param {int} iPageX the X coordinate of the click\r
+     * @param {int} iPageY the Y coordinate of the click\r
+     * @return an object that contains the coordinates (Object.x and Object.y)\r
+     * @private\r
+     */\r
+    getTargetCoord: function(iPageX, iPageY) {\r
 \r
-        // Scroll down if we are near the bottom of the visible page and the \r
-        // obj extends below the crease\r
-        if ( bot > clientH && toBot < thresh ) { \r
-            window.scrollTo(sl, st + scrAmt); \r
-        }\r
 \r
-        // Scroll up if the window is scrolled down and the top of the object\r
-        // goes above the top border\r
-        if ( y < st && st > 0 && y - st < thresh ) { \r
-            window.scrollTo(sl, st - scrAmt); \r
-        }\r
+        var x = iPageX - this.deltaX;\r
+        var y = iPageY - this.deltaY;\r
 \r
-        // Scroll right if the obj is beyond the right border and the cursor is\r
-        // near the border.\r
-        if ( right > clientW && toRight < thresh ) { \r
-            window.scrollTo(sl + scrAmt, st); \r
+        if (this.constrainX) {\r
+            if (x < this.minX) { x = this.minX; }\r
+            if (x > this.maxX) { x = this.maxX; }\r
         }\r
 \r
-        // Scroll left if the window has been scrolled to the right and the obj\r
-        // extends past the left border\r
-        if ( x < sl && sl > 0 && x - sl < thresh ) { \r
-            window.scrollTo(sl - scrAmt, st);\r
+        if (this.constrainY) {\r
+            if (y < this.minY) { y = this.minY; }\r
+            if (y > this.maxY) { y = this.maxY; }\r
         }\r
-    }\r
-};\r
 \r
-/**\r
- * Finds the location the element should be placed if we want to move\r
- * it to where the mouse location less the click offset would place us.\r
- *\r
- * @param {int} iPageX the X coordinate of the click\r
- * @param {int} iPageY the Y coordinate of the click\r
- * @return an object that contains the coordinates (Object.x and Object.y)\r
- * @private\r
- */\r
-YAHOO.util.DD.prototype.getTargetCoord = function(iPageX, iPageY) {\r
+        x = this.getTick(x, this.xTicks);\r
+        y = this.getTick(y, this.yTicks);\r
 \r
 \r
-    var x = iPageX - this.deltaX;\r
-    var y = iPageY - this.deltaY;\r
-\r
-    if (this.constrainX) {\r
-        if (x < this.minX) { x = this.minX; }\r
-        if (x > this.maxX) { x = this.maxX; }\r
-    }\r
-\r
-    if (this.constrainY) {\r
-        if (y < this.minY) { y = this.minY; }\r
-        if (y > this.maxY) { y = this.maxY; }\r
-    }\r
-\r
-    x = this.getTick(x, this.xTicks);\r
-    y = this.getTick(y, this.yTicks);\r
-\r
+        return {x:x, y:y};\r
+    },\r
 \r
-    return {x:x, y:y};\r
-};\r
+    /*\r
+     * Sets up config options specific to this class. Overrides\r
+     * YAHOO.util.DragDrop, but all versions of this method through the\r
+     * inheritance chain are called\r
+     */\r
+    applyConfig: function() {\r
+        YAHOO.util.DD.superclass.applyConfig.call(this);\r
+        this.scroll = (this.config.scroll !== false);\r
+    },\r
 \r
-YAHOO.util.DD.prototype.applyConfig = function() {\r
-    YAHOO.util.DD.superclass.applyConfig.call(this);\r
-    this.scroll = (this.config.scroll !== false);\r
-};\r
+    /*\r
+     * Event that fires prior to the onMouseDown event.  Overrides\r
+     * YAHOO.util.DragDrop.\r
+     */\r
+    b4MouseDown: function(e) {\r
+        // this.resetConstraints();\r
+        this.autoOffset(YAHOO.util.Event.getPageX(e),\r
+                            YAHOO.util.Event.getPageY(e));\r
+    },\r
 \r
-/** \r
- * Event that fires prior to the onMouseDown event.  Overrides \r
- * YAHOO.util.DragDrop.\r
- */\r
-YAHOO.util.DD.prototype.b4MouseDown = function(e) {\r
-    // this.resetConstraints();\r
-    this.autoOffset(YAHOO.util.Event.getPageX(e), \r
-                        YAHOO.util.Event.getPageY(e));\r
-};\r
+    /*\r
+     * Event that fires prior to the onDrag event.  Overrides\r
+     * YAHOO.util.DragDrop.\r
+     */\r
+    b4Drag: function(e) {\r
+        this.setDragElPos(YAHOO.util.Event.getPageX(e),\r
+                            YAHOO.util.Event.getPageY(e));\r
+    },\r
 \r
-/** \r
- * Event that fires prior to the onDrag event.  Overrides \r
- * YAHOO.util.DragDrop.\r
- */\r
-YAHOO.util.DD.prototype.b4Drag = function(e) {\r
-    this.setDragElPos(YAHOO.util.Event.getPageX(e), \r
-                        YAHOO.util.Event.getPageY(e));\r
-};\r
+    toString: function() {\r
+        return ("DD " + this.id);\r
+    }\r
 \r
-YAHOO.util.DD.prototype.toString = function() {\r
-    return ("DD " + this.id);\r
-};\r
+    //////////////////////////////////////////////////////////////////////////\r
+    // Debugging ygDragDrop events that can be overridden\r
+    //////////////////////////////////////////////////////////////////////////\r
+    /*\r
+    startDrag: function(x, y) {\r
+    },\r
 \r
-///////////////////////////////////////////////////////////////////////////////\r
-// Debugging ygDragDrop events that can be overridden\r
-///////////////////////////////////////////////////////////////////////////////\r
-/*\r
-YAHOO.util.DD.prototype.startDrag = function(x, y) {\r
-};\r
+    onDrag: function(e) {\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDrag = function(e) {\r
-};\r
+    onDragEnter: function(e, id) {\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragEnter = function(e, id) {\r
-};\r
+    onDragOver: function(e, id) {\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragOver = function(e, id) {\r
-};\r
+    onDragOut: function(e, id) {\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragOut = function(e, id) {\r
-};\r
+    onDragDrop: function(e, id) {\r
+    },\r
 \r
-YAHOO.util.DD.prototype.onDragDrop = function(e, id) {\r
-};\r
+    endDrag: function(e) {\r
+    }\r
 \r
-YAHOO.util.DD.prototype.endDrag = function(e) {\r
-};\r
-*/\r
+    */\r
 \r
+});\r
 /**\r
  * A DragDrop implementation that inserts an empty, bordered div into\r
  * the document that follows the cursor during drag operations.  At the time of\r
@@ -2476,226 +2712,220 @@ YAHOO.util.DD.prototype.endDrag = function(e) {
  * was created to be dragged in place of all DDProxy elements on the\r
  * page.\r
  *\r
+ * @class DDProxy\r
  * @extends YAHOO.util.DD\r
  * @constructor\r
  * @param {String} id the id of the linked html element\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DDProxy in addition to those in DragDrop: \r
+ *                Valid properties for DDProxy in addition to those in DragDrop:\r
  *                   resizeFrame, centerFrame, dragElId\r
  */\r
 YAHOO.util.DDProxy = function(id, sGroup, config) {\r
     if (id) {\r
         this.init(id, sGroup, config);\r
-        this.initFrame(); \r
+        this.initFrame();\r
     }\r
 };\r
 \r
-YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD);\r
-\r
 /**\r
  * The default drag frame div id\r
+ * @property YAHOO.util.DDProxy.dragElId\r
  * @type String\r
+ * @static\r
  */\r
 YAHOO.util.DDProxy.dragElId = "ygddfdiv";\r
 \r
-/**\r
- * By default we resize the drag frame to be the same size as the element\r
- * we want to drag (this is to get the frame effect).  We can turn it off\r
- * if we want a different behavior.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DDProxy.prototype.resizeFrame = true;\r
-\r
-/**\r
- * By default the frame is positioned exactly where the drag element is, so\r
- * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if\r
- * you do not have constraints on the obj is to have the drag frame centered\r
- * around the cursor.  Set centerFrame to true for this effect.\r
- *\r
- * @type boolean\r
- */\r
-YAHOO.util.DDProxy.prototype.centerFrame = false;\r
+YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {\r
 \r
-/**\r
- * Previous proxy element size.\r
- * @private\r
- */\r
-YAHOO.util.DDProxy.prototype._previousSize = [-1, -1];\r
-\r
-/**\r
- * Create the drag frame if needed\r
- */\r
-YAHOO.util.DDProxy.prototype.createFrame = function() {\r
-    var self = this;\r
-    var body = document.body;\r
-\r
-    if (!body || !body.firstChild) {\r
-        setTimeout( function() { self.createFrame(); }, 50 );\r
-        return;\r
-    }\r
-\r
-    var div = this.getDragEl();\r
+    /**\r
+     * By default we resize the drag frame to be the same size as the element\r
+     * we want to drag (this is to get the frame effect).  We can turn it off\r
+     * if we want a different behavior.\r
+     * @property resizeFrame\r
+     * @type boolean\r
+     */\r
+    resizeFrame: true,\r
 \r
-    if (!div) {\r
-        div    = document.createElement("div");\r
-        div.id = this.dragElId;\r
-        var s  = div.style;\r
+    /**\r
+     * By default the frame is positioned exactly where the drag element is, so\r
+     * we use the cursor offset provided by YAHOO.util.DD.  Another option that works only if\r
+     * you do not have constraints on the obj is to have the drag frame centered\r
+     * around the cursor.  Set centerFrame to true for this effect.\r
+     * @property centerFrame\r
+     * @type boolean\r
+     */\r
+    centerFrame: false,\r
 \r
-        s.position   = "absolute";\r
-        s.visibility = "hidden";\r
-        s.cursor     = "move";\r
-        s.border     = "2px solid #aaa";\r
-        s.zIndex     = 999;\r
+    /**\r
+     * Creates the proxy element if it does not yet exist\r
+     * @method createFrame\r
+     */\r
+    createFrame: function() {\r
+        var self = this;\r
+        var body = document.body;\r
 \r
-        // appendChild can blow up IE if invoked prior to the window load event\r
-        // while rendering a table.  It is possible there are other scenarios \r
-        // that would cause this to happen as well.\r
-        body.insertBefore(div, body.firstChild);\r
-    }\r
-};\r
+        if (!body || !body.firstChild) {\r
+            setTimeout( function() { self.createFrame(); }, 50 );\r
+            return;\r
+        }\r
 \r
-/**\r
- * Initialization for the drag frame element.  Must be called in the\r
- * constructor of all subclasses\r
- */\r
-YAHOO.util.DDProxy.prototype.initFrame = function() {\r
-    // YAHOO.util.DDProxy.createFrame();\r
-    // this.setDragElId(YAHOO.util.DDProxy.dragElId);\r
+        var div = this.getDragEl();\r
 \r
-    this.createFrame();\r
+        if (!div) {\r
+            div    = document.createElement("div");\r
+            div.id = this.dragElId;\r
+            var s  = div.style;\r
 \r
-};\r
+            s.position   = "absolute";\r
+            s.visibility = "hidden";\r
+            s.cursor     = "move";\r
+            s.border     = "2px solid #aaa";\r
+            s.zIndex     = 999;\r
 \r
-YAHOO.util.DDProxy.prototype.applyConfig = function() {\r
-    YAHOO.util.DDProxy.superclass.applyConfig.call(this);\r
+            // appendChild can blow up IE if invoked prior to the window load event\r
+            // while rendering a table.  It is possible there are other scenarios\r
+            // that would cause this to happen as well.\r
+            body.insertBefore(div, body.firstChild);\r
+        }\r
+    },\r
 \r
-    this.resizeFrame = (this.config.resizeFrame !== false);\r
-    this.centerFrame = (this.config.centerFrame);\r
-    this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId);\r
+    /**\r
+     * Initialization for the drag frame element.  Must be called in the\r
+     * constructor of all subclasses\r
+     * @method initFrame\r
+     */\r
+    initFrame: function() {\r
+        this.createFrame();\r
+    },\r
 \r
-};\r
+    applyConfig: function() {\r
+        YAHOO.util.DDProxy.superclass.applyConfig.call(this);\r
 \r
-/**\r
- * Resizes the drag frame to the dimensions of the clicked object, positions \r
- * it over the object, and finally displays it\r
- *\r
- * @param {int} iPageX X click position\r
- * @param {int} iPageY Y click position\r
- * @private\r
- */\r
-YAHOO.util.DDProxy.prototype.showFrame = function(iPageX, iPageY) {\r
-    var el = this.getEl();\r
-    var dragEl = this.getDragEl();\r
-    var s = dragEl.style;\r
+        this.resizeFrame = (this.config.resizeFrame !== false);\r
+        this.centerFrame = (this.config.centerFrame);\r
+        this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId);\r
+    },\r
 \r
-    this._resizeProxy();\r
+    /**\r
+     * Resizes the drag frame to the dimensions of the clicked object, positions\r
+     * it over the object, and finally displays it\r
+     * @method showFrame\r
+     * @param {int} iPageX X click position\r
+     * @param {int} iPageY Y click position\r
+     * @private\r
+     */\r
+    showFrame: function(iPageX, iPageY) {\r
+        var el = this.getEl();\r
+        var dragEl = this.getDragEl();\r
+        var s = dragEl.style;\r
 \r
-    if (this.centerFrame) {\r
-        this.setDelta( Math.round(parseInt(s.width,  10)/2), \r
-                       Math.round(parseInt(s.height, 10)/2) );\r
-    }\r
+        this._resizeProxy();\r
 \r
-    this.setDragElPos(iPageX, iPageY);\r
+        if (this.centerFrame) {\r
+            this.setDelta( Math.round(parseInt(s.width,  10)/2),\r
+                           Math.round(parseInt(s.height, 10)/2) );\r
+        }\r
 \r
-    // s.visibility = "";\r
-    YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); \r
-};\r
+        this.setDragElPos(iPageX, iPageY);\r
 \r
-YAHOO.util.DDProxy.prototype._resizeProxy = function() {\r
-    var DOM    = YAHOO.util.Dom;\r
-    var el     = this.getEl();\r
-    var dragEl = this.getDragEl();\r
+        YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible");\r
+    },\r
 \r
-    if (this.resizeFrame) {\r
-        var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth"    ), 10);\r
-        var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth"  ), 10);\r
-        var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10);\r
-        var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth"   ), 10);\r
+    /**\r
+     * The proxy is automatically resized to the dimensions of the linked\r
+     * element when a drag is initiated, unless resizeFrame is set to false\r
+     * @method _resizeProxy\r
+     * @private\r
+     */\r
+    _resizeProxy: function() {\r
+        if (this.resizeFrame) {\r
+            var DOM    = YAHOO.util.Dom;\r
+            var el     = this.getEl();\r
+            var dragEl = this.getDragEl();\r
 \r
-        if (isNaN(bt)) { bt = 0; }\r
-        if (isNaN(br)) { br = 0; }\r
-        if (isNaN(bb)) { bb = 0; }\r
-        if (isNaN(bl)) { bl = 0; }\r
+            var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth"    ), 10);\r
+            var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth"  ), 10);\r
+            var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10);\r
+            var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth"   ), 10);\r
 \r
+            if (isNaN(bt)) { bt = 0; }\r
+            if (isNaN(br)) { br = 0; }\r
+            if (isNaN(bb)) { bb = 0; }\r
+            if (isNaN(bl)) { bl = 0; }\r
 \r
-        var newWidth  = el.offsetWidth - br - bl;\r
-        var newHeight = el.offsetHeight - bt - bb;\r
 \r
-        if (this._previousSize[0] !== newWidth && \r
-                        this._previousSize[1] !== newHeight) {\r
+            var newWidth  = Math.max(0, el.offsetWidth  - br - bl);\r
+            var newHeight = Math.max(0, el.offsetHeight - bt - bb);\r
 \r
 \r
             DOM.setStyle( dragEl, "width",  newWidth  + "px" );\r
             DOM.setStyle( dragEl, "height", newHeight + "px" );\r
-\r
-            this._previousSize = [newWidth, newHeight];\r
         }\r
-    }\r
-};\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4MouseDown = function(e) {\r
-    var x = YAHOO.util.Event.getPageX(e);\r
-    var y = YAHOO.util.Event.getPageY(e);\r
-    this.autoOffset(x, y);\r
-    this.setDragElPos(x, y);\r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4MouseDown: function(e) {\r
+        var x = YAHOO.util.Event.getPageX(e);\r
+        var y = YAHOO.util.Event.getPageY(e);\r
+        this.autoOffset(x, y);\r
+        this.setDragElPos(x, y);\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4StartDrag = function(x, y) {\r
-    // show the drag frame\r
-    this.showFrame(x, y);\r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4StartDrag: function(x, y) {\r
+        // show the drag frame\r
+        this.showFrame(x, y);\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-YAHOO.util.DDProxy.prototype.b4EndDrag = function(e) {\r
-    YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); \r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    b4EndDrag: function(e) {\r
+        YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden");\r
+    },\r
 \r
-// overrides YAHOO.util.DragDrop\r
-// By default we try to move the element to the last location of the frame.  \r
-// This is so that the default behavior mirrors that of YAHOO.util.DD.  \r
-YAHOO.util.DDProxy.prototype.endDrag = function(e) {\r
-    var DOM = YAHOO.util.Dom;\r
-    var lel = this.getEl();\r
-    var del = this.getDragEl();\r
-\r
-    // Show the drag frame briefly so we can get its position\r
-    // del.style.visibility = "";\r
-    DOM.setStyle(del, "visibility", ""); \r
-\r
-    // Hide the linked element before the move to get around a Safari \r
-    // rendering bug.\r
-    //lel.style.visibility = "hidden";\r
-    DOM.setStyle(lel, "visibility", "hidden"); \r
-    YAHOO.util.DDM.moveToEl(lel, del);\r
-    //del.style.visibility = "hidden";\r
-    DOM.setStyle(del, "visibility", "hidden"); \r
-    //lel.style.visibility = "";\r
-    DOM.setStyle(lel, "visibility", ""); \r
-};\r
+    // overrides YAHOO.util.DragDrop\r
+    // By default we try to move the element to the last location of the frame.\r
+    // This is so that the default behavior mirrors that of YAHOO.util.DD.\r
+    endDrag: function(e) {\r
+        var DOM = YAHOO.util.Dom;\r
+        var lel = this.getEl();\r
+        var del = this.getDragEl();\r
+\r
+        // Show the drag frame briefly so we can get its position\r
+        // del.style.visibility = "";\r
+        DOM.setStyle(del, "visibility", "");\r
+\r
+        // Hide the linked element before the move to get around a Safari\r
+        // rendering bug.\r
+        //lel.style.visibility = "hidden";\r
+        DOM.setStyle(lel, "visibility", "hidden");\r
+        YAHOO.util.DDM.moveToEl(lel, del);\r
+        //del.style.visibility = "hidden";\r
+        DOM.setStyle(del, "visibility", "hidden");\r
+        //lel.style.visibility = "";\r
+        DOM.setStyle(lel, "visibility", "");\r
+    },\r
 \r
-YAHOO.util.DDProxy.prototype.toString = function() {\r
-    return ("DDProxy " + this.id);\r
-};\r
+    toString: function() {\r
+        return ("DDProxy " + this.id);\r
+    }\r
 \r
+});\r
 /**\r
- * A DragDrop implementation that does not move, but can be a drop \r
- * target.  You would get the same result by simply omitting implementation \r
- * for the event callbacks, but this way we reduce the processing cost of the \r
+ * A DragDrop implementation that does not move, but can be a drop\r
+ * target.  You would get the same result by simply omitting implementation\r
+ * for the event callbacks, but this way we reduce the processing cost of the\r
  * event listener and the callbacks.\r
- *\r
- * @extends YAHOO.util.DragDrop \r
+ * @class DDTarget\r
+ * @extends YAHOO.util.DragDrop\r
  * @constructor\r
  * @param {String} id the id of the element that is a drop target\r
  * @param {String} sGroup the group of related DragDrop objects\r
  * @param {object} config an object containing configurable attributes\r
- *                Valid properties for DDTarget in addition to those in DragDrop: \r
- *                  none\r
+ *                 Valid properties for DDTarget in addition to those in\r
+ *                 DragDrop:\r
+ *                    none\r
  */\r
\r
 YAHOO.util.DDTarget = function(id, sGroup, config) {\r
     if (id) {\r
         this.initTarget(id, sGroup, config);\r
@@ -2703,9 +2933,8 @@ YAHOO.util.DDTarget = function(id, sGroup, config) {
 };\r
 \r
 // YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop);\r
-\r
-YAHOO.util.DDTarget.prototype.toString = function() {\r
-    return ("DDTarget " + this.id);\r
-};\r
-\r
+YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {\r
+    toString: function() {\r
+        return ("DDTarget " + this.id);\r
+    }\r
+});\r
index 29132d43e3666f342ea4154f098e52b6565c1de5..e6b1f934976dbda64e21420b926ecc2a47c5edd9 100755 (executable)
@@ -1,6 +1,72 @@
 \r
 YUI Library - Event - Release Notes\r
 \r
+0.12.0\r
+\r
+   * If the function argument is not provided to Event.removeListener, all\r
+     all listeners for the specified event type on the element will be removed.\r
+\r
+   * CustomEvent now has an optional parameter that defines the signature of\r
+     the listeners for this event.  Two signatures are supported:\r
+\r
+       YAHOO.util.CustomEvent.LIST:\r
+         param1: event name\r
+         param2: array of arguments provided to fire()\r
+         param3: <optional> the custom object supplied to subscribe()\r
+\r
+       YAHOO.util.CustomEvent.FLAT:\r
+         param1: the first argument provided to fire()\r
+         param2: <optional> the custom object supplied to subscribe()\r
+\r
+     The new flat signature makes it possible to provide a better API \r
+     when using custom events, and it makes it possible to transparently \r
+     wrap DOM events.\r
+   \r
+   * The parameters for overriding scope in both Event.addListener, and\r
+     CustomEvent.subscribe have been augmented.  In addition to the \r
+     previous behavior where a true value would make the previous parameter\r
+     the execution scope, an object can be supplied instead.  If an object\r
+     is provided, that object becomes the scope obj.  This makes it possible \r
+     to pass a both a custom object and adjust the scope to a different object.\r
+\r
+   * Added EventProvider, which is a wrapper for CustomEvent that makes it\r
+     possible to subscribe to events by name, whether or not the event has\r
+     been created.  This class was designed to be used with YAHOO.augment.\r
+     EventProvider custom events are created with the new FLAT listener\r
+     signature.\r
+\r
+   * CustomEvent subscribers can return false to stop the propagation of\r
+     the event.\r
+\r
+   * CustomEvents now have an onSubscribe custom event that can used to the\r
+     case where a subscriber subscribes to an one-time event that has already\r
+     happened.  Also provides a way for the implementer to defer initialization\r
+     logic until after the first subscription.\r
+\r
+   * Event.getCharCode now always returns keyCode if charCode is not available.\r
+\r
+   * Added Event.onContentReady, which is similar to onAvailable, but it also\r
+     checks simblings to try to determine when the element's children are\r
+     available.\r
+\r
+0.11.4\r
+\r
+   * Fixed a memory leak in IE6 that occurred when the utility was hosted in \r
+     an iframe.\r
+\r
+   * Fixed an issue with Safari click listeners when listeners were removed.\r
+\r
+0.11.3\r
+\r
+   * The listener cache is now pruned when events are removed.  This fixes\r
+     a performance issue when adding many listeners, removing them, and\r
+     adding them again repeatedly.\r
+\r
+   * Safari click listeners will work correctly if a bound element is removed\r
+     from the DOM and a new element with the same ID is added.\r
+\r
+   * Removed the code that automatically unsubscribed custom event listeners.\r
+\r
 0.11.0\r
 \r
    * Added Event.purgeElement which will remove all listeners added via \r
@@ -53,3 +119,4 @@ YUI Library - Event - Release Notes
    * Fixed browser detection for Opera installations reporting as IE.\r
 \r
    * It is now possible to remove and re-add legacy events (Safari click event).\r
+\r
index 66f5f26ce31db04f825840fb474ae723f5eff7e9..77094e3cb03006812a37350b959fdca8635388ad 100755 (executable)
@@ -1,34 +1,39 @@
-\r
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
 \r
 \r
 /**\r
  * The CustomEvent class lets you define events for your application\r
  * that can be subscribed to by one or more independent component.\r
  *\r
- * @param {String} type The type of event, which is passed to the callback\r
- *                 when the event fires\r
- * @param {Object} oScope The context the event will fire from.  "this" will\r
- *                 refer to this object in the callback.  Default value: \r
- *                 the window object.  The listener can override this.\r
+ * @param {String}  type The type of event, which is passed to the callback\r
+ *                  when the event fires\r
+ * @param {Object}  oScope The context the event will fire from.  "this" will\r
+ *                  refer to this object in the callback.  Default value:\r
+ *                  the window object.  The listener can override this.\r
+ * @param {boolean} silent pass true to prevent the event from writing to\r
+ *                  the log system\r
+ * @namespace YAHOO.util\r
+ * @class CustomEvent\r
  * @constructor\r
  */\r
-YAHOO.util.CustomEvent = function(type, oScope, silent) {\r
+YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {\r
 \r
     /**\r
      * The type of event, returned to subscribers when the event fires\r
+     * @property type\r
      * @type string\r
      */\r
     this.type = type;\r
 \r
     /**\r
-     * The scope the the event will fire from by default.  Defaults to the window \r
+     * The scope the the event will fire from by default.  Defaults to the window\r
      * obj\r
+     * @property scope\r
      * @type object\r
      */\r
     this.scope = oScope || window;\r
@@ -36,43 +41,120 @@ YAHOO.util.CustomEvent = function(type, oScope, silent) {
     /**\r
      * By default all custom events are logged in the debug build, set silent\r
      * to true to disable logging for this event.\r
+     * @property silent\r
      * @type boolean\r
      */\r
     this.silent = silent;\r
 \r
+    /**\r
+     * Custom events support two styles of arguments provided to the event\r
+     * subscribers.\r
+     * <ul>\r
+     * <li>YAHOO.util.CustomEvent.LIST:\r
+     *   <ul>\r
+     *   <li>param1: event name</li>\r
+     *   <li>param2: array of arguments sent to fire</li>\r
+     *   <li>param3: <optional> a custom object supplied by the subscriber</li>\r
+     *   </ul>\r
+     * </li>\r
+     * <li>YAHOO.util.CustomEvent.FLAT\r
+     *   <ul>\r
+     *   <li>param1: the first argument passed to fire.  If you need to\r
+     *           pass multiple parameters, use and array or object literal</li>\r
+     *   <li>param2: <optional> a custom object supplied by the subscriber</li>\r
+     *   </ul>\r
+     * </li>\r
+     * </ul>\r
+     *   @property signature\r
+     *   @type int\r
+     */\r
+    this.signature = signature || YAHOO.util.CustomEvent.LIST;\r
+\r
     /**\r
      * The subscribers to this event\r
+     * @property subscribers\r
      * @type Subscriber[]\r
      */\r
     this.subscribers = [];\r
 \r
-    // Register with the event utility for automatic cleanup.  Made optional\r
-    // so that CustomEvent can be used independently of pe.event\r
-    if (YAHOO.util.Event) { \r
-        YAHOO.util.Event.regCE(this);\r
-    }\r
-\r
     if (!this.silent) {\r
         YAHOO.log( "Creating " + this, "info", "Event" );\r
     }\r
+\r
+    var onsubscribeType = "_YUICEOnSubscribe";\r
+\r
+    // Only add subscribe events for events that are not generated by\r
+    // CustomEvent\r
+    if (type !== onsubscribeType) {\r
+\r
+        /**\r
+         * Custom events provide a custom event that fires whenever there is\r
+         * a new subscriber to the event.  This provides an opportunity to\r
+         * handle the case where there is a non-repeating event that has\r
+         * already fired has a new subscriber.\r
+         *\r
+         * @event subscribeEvent\r
+         * @type YAHOO.util.CustomEvent\r
+         * @param {Function} fn The function to execute\r
+         * @param {Object}   obj An object to be passed along when the event\r
+         *                       fires\r
+         * @param {boolean|Object}  override If true, the obj passed in becomes\r
+         *                                   the execution scope of the listener.\r
+         *                                   if an object, that object becomes the\r
+         *                                   the execution scope.\r
+         */\r
+        this.subscribeEvent =\r
+                new YAHOO.util.CustomEvent(onsubscribeType, this, true);\r
+\r
+    }\r
 };\r
 \r
+/**\r
+ * Subscriber listener sigature constant.  The LIST type returns three\r
+ * parameters: the event type, the array of args passed to fire, and\r
+ * the optional custom object\r
+ * @property YAHOO.util.CustomEvent.LIST\r
+ * @static\r
+ * @type int\r
+ */\r
+YAHOO.util.CustomEvent.LIST = 0;\r
+\r
+/**\r
+ * Subscriber listener sigature constant.  The FLAT type returns two\r
+ * parameters: the first argument passed to fire and the optional\r
+ * custom object\r
+ * @property YAHOO.util.CustomEvent.FLAT\r
+ * @static\r
+ * @type int\r
+ */\r
+YAHOO.util.CustomEvent.FLAT = 1;\r
+\r
 YAHOO.util.CustomEvent.prototype = {\r
+\r
     /**\r
      * Subscribes the caller to this event\r
-     * @param {Function} fn       The function to execute\r
-     * @param {Object}   obj      An object to be passed along when the event fires\r
-     * @param {boolean}  bOverride If true, the obj passed in becomes the execution\r
-     *                            scope of the listener\r
+     * @method subscribe\r
+     * @param {Function} fn        The function to execute\r
+     * @param {Object}   obj       An object to be passed along when the event\r
+     *                             fires\r
+     * @param {boolean|Object}  override If true, the obj passed in becomes\r
+     *                                   the execution scope of the listener.\r
+     *                                   if an object, that object becomes the\r
+     *                                   the execution scope.\r
      */\r
-    subscribe: function(fn, obj, bOverride) {\r
-        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, bOverride) );\r
+    subscribe: function(fn, obj, override) {\r
+        if (this.subscribeEvent) {\r
+            this.subscribeEvent.fire(fn, obj, override);\r
+        }\r
+\r
+        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) );\r
     },\r
 \r
     /**\r
      * Unsubscribes the caller from this event\r
+     * @method unsubscribe\r
      * @param {Function} fn  The function to execute\r
-     * @param {Object}   obj An object to be passed along when the event fires\r
+     * @param {Object}   obj  The custom object passed to subscribe (optional)\r
      * @return {boolean} True if the subscriber was found and detached.\r
      */\r
     unsubscribe: function(fn, obj) {\r
@@ -90,30 +172,36 @@ YAHOO.util.CustomEvent.prototype = {
 \r
     /**\r
      * Notifies the subscribers.  The callback functions will be executed\r
-     * from the scope specified when the event was created, and with the following\r
-     * parameters:\r
-     *   <pre>\r
-     *   - The type of event\r
-     *   - All of the arguments fire() was executed with as an array\r
-     *   - The custom object (if any) that was passed into the subscribe() method\r
-     *   </pre>\r
-     *   \r
-     * @param {Array} an arbitrary set of parameters to pass to the handler\r
+     * from the scope specified when the event was created, and with the\r
+     * following parameters:\r
+     *   <ul>\r
+     *   <li>The type of event</li>\r
+     *   <li>All of the arguments fire() was executed with as an array</li>\r
+     *   <li>The custom object (if any) that was passed into the subscribe()\r
+     *       method</li>\r
+     *   </ul>\r
+     * @method fire\r
+     * @param {Object*} arguments an arbitrary set of parameters to pass to\r
+     *                            the handler.\r
      */\r
     fire: function() {\r
         var len=this.subscribers.length;\r
+        if (!len && this.silent) {\r
+            return true;\r
+        }\r
 \r
-        var args = [];\r
+        var args=[], ret=true, i;\r
 \r
-        for (var i=0; i<arguments.length; ++i) {\r
+        for (i=0; i<arguments.length; ++i) {\r
             args.push(arguments[i]);\r
         }\r
 \r
+        var argslength = args.length;\r
 \r
         if (!this.silent) {\r
-            YAHOO.log( "Firing "       + this  + ", " + \r
+            YAHOO.log( "Firing "       + this  + ", " +\r
                        "args: "        + args  + ", " +\r
-                       "subscribers: " + len,                 \r
+                       "subscribers: " + len,\r
                        "info", "Event"                  );\r
         }\r
 \r
@@ -121,24 +209,48 @@ YAHOO.util.CustomEvent.prototype = {
             var s = this.subscribers[i];\r
             if (s) {\r
                 if (!this.silent) {\r
-                    YAHOO.log( this.type + "->" + (i+1) + ": " +  s, "info", "Event" );\r
+                    YAHOO.log( this.type + "->" + (i+1) + ": " +  s,\r
+                                "info", "Event" );\r
+                }\r
+\r
+                var scope = s.getScope(this.scope);\r
+\r
+                if (this.signature == YAHOO.util.CustomEvent.FLAT) {\r
+                    var param = null;\r
+                    if (args.length > 0) {\r
+                        param = args[0];\r
+                    }\r
+                    ret = s.fn.call(scope, param, s.obj);\r
+                } else {\r
+                    ret = s.fn.call(scope, this.type, args, s.obj);\r
+                }\r
+                if (false === ret) {\r
+                    if (!this.silent) {\r
+                        YAHOO.log("Event cancelled, subscriber " + i +\r
+                                  " of " + len);\r
+                    }\r
+\r
+                    //break;\r
+                    return false;\r
                 }\r
-                var scope = (s.override) ? s.obj : this.scope;\r
-                s.fn.call(scope, this.type, args, s.obj);\r
             }\r
         }\r
+\r
+        return true;\r
     },\r
 \r
     /**\r
      * Removes all listeners\r
+     * @method unsubscribeAll\r
      */\r
     unsubscribeAll: function() {\r
         for (var i=0, len=this.subscribers.length; i<len; ++i) {\r
-            this._delete(i);\r
+            this._delete(len - 1 - i);\r
         }\r
     },\r
 \r
     /**\r
+     * @method _delete\r
      * @private\r
      */\r
     _delete: function(index) {\r
@@ -148,11 +260,15 @@ YAHOO.util.CustomEvent.prototype = {
             delete s.obj;\r
         }\r
 \r
-        delete this.subscribers[index];\r
+        // delete this.subscribers[index];\r
+        this.subscribers.splice(index, 1);\r
     },\r
 \r
+    /**\r
+     * @method toString\r
+     */\r
     toString: function() {\r
-         return "CustomEvent: " + "'" + this.type  + "', " + \r
+         return "CustomEvent: " + "'" + this.type  + "', " +\r
              "scope: " + this.scope;\r
 \r
     }\r
@@ -161,16 +277,19 @@ YAHOO.util.CustomEvent.prototype = {
 /////////////////////////////////////////////////////////////////////\r
 \r
 /**\r
- * @class Stores the subscriber information to be used when the event fires.\r
+ * Stores the subscriber information to be used when the event fires.\r
  * @param {Function} fn       The function to execute\r
  * @param {Object}   obj      An object to be passed along when the event fires\r
- * @param {boolean}  bOverride If true, the obj passed in becomes the execution\r
+ * @param {boolean}  override If true, the obj passed in becomes the execution\r
  *                            scope of the listener\r
+ * @class Subscriber\r
  * @constructor\r
  */\r
-YAHOO.util.Subscriber = function(fn, obj, bOverride) {\r
+YAHOO.util.Subscriber = function(fn, obj, override) {\r
+\r
     /**\r
      * The callback that will be execute when the event fires\r
+     * @property fn\r
      * @type function\r
      */\r
     this.fn = fn;\r
@@ -178,6 +297,7 @@ YAHOO.util.Subscriber = function(fn, obj, bOverride) {
     /**\r
      * An optional custom object that will passed to the callback when\r
      * the event fires\r
+     * @property obj\r
      * @type object\r
      */\r
     this.obj = obj || null;\r
@@ -186,88 +306,124 @@ YAHOO.util.Subscriber = function(fn, obj, bOverride) {
      * The default execution scope for the event listener is defined when the\r
      * event is created (usually the object which contains the event).\r
      * By setting override to true, the execution scope becomes the custom\r
-     * object passed in by the subscriber\r
-     * @type boolean\r
+     * object passed in by the subscriber.  If override is an object, that\r
+     * object becomes the scope.\r
+     * @property override\r
+     * @type boolean|object\r
      */\r
-    this.override = (bOverride);\r
+    this.override = override;\r
+\r
+};\r
+\r
+/**\r
+ * Returns the execution scope for this listener.  If override was set to true\r
+ * the custom obj will be the scope.  If override is an object, that is the\r
+ * scope, otherwise the default scope will be used.\r
+ * @method getScope\r
+ * @param {Object} defaultScope the scope to use if this listener does not\r
+ *                              override it.\r
+ */\r
+YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) {\r
+    if (this.override) {\r
+        if (this.override === true) {\r
+            return this.obj;\r
+        } else {\r
+            return this.override;\r
+        }\r
+    }\r
+    return defaultScope;\r
 };\r
 \r
 /**\r
  * Returns true if the fn and obj match this objects properties.\r
  * Used by the unsubscribe method to match the right subscriber.\r
  *\r
+ * @method contains\r
  * @param {Function} fn the function to execute\r
  * @param {Object} obj an object to be passed along when the event fires\r
- * @return {boolean} true if the supplied arguments match this \r
+ * @return {boolean} true if the supplied arguments match this\r
  *                   subscriber's signature.\r
  */\r
 YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {\r
-    return (this.fn == fn && this.obj == obj);\r
+    if (obj) {\r
+        return (this.fn == fn && this.obj == obj);\r
+    } else {\r
+        return (this.fn == fn);\r
+    }\r
 };\r
 \r
+/**\r
+ * @method toString\r
+ */\r
 YAHOO.util.Subscriber.prototype.toString = function() {\r
-    return "Subscriber { obj: " + (this.obj || "")  + \r
+    return "Subscriber { obj: " + (this.obj || "")  +\r
            ", override: " +  (this.override || "no") + " }";\r
 };\r
-// Only load this library once.  If it is loaded a second time, existing\r
-// events cannot be detached.\r
+\r
+/**\r
+ * The Event Utility provides utilities for managing DOM Events and tools\r
+ * for building event systems\r
+ *\r
+ * @module event\r
+ * @title Event Utility\r
+ * @namespace YAHOO.util\r
+ * @requires yahoo\r
+ */\r
+\r
+// The first instance of Event will win if it is loaded more than once.\r
 if (!YAHOO.util.Event) {\r
 \r
 /**\r
- * @class\r
  * The event utility provides functions to add and remove event listeners,\r
  * event cleansing.  It also tries to automatically remove listeners it\r
  * registers during the unload event.\r
- * @constructor\r
+ *\r
+ * @class Event\r
+ * @static\r
  */\r
     YAHOO.util.Event = function() {\r
 \r
         /**\r
          * True after the onload event has fired\r
+         * @property loadComplete\r
          * @type boolean\r
+         * @static\r
          * @private\r
          */\r
         var loadComplete =  false;\r
 \r
         /**\r
          * Cache of wrapped listeners\r
+         * @property listeners\r
          * @type array\r
+         * @static\r
          * @private\r
          */\r
         var listeners = [];\r
 \r
-        /**\r
-         * Listeners that will be attached during the onload event\r
-         * @type array\r
-         * @private\r
-         */\r
-        var delayedListeners = [];\r
-\r
         /**\r
          * User-defined unload function that will be fired before all events\r
          * are detached\r
+         * @property unloadListeners\r
          * @type array\r
+         * @static\r
          * @private\r
          */\r
         var unloadListeners = [];\r
 \r
-        /**\r
-         * Cache of the custom events that have been defined.  Used for\r
-         * automatic cleanup\r
-         * @type array\r
-         * @private\r
-         */\r
-        var customEvents = [];\r
-\r
         /**\r
          * Cache of DOM0 event handlers to work around issues with DOM2 events\r
          * in Safari\r
+         * @property legacyEvents\r
+         * @static\r
          * @private\r
          */\r
         var legacyEvents = [];\r
 \r
         /**\r
          * Listener stack for DOM0 events\r
+         * @property legacyHandlers\r
+         * @static\r
          * @private\r
          */\r
         var legacyHandlers = [];\r
@@ -276,24 +432,32 @@ if (!YAHOO.util.Event) {
          * The number of times to poll after window.onload.  This number is\r
          * increased if additional late-bound handlers are requested after\r
          * the page load.\r
+         * @property retryCount\r
+         * @static\r
          * @private\r
          */\r
         var retryCount = 0;\r
 \r
         /**\r
          * onAvailable listeners\r
+         * @property onAvailStack\r
+         * @static\r
          * @private\r
          */\r
         var onAvailStack = [];\r
 \r
         /**\r
          * Lookup table for legacy events\r
+         * @property legacyMap\r
+         * @static\r
          * @private\r
          */\r
         var legacyMap = [];\r
 \r
         /**\r
          * Counter for auto id generation\r
+         * @property counter\r
+         * @static\r
          * @private\r
          */\r
         var counter = 0;\r
@@ -303,100 +467,122 @@ if (!YAHOO.util.Event) {
             /**\r
              * The number of times we should look for elements that are not\r
              * in the DOM at the time the event is requested after the document\r
-             * has been loaded.  The default is 200@50 ms, so it will poll\r
+             * has been loaded.  The default is 200@amp;50 ms, so it will poll\r
              * for 10 seconds or until all outstanding handlers are bound\r
              * (whichever comes first).\r
+             * @property POLL_RETRYS\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             POLL_RETRYS: 200,\r
 \r
             /**\r
              * The poll interval in milliseconds\r
+             * @property POLL_INTERVAL\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
-            POLL_INTERVAL: 50,\r
+            POLL_INTERVAL: 20,\r
 \r
             /**\r
              * Element to bind, int constant\r
+             * @property EL\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             EL: 0,\r
 \r
             /**\r
              * Type of event, int constant\r
+             * @property TYPE\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             TYPE: 1,\r
 \r
             /**\r
              * Function to execute, int constant\r
+             * @property FN\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             FN: 2,\r
 \r
             /**\r
              * Function wrapped for scope correction and cleanup, int constant\r
+             * @property WFN\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             WFN: 3,\r
 \r
             /**\r
-             * Object passed in by the user that will be returned as a \r
+             * Object passed in by the user that will be returned as a\r
              * parameter to the callback, int constant\r
+             * @property OBJ\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
-            SCOPE: 3,\r
+            OBJ: 3,\r
 \r
             /**\r
              * Adjusted scope, either the element we are registering the event\r
              * on or the custom object passed in by the listener, int constant\r
+             * @property ADJ_SCOPE\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             ADJ_SCOPE: 4,\r
 \r
             /**\r
              * Safari detection is necessary to work around the preventDefault\r
-             * bug that makes it so you can't cancel a href click from the \r
+             * bug that makes it so you can't cancel a href click from the\r
              * handler.  There is not a capabilities check we can use here.\r
+             * @property isSafari\r
              * @private\r
+             * @static\r
              */\r
             isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),\r
 \r
             /**\r
-             * IE detection needed to properly calculate pageX and pageY.  \r
-             * capabilities checking didn't seem to work because another \r
-             * browser that does not provide the properties have the values \r
+             * IE detection needed to properly calculate pageX and pageY.\r
+             * capabilities checking didn't seem to work because another\r
+             * browser that does not provide the properties have the values\r
              * calculated in a different manner than IE.\r
+             * @property isIE\r
              * @private\r
+             * @static\r
              */\r
-            isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && \r
+            isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) &&\r
                     navigator.userAgent.match(/msie/gi)),\r
 \r
             /**\r
+             * poll handle\r
+             * @property _interval\r
              * @private\r
              */\r
-            addDelayedListener: function(el, sType, fn, oScope, bOverride) {\r
-                delayedListeners[delayedListeners.length] =\r
-                    [el, sType, fn, oScope, bOverride];\r
-\r
-                // If this happens after the inital page load, we need to\r
-                // reset the poll counter so that we continue to search for\r
-                // the element for a fixed period of time.\r
-                if (loadComplete) {\r
-                    retryCount = this.POLL_RETRYS;\r
-                    this.startTimeout(0);\r
-                    // this._tryPreloadAttach();\r
-                }\r
-            },\r
+            _interval: null,\r
 \r
             /**\r
+             * @method startInterval\r
+             * @static\r
              * @private\r
              */\r
-            startTimeout: function(interval) {\r
-                var i = (interval || interval === 0) ? interval : this.POLL_INTERVAL;\r
-                var self = this;\r
-                var callback = function() { self._tryPreloadAttach(); };\r
-                this.timeout = setTimeout(callback, i);\r
+            startInterval: function() {\r
+                if (!this._interval) {\r
+                    var self = this;\r
+                    var callback = function() { self._tryPreloadAttach(); };\r
+                    this._interval = setInterval(callback, this.POLL_INTERVAL);\r
+                    // this.timeout = setTimeout(callback, i);\r
+                }\r
             },\r
 \r
             /**\r
@@ -406,41 +592,76 @@ if (!YAHOO.util.Event) {
              * initial page load it will poll for a fixed time for the element.\r
              * The number of times it will poll and the frequency are\r
              * configurable.  By default it will poll for 10 seconds.\r
-             * @param {string} p_id the id of the element to look for.\r
+             *\r
+             * @method onAvailable\r
+             *\r
+             * @param {string}   p_id the id of the element to look for.\r
              * @param {function} p_fn what to execute when the element is found.\r
-             * @param {object} p_obj an optional object to be passed back as\r
-             * a parameter to p_fn.\r
-             * @param {boolean} p_override If set to true, p_fn will execute\r
-             * in the scope of p_obj\r
+             * @param {object}   p_obj an optional object to be passed back as\r
+             *                   a parameter to p_fn.\r
+             * @param {boolean}  p_override If set to true, p_fn will execute\r
+             *                   in the scope of p_obj\r
              *\r
+             * @static\r
              */\r
             onAvailable: function(p_id, p_fn, p_obj, p_override) {\r
-                onAvailStack.push( { id:       p_id, \r
-                                     fn:       p_fn, \r
-                                     obj:      p_obj, \r
-                                     override: p_override } );\r
+                onAvailStack.push( { id:         p_id,\r
+                                     fn:         p_fn,\r
+                                     obj:        p_obj,\r
+                                     override:   p_override,\r
+                                     checkReady: false    } );\r
 \r
                 retryCount = this.POLL_RETRYS;\r
-                this.startTimeout(0);\r
-                // this._tryPreloadAttach();\r
+                this.startInterval();\r
+            },\r
+\r
+            /**\r
+             * Works the same way as onAvailable, but additionally checks the\r
+             * state of sibling elements to determine if the content of the\r
+             * available element is safe to modify.\r
+             *\r
+             * @method onContentReady\r
+             *\r
+             * @param {string}   p_id the id of the element to look for.\r
+             * @param {function} p_fn what to execute when the element is ready.\r
+             * @param {object}   p_obj an optional object to be passed back as\r
+             *                   a parameter to p_fn.\r
+             * @param {boolean}  p_override If set to true, p_fn will execute\r
+             *                   in the scope of p_obj\r
+             *\r
+             * @static\r
+             */\r
+            onContentReady: function(p_id, p_fn, p_obj, p_override) {\r
+                onAvailStack.push( { id:         p_id,\r
+                                     fn:         p_fn,\r
+                                     obj:        p_obj,\r
+                                     override:   p_override,\r
+                                     checkReady: true      } );\r
+\r
+                retryCount = this.POLL_RETRYS;\r
+                this.startInterval();\r
             },\r
 \r
             /**\r
              * Appends an event handler\r
              *\r
-             * @param {Object}   el        The html element to assign the \r
+             * @method addListener\r
+             *\r
+             * @param {Object}   el        The html element to assign the\r
              *                             event to\r
              * @param {String}   sType     The type of event to append\r
              * @param {Function} fn        The method the event invokes\r
-             * @param {Object}   oScope    An arbitrary object that will be \r
+             * @param {Object}   obj    An arbitrary object that will be\r
              *                             passed as a parameter to the handler\r
-             * @param {boolean}  bOverride If true, the obj passed in becomes\r
+             * @param {boolean}  override  If true, the obj passed in becomes\r
              *                             the execution scope of the listener\r
              * @return {boolean} True if the action was successful or defered,\r
-             *                        false if one or more of the elements \r
+             *                        false if one or more of the elements\r
              *                        could not have the event bound to it.\r
+             * @static\r
              */\r
-            addListener: function(el, sType, fn, oScope, bOverride) {\r
+            addListener: function(el, sType, fn, obj, override) {\r
+\r
 \r
                 if (!fn || !fn.call) {\r
                     // this.logger.debug("Error, function is not valid " + fn);\r
@@ -451,51 +672,49 @@ if (!YAHOO.util.Event) {
                 if ( this._isValidCollection(el)) {\r
                     var ok = true;\r
                     for (var i=0,len=el.length; i<len; ++i) {\r
-                        ok = ( this.on(el[i], \r
-                                       sType, \r
-                                       fn, \r
-                                       oScope, \r
-                                       bOverride) && ok );\r
+                        ok = this.on(el[i],\r
+                                       sType,\r
+                                       fn,\r
+                                       obj,\r
+                                       override) && ok;\r
                     }\r
                     return ok;\r
 \r
                 } else if (typeof el == "string") {\r
                     var oEl = this.getEl(el);\r
-                    // If the el argument is a string, we assume it is \r
+                    // If the el argument is a string, we assume it is\r
                     // actually the id of the element.  If the page is loaded\r
-                    // we convert el to the actual element, otherwise we \r
+                    // we convert el to the actual element, otherwise we\r
                     // defer attaching the event until onload event fires\r
 \r
-                    // check to see if we need to delay hooking up the event \r
+                    // check to see if we need to delay hooking up the event\r
                     // until after the page loads.\r
-                    if (loadComplete && oEl) {\r
+                    if (oEl) {\r
                         el = oEl;\r
                     } else {\r
-                        // defer adding the event until onload fires\r
-                        this.addDelayedListener(el, \r
-                                                sType, \r
-                                                fn, \r
-                                                oScope, \r
-                                                bOverride);\r
+                        // defer adding the event until the element is available\r
+                        this.onAvailable(el, function() {\r
+                           YAHOO.util.Event.on(el, sType, fn, obj, override);\r
+                        });\r
 \r
                         return true;\r
                     }\r
                 }\r
 \r
-                // Element should be an html element or an array if we get \r
+                // Element should be an html element or an array if we get\r
                 // here.\r
                 if (!el) {\r
                     // this.logger.debug("unable to attach event " + sType);\r
                     return false;\r
                 }\r
 \r
-                // we need to make sure we fire registered unload events \r
-                // prior to automatically unhooking them.  So we hang on to \r
+                // we need to make sure we fire registered unload events\r
+                // prior to automatically unhooking them.  So we hang on to\r
                 // these instead of attaching them to the window and fire the\r
                 // handles explicitly during our one unload event.\r
-                if ("unload" == sType && oScope !== this) {\r
+                if ("unload" == sType && obj !== this) {\r
                     unloadListeners[unloadListeners.length] =\r
-                            [el, sType, fn, oScope, bOverride];\r
+                            [el, sType, fn, obj, override];\r
                     return true;\r
                 }\r
 \r
@@ -504,13 +723,20 @@ if (!YAHOO.util.Event) {
                 // if the user chooses to override the scope, we use the custom\r
                 // object passed in, otherwise the executing scope will be the\r
                 // HTML element that the event is registered on\r
-                var scope = (bOverride) ? oScope : el;\r
+                var scope = el;\r
+                if (override) {\r
+                    if (override === true) {\r
+                        scope = obj;\r
+                    } else {\r
+                        scope = override;\r
+                    }\r
+                }\r
 \r
-                // wrap the function so we can return the oScope object when\r
+                // wrap the function so we can return the obj object when\r
                 // the event fires;\r
                 var wrappedFn = function(e) {\r
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e), \r
-                                oScope);\r
+                        return fn.call(scope, YAHOO.util.Event.getEvent(e),\r
+                                obj);\r
                     };\r
 \r
                 var li = [el, sType, fn, wrappedFn, scope];\r
@@ -520,18 +746,22 @@ if (!YAHOO.util.Event) {
 \r
                 if (this.useLegacyEvent(el, sType)) {\r
                     var legacyIndex = this.getLegacyIndex(el, sType);\r
-                    if (legacyIndex == -1) {\r
+\r
+                    // Add a new dom0 wrapper if one is not detected for this\r
+                    // element\r
+                    if ( legacyIndex == -1 ||\r
+                                el != legacyEvents[legacyIndex][0] ) {\r
 \r
                         legacyIndex = legacyEvents.length;\r
                         legacyMap[el.id + sType] = legacyIndex;\r
 \r
-                        // cache the signature for the DOM0 event, and \r
+                        // cache the signature for the DOM0 event, and\r
                         // include the existing handler for the event, if any\r
-                        legacyEvents[legacyIndex] = \r
+                        legacyEvents[legacyIndex] =\r
                             [el, sType, el["on" + sType]];\r
                         legacyHandlers[legacyIndex] = [];\r
 \r
-                        el["on" + sType] = \r
+                        el["on" + sType] =\r
                             function(e) {\r
                                 YAHOO.util.Event.fireLegacyEvent(\r
                                     YAHOO.util.Event.getEvent(e), legacyIndex);\r
@@ -540,31 +770,22 @@ if (!YAHOO.util.Event) {
 \r
                     // add a reference to the wrapped listener to our custom\r
                     // stack of events\r
-                    legacyHandlers[legacyIndex].push(index);\r
-\r
-                // DOM2 Event model\r
-                } else if (el.addEventListener) {\r
-                    // this.logger.debug("adding DOM event: " + el.id + \r
-                    // ", " + sType);\r
-                    el.addEventListener(sType, wrappedFn, false);\r
-                // IE\r
-                } else if (el.attachEvent) {\r
-                    el.attachEvent("on" + sType, wrappedFn);\r
+                    //legacyHandlers[legacyIndex].push(index);\r
+                    legacyHandlers[legacyIndex].push(li);\r
+\r
+                } else {\r
+                    this._simpleAdd(el, sType, wrappedFn, false);\r
                 }\r
 \r
                 return true;\r
-                \r
-            },\r
 \r
-            /**\r
-             * Shorthand for YAHOO.util.Event.addListener\r
-             * @type function\r
-             */\r
-            // on: this.addListener,\r
+            },\r
 \r
             /**\r
              * When using legacy events, the handler is routed to this object\r
              * so we can fire our custom listener stack.\r
+             * @method fireLegacyEvent\r
+             * @static\r
              * @private\r
              */\r
             fireLegacyEvent: function(e, legacyIndex) {\r
@@ -573,20 +794,11 @@ if (!YAHOO.util.Event) {
 \r
                 var le = legacyHandlers[legacyIndex];\r
                 for (var i=0,len=le.length; i<len; ++i) {\r
-                    var index = le[i];\r
-                    // this.logger.debug(index);\r
-                    if (index) {\r
-                        var li = listeners[index];\r
-                        if ( li && li[this.WFN] ) {\r
-                            var scope = li[this.ADJ_SCOPE];\r
-                            var ret = li[this.WFN].call(scope, e);\r
-                            ok = (ok && ret);\r
-                        } else {\r
-                            // This listener was removed, so delete it from\r
-                            // the array\r
-                            delete le[i];\r
-                        }\r
-                        // this.logger.debug(ok);\r
+                    var li = le[i];\r
+                    if ( li && li[this.WFN] ) {\r
+                        var scope = li[this.ADJ_SCOPE];\r
+                        var ret = li[this.WFN].call(scope, e);\r
+                        ok = (ok && ret);\r
                     }\r
                 }\r
 \r
@@ -594,37 +806,29 @@ if (!YAHOO.util.Event) {
             },\r
 \r
             /**\r
-             * Returns the legacy event index that matches the supplied \r
+             * Returns the legacy event index that matches the supplied\r
              * signature\r
+             * @method getLegacyIndex\r
+             * @static\r
              * @private\r
              */\r
             getLegacyIndex: function(el, sType) {\r
-                /*\r
-                for (var i=0,len=legacyEvents.length; i<len; ++i) {\r
-                    var le = legacyEvents[i];\r
-                    if (le && le[0] === el && le[1] === sType) {\r
-                        return i;\r
-                    }\r
-                }\r
-                return -1;\r
-                */\r
-\r
                 var key = this.generateId(el) + sType;\r
-                if (typeof legacyMap[key] == "undefined") { \r
+                if (typeof legacyMap[key] == "undefined") {\r
                     return -1;\r
                 } else {\r
                     return legacyMap[key];\r
                 }\r
-\r
             },\r
 \r
             /**\r
              * Logic that determines when we should automatically use legacy\r
              * events instead of DOM2 events.\r
+             * @method useLegacyEvent\r
+             * @static\r
              * @private\r
              */\r
             useLegacyEvent: function(el, sType) {\r
-\r
                 if (!el.addEventListener && !el.attachEvent) {\r
                     return true;\r
                 } else if (this.isSafari) {\r
@@ -632,26 +836,26 @@ if (!YAHOO.util.Event) {
                         return true;\r
                     }\r
                 }\r
-\r
                 return false;\r
             },\r
-                    \r
+\r
             /**\r
              * Removes an event handler\r
              *\r
-             * @param {Object} el the html element or the id of the element to \r
+             * @method removeListener\r
+             *\r
+             * @param {Object} el the html element or the id of the element to\r
              * assign the event to.\r
-             * @param {String} sType the type of event to remove\r
-             * @param {Function} fn the method the event invokes\r
-             * @return {boolean} true if the unbind was successful, false \r
-             * otherwise\r
+             * @param {String} sType the type of event to remove.\r
+             * @param {Function} fn the method the event invokes.  If fn is\r
+             * undefined, then all event handlers for the type of event are\r
+             * removed.\r
+             * @return {boolean} true if the unbind was successful, false\r
+             * otherwise.\r
+             * @static\r
              */\r
-            removeListener: function(el, sType, fn, index) {\r
-\r
-                if (!fn || !fn.call) {\r
-                    // this.logger.debug("Error, function is not valid " + fn);\r
-                    return false;\r
-                }\r
+            removeListener: function(el, sType, fn) {\r
+                var i, len;\r
 \r
                 // The el argument can be a string\r
                 if (typeof el == "string") {\r
@@ -659,21 +863,28 @@ if (!YAHOO.util.Event) {
                 // The el argument can be an array of elements or element ids.\r
                 } else if ( this._isValidCollection(el)) {\r
                     var ok = true;\r
-                    for (var i=0,len=el.length; i<len; ++i) {\r
+                    for (i=0,len=el.length; i<len; ++i) {\r
                         ok = ( this.removeListener(el[i], sType, fn) && ok );\r
                     }\r
                     return ok;\r
                 }\r
 \r
+                if (!fn || !fn.call) {\r
+                    // this.logger.debug("Error, function is not valid " + fn);\r
+                    //return false;\r
+                    return this.purgeElement(el, false, sType);\r
+                }\r
+\r
+\r
                 if ("unload" == sType) {\r
 \r
                     for (i=0, len=unloadListeners.length; i<len; i++) {\r
                         var li = unloadListeners[i];\r
-                        if (li && \r
-                            li[0] == el && \r
-                            li[1] == sType && \r
+                        if (li &&\r
+                            li[0] == el &&\r
+                            li[1] == sType &&\r
                             li[2] == fn) {\r
-                                delete unloadListeners[i];\r
+                                unloadListeners.splice(i, 1);\r
                                 return true;\r
                         }\r
                     }\r
@@ -682,7 +893,12 @@ if (!YAHOO.util.Event) {
                 }\r
 \r
                 var cacheItem = null;\r
-  \r
+\r
+                // The index is a hidden parameter; needed to remove it from\r
+                // the method signature because it was tempting users to\r
+                // try and take advantage of it, which is not possible.\r
+                var index = arguments[3];\r
+\r
                 if ("undefined" == typeof index) {\r
                     index = this._getCacheIndex(el, sType, fn);\r
                 }\r
@@ -698,17 +914,30 @@ if (!YAHOO.util.Event) {
 \r
                 // this.logger.debug("Removing handler: " + el + ", " + sType);\r
 \r
-                if (el.removeEventListener) {\r
-                    el.removeEventListener(sType, cacheItem[this.WFN], false);\r
-                    // this.logger.debug("adsf");\r
-                } else if (el.detachEvent) {\r
-                    el.detachEvent("on" + sType, cacheItem[this.WFN]);\r
+                if (this.useLegacyEvent(el, sType)) {\r
+                    var legacyIndex = this.getLegacyIndex(el, sType);\r
+                    var llist = legacyHandlers[legacyIndex];\r
+                    if (llist) {\r
+                        for (i=0, len=llist.length; i<len; ++i) {\r
+                            li = llist[i];\r
+                            if (li &&\r
+                                li[this.EL] == el &&\r
+                                li[this.TYPE] == sType &&\r
+                                li[this.FN] == fn) {\r
+                                    llist.splice(i, 1);\r
+                                    break;\r
+                            }\r
+                        }\r
+                    }\r
+\r
+                } else {\r
+                    this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
                 }\r
 \r
                 // removed the wrapped handler\r
                 delete listeners[index][this.WFN];\r
                 delete listeners[index][this.FN];\r
-                delete listeners[index];\r
+                listeners.splice(index, 1);\r
 \r
                 return true;\r
 \r
@@ -716,12 +945,14 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's target element\r
+             * @method getTarget\r
              * @param {Event} ev the event\r
              * @param {boolean} resolveTextNode when set to true the target's\r
-             *                  parent will be returned if the target is a \r
+             *                  parent will be returned if the target is a\r
              *                  text node.  @deprecated, the text node is\r
              *                  now resolved automatically\r
              * @return {HTMLElement} the event's target\r
+             * @static\r
              */\r
             getTarget: function(ev, resolveTextNode) {\r
                 var t = ev.target || ev.srcElement;\r
@@ -732,12 +963,15 @@ if (!YAHOO.util.Event) {
              * In some cases, some browsers will return a text node inside\r
              * the actual element that was targeted.  This normalizes the\r
              * return value for getTarget and getRelatedTarget.\r
-             * @param {HTMLElement} node to resolve\r
-             * @return  the normized node\r
+             * @method resolveTextNode\r
+             * @param {HTMLElement} node node to resolve\r
+             * @return {HTMLElement} the normized node\r
+             * @static\r
              */\r
             resolveTextNode: function(node) {\r
-                if (node && node.nodeName && \r
-                        "#TEXT" == node.nodeName.toUpperCase()) {\r
+                // if (node && node.nodeName &&\r
+                        // "#TEXT" == node.nodeName.toUpperCase()) {\r
+                if (node && 3 == node.nodeType) {\r
                     return node.parentNode;\r
                 } else {\r
                     return node;\r
@@ -746,8 +980,10 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's pageX\r
+             * @method getPageX\r
              * @param {Event} ev the event\r
              * @return {int} the event's pageX\r
+             * @static\r
              */\r
             getPageX: function(ev) {\r
                 var x = ev.pageX;\r
@@ -764,8 +1000,10 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's pageY\r
+             * @method getPageY\r
              * @param {Event} ev the event\r
              * @return {int} the event's pageY\r
+             * @static\r
              */\r
             getPageY: function(ev) {\r
                 var y = ev.pageY;\r
@@ -783,16 +1021,20 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the pageX and pageY properties as an indexed array.\r
+             * @method getXY\r
              * @type int[]\r
+             * @static\r
              */\r
             getXY: function(ev) {\r
                 return [this.getPageX(ev), this.getPageY(ev)];\r
             },\r
 \r
             /**\r
-             * Returns the event's related target \r
+             * Returns the event's related target\r
+             * @method getRelatedTarget\r
              * @param {Event} ev the event\r
              * @return {HTMLElement} the event's relatedTarget\r
+             * @static\r
              */\r
             getRelatedTarget: function(ev) {\r
                 var t = ev.relatedTarget;\r
@@ -810,16 +1052,17 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns the time of the event.  If the time is not included, the\r
              * event is modified using the current time.\r
+             * @method getTime\r
              * @param {Event} ev the event\r
              * @return {Date} the time of the event\r
+             * @static\r
              */\r
             getTime: function(ev) {\r
                 if (!ev.time) {\r
                     var t = new Date().getTime();\r
                     try {\r
                         ev.time = t;\r
-                    } catch(e) { \r
-                        // can't set the time property  \r
+                    } catch(e) {\r
                         return t;\r
                     }\r
                 }\r
@@ -829,7 +1072,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Convenience method for stopPropagation + preventDefault\r
+             * @method stopEvent\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             stopEvent: function(ev) {\r
                 this.stopPropagation(ev);\r
@@ -838,7 +1083,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Stops event propagation\r
+             * @method stopPropagation\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             stopPropagation: function(ev) {\r
                 if (ev.stopPropagation) {\r
@@ -850,7 +1097,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Prevents the default behavior of the event\r
+             * @method preventDefault\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             preventDefault: function(ev) {\r
                 if (ev.preventDefault) {\r
@@ -859,15 +1108,17 @@ if (!YAHOO.util.Event) {
                     ev.returnValue = false;\r
                 }\r
             },\r
-             \r
+\r
             /**\r
              * Finds the event in the window object, the caller's arguments, or\r
              * in the arguments of another method in the callstack.  This is\r
              * executed automatically for events registered through the event\r
              * manager, so the implementer should not normally need to execute\r
              * this function at all.\r
-             * @param {Event} the event parameter from the handler\r
-             * @return {Event} the event \r
+             * @method getEvent\r
+             * @param {Event} e the event parameter from the handler\r
+             * @return {Event} the event\r
+             * @static\r
              */\r
             getEvent: function(e) {\r
                 var ev = e || window.event;\r
@@ -888,23 +1139,28 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the charcode for an event\r
+             * @method getCharCode\r
              * @param {Event} ev the event\r
              * @return {int} the event's charCode\r
+             * @static\r
              */\r
             getCharCode: function(ev) {\r
-                return ev.charCode || ((ev.type == "keypress") ? ev.keyCode : 0);\r
+                return ev.charCode || ev.keyCode || 0;\r
             },\r
 \r
             /**\r
-             * @private\r
              * Locating the saved event handler data by function ref\r
+             *\r
+             * @method _getCacheIndex\r
+             * @static\r
+             * @private\r
              */\r
             _getCacheIndex: function(el, sType, fn) {\r
                 for (var i=0,len=listeners.length; i<len; ++i) {\r
                     var li = listeners[i];\r
-                    if ( li                 && \r
-                         li[this.FN] == fn  && \r
-                         li[this.EL] == el  && \r
+                    if ( li                 &&\r
+                         li[this.FN] == fn  &&\r
+                         li[this.EL] == el  &&\r
                          li[this.TYPE] == sType ) {\r
                         return i;\r
                     }\r
@@ -914,10 +1170,12 @@ if (!YAHOO.util.Event) {
             },\r
 \r
             /**\r
-             * Generates an unique ID for the element if it does not already \r
+             * Generates an unique ID for the element if it does not already\r
              * have one.\r
-             * @param el the element\r
-             * @return {string} the id of the element\r
+             * @method generateId\r
+             * @param el the element to create the id for\r
+             * @return {string} the resulting id of the element\r
+             * @static\r
              */\r
             generateId: function(el) {\r
                 var id = el.id;\r
@@ -934,12 +1192,14 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * We want to be able to use getElementsByTagName as a collection\r
-             * to attach a group of events to.  Unfortunately, different \r
+             * to attach a group of events to.  Unfortunately, different\r
              * browsers return different types of collections.  This function\r
-             * tests to determine if the object is array-like.  It will also \r
+             * tests to determine if the object is array-like.  It will also\r
              * fail if the object is an array, but is empty.\r
+             * @method _isValidCollection\r
              * @param o the object to test\r
              * @return {boolean} true if the object is array-like and populated\r
+             * @static\r
              * @private\r
              */\r
             _isValidCollection: function(o) {\r
@@ -957,13 +1217,17 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * @private\r
+             * @property elCache\r
              * DOM element cache\r
+             * @static\r
              */\r
             elCache: {},\r
 \r
             /**\r
-             * We cache elements bound by id because when the unload event \r
+             * We cache elements bound by id because when the unload event\r
              * fires, we can no longer use document.getElementById\r
+             * @method getEl\r
+             * @static\r
              * @private\r
              */\r
             getEl: function(id) {\r
@@ -972,35 +1236,35 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Clears the element cache\r
-             * @deprecated\r
+             * @deprecated Elements are not cached any longer\r
+             * @method clearCache\r
+             * @static\r
              * @private\r
              */\r
             clearCache: function() { },\r
 \r
             /**\r
-             * Called by CustomEvent instances to provide a handle to the \r
-             * event * that can be removed later on.  Should be package \r
-             * protected.\r
-             * @private\r
-             */\r
-            regCE: function(ce) {\r
-                customEvents.push(ce);\r
-            },\r
-\r
-            /**\r
-             * @private\r
              * hook up any deferred listeners\r
+             * @method _load\r
+             * @static\r
+             * @private\r
              */\r
             _load: function(e) {\r
-                // me.logger = new ygLogger("pe.Event");\r
-                //me.logger.debug([this.isSafari, this.isOpera, this.isIE]);\r
                 loadComplete = true;\r
+                var EU = YAHOO.util.Event;\r
+                // Remove the listener to assist with the IE memory issue, but not\r
+                // for other browsers because FF 1.0x does not like it.\r
+                if (this.isIE) {\r
+                    EU._simpleRemove(window, "load", EU._load);\r
+                }\r
             },\r
 \r
             /**\r
-             * Polling function that runs before the onload event fires, \r
-             * attempting to attach to DOM Nodes as soon as they are \r
+             * Polling function that runs before the onload event fires,\r
+             * attempting to attach to DOM Nodes as soon as they are\r
              * available\r
+             * @method _tryPreloadAttach\r
+             * @static\r
              * @private\r
              */\r
             _tryPreloadAttach: function() {\r
@@ -1013,63 +1277,54 @@ if (!YAHOO.util.Event) {
 \r
                 // this.logger.debug("tryPreloadAttach");\r
 \r
-                // keep trying until after the page is loaded.  We need to \r
-                // check the page load state prior to trying to bind the \r
-                // elements so that we can be certain all elements have been \r
+                // keep trying until after the page is loaded.  We need to\r
+                // check the page load state prior to trying to bind the\r
+                // elements so that we can be certain all elements have been\r
                 // tested appropriately\r
                 var tryAgain = !loadComplete;\r
                 if (!tryAgain) {\r
                     tryAgain = (retryCount > 0);\r
                 }\r
 \r
-                // Delayed listeners\r
-                var stillDelayed = [];\r
-\r
-                for (var i=0,len=delayedListeners.length; i<len; ++i) {\r
-                    var d = delayedListeners[i];\r
-                    // There may be a race condition here, so we need to \r
-                    // verify the array element is usable.\r
-                    if (d) {\r
-\r
-                        // el will be null if document.getElementById did not\r
-                        // work\r
-                        var el = this.getEl(d[this.EL]);\r
-\r
-                        if (el) {\r
-                            // this.logger.debug("attaching: " + d[this.EL]);\r
-                            this.on(el, d[this.TYPE], d[this.FN], \r
-                                    d[this.SCOPE], d[this.ADJ_SCOPE]);\r
-                            delete delayedListeners[i];\r
-                        } else {\r
-                            stillDelayed.push(d);\r
-                        }\r
-                    }\r
-                }\r
-\r
-                delayedListeners = stillDelayed;\r
-\r
                 // onAvailable\r
                 var notAvail = [];\r
-                for (i=0,len=onAvailStack.length; i<len ; ++i) {\r
+                for (var i=0,len=onAvailStack.length; i<len ; ++i) {\r
                     var item = onAvailStack[i];\r
                     if (item) {\r
-                        el = this.getEl(item.id);\r
+                        var el = this.getEl(item.id);\r
 \r
                         if (el) {\r
-                            var scope = (item.override) ? item.obj : el;\r
-                            item.fn.call(scope, item.obj);\r
-                            delete onAvailStack[i];\r
+                            // The element is available, but not necessarily ready\r
+\r
+                            if ( !item.checkReady ||\r
+                                    loadComplete ||\r
+                                    el.nextSibling ||\r
+                                    (document && document.body) ) {\r
+\r
+                                var scope = el;\r
+                                if (item.override) {\r
+                                    if (item.override === true) {\r
+                                        scope = item.obj;\r
+                                    } else {\r
+                                        scope = item.override;\r
+                                    }\r
+                                }\r
+                                item.fn.call(scope, item.obj);\r
+                                delete onAvailStack[i];\r
+                            }\r
                         } else {\r
                             notAvail.push(item);\r
                         }\r
                     }\r
                 }\r
 \r
-                retryCount = (stillDelayed.length === 0 && \r
-                                    notAvail.length === 0) ? 0 : retryCount - 1;\r
+                retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;\r
 \r
                 if (tryAgain) {\r
-                    this.startTimeout();\r
+                    this.startInterval();\r
+                } else {\r
+                    clearInterval(this._interval);\r
+                    this._interval = null;\r
                 }\r
 \r
                 this.locked = false;\r
@@ -1082,18 +1337,22 @@ if (!YAHOO.util.Event) {
              * Removes all listeners attached to the given element via addListener.\r
              * Optionally, the node's children can also be purged.\r
              * Optionally, you can specify a specific type of event to remove.\r
+             * @method purgeElement\r
              * @param {HTMLElement} el the element to purge\r
              * @param {boolean} recurse recursively purge this element's children\r
              * as well.  Use with caution.\r
              * @param {string} sType optional type of listener to purge. If\r
              * left out, all listeners will be removed\r
+             * @static\r
              */\r
             purgeElement: function(el, recurse, sType) {\r
                 var elListeners = this.getListeners(el, sType);\r
                 if (elListeners) {\r
                     for (var i=0,len=elListeners.length; i<len ; ++i) {\r
                         var l = elListeners[i];\r
-                        this.removeListener(el, l.type, l.fn, l.index);\r
+                        // can't use the index on the changing collection\r
+                        //this.removeListener(el, l.type, l.fn, l.index);\r
+                        this.removeListener(el, l.type, l.fn);\r
                     }\r
                 }\r
 \r
@@ -1107,27 +1366,29 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns all listeners attached to the given element via addListener.\r
              * Optionally, you can specify a specific type of event to return.\r
-             * @param el {HTMLElement} the element to inspect \r
+             * @method getListeners\r
+             * @param el {HTMLElement} the element to inspect\r
              * @param sType {string} optional type of listener to return. If\r
              * left out, all listeners will be returned\r
              * @return {Object} the listener. Contains the following fields:\r
-             *    type:   (string)   the type of event\r
-             *    fn:     (function) the callback supplied to addListener\r
-             *    obj:    (object)   the custom object supplied to addListener\r
-             *    adjust: (boolean)  whether or not to adjust the default scope\r
-             *    index:  (int)      its position in the Event util listener cache\r
-             */           \r
+             * &nbsp;&nbsp;type:   (string)   the type of event\r
+             * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener\r
+             * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener\r
+             * &nbsp;&nbsp;adjust: (boolean)  whether or not to adjust the default scope\r
+             * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache\r
+             * @static\r
+             */\r
             getListeners: function(el, sType) {\r
                 var elListeners = [];\r
                 if (listeners && listeners.length > 0) {\r
                     for (var i=0,len=listeners.length; i<len ; ++i) {\r
                         var l = listeners[i];\r
-                        if ( l  && l[this.EL] === el && \r
+                        if ( l  && l[this.EL] === el &&\r
                                 (!sType || sType === l[this.TYPE]) ) {\r
                             elListeners.push({\r
                                 type:   l[this.TYPE],\r
                                 fn:     l[this.FN],\r
-                                obj:    l[this.SCOPE],\r
+                                obj:    l[this.OBJ],\r
                                 adjust: l[this.ADJ_SCOPE],\r
                                 index:  i\r
                             });\r
@@ -1139,34 +1400,48 @@ if (!YAHOO.util.Event) {
             },\r
 \r
             /**\r
-             * Removes all listeners registered by pe.event.  Called \r
+             * Removes all listeners registered by pe.event.  Called\r
              * automatically during the unload event.\r
+             * @method _unload\r
+             * @static\r
              * @private\r
              */\r
-            _unload: function(e, me) {\r
-                for (var i=0,len=unloadListeners.length; i<len; ++i) {\r
-                    var l = unloadListeners[i];\r
+            _unload: function(e) {\r
+\r
+                var EU = YAHOO.util.Event, i, j, l, len, index;\r
+\r
+                for (i=0,len=unloadListeners.length; i<len; ++i) {\r
+                    l = unloadListeners[i];\r
                     if (l) {\r
-                        var scope = (l[this.ADJ_SCOPE]) ? l[this.SCOPE]: window;\r
-                        l[this.FN].call(scope, this.getEvent(e), l[this.SCOPE] );\r
+                        var scope = window;\r
+                        if (l[EU.ADJ_SCOPE]) {\r
+                            if (l[EU.ADJ_SCOPE] === true) {\r
+                                scope = l[EU.OBJ];\r
+                            } else {\r
+                                scope = l[EU.ADJ_SCOPE];\r
+                            }\r
+                        }\r
+                        l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );\r
+                        delete unloadListeners[i];\r
+                        l=null;\r
+                        scope=null;\r
                     }\r
                 }\r
 \r
                 if (listeners && listeners.length > 0) {\r
-                    for (i=0,len=listeners.length; i<len ; ++i) {\r
-                        l = listeners[i];\r
+                    j = listeners.length;\r
+                    while (j) {\r
+                        index = j-1;\r
+                        l = listeners[index];\r
                         if (l) {\r
-                            this.removeListener(l[this.EL], l[this.TYPE], \r
-                                    l[this.FN], i);\r
+                            EU.removeListener(l[EU.EL], l[EU.TYPE],\r
+                                    l[EU.FN], index);\r
                         }\r
+                        j = j - 1;\r
                     }\r
+                    l=null;\r
 \r
-                    this.clearCache();\r
-                }\r
-\r
-                for (i=0,len=customEvents.length; i<len; ++i) {\r
-                    customEvents[i].unsubscribeAll();\r
-                    delete customEvents[i];\r
+                    EU.clearCache();\r
                 }\r
 \r
                 for (i=0,len=legacyEvents.length; i<len; ++i) {\r
@@ -1175,10 +1450,15 @@ if (!YAHOO.util.Event) {
                     // delete the array item\r
                     delete legacyEvents[i];\r
                 }\r
+\r
+                EU._simpleRemove(window, "unload", EU._unload);\r
+\r
             },\r
 \r
             /**\r
              * Returns scrollLeft\r
+             * @method _getScrollLeft\r
+             * @static\r
              * @private\r
              */\r
             _getScrollLeft: function() {\r
@@ -1187,6 +1467,8 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns scrollTop\r
+             * @method _getScrollTop\r
+             * @static\r
              * @private\r
              */\r
             _getScrollTop: function() {\r
@@ -1194,39 +1476,291 @@ if (!YAHOO.util.Event) {
             },\r
 \r
             /**\r
-             * Returns the scrollTop and scrollLeft.  Used to calculate the \r
+             * Returns the scrollTop and scrollLeft.  Used to calculate the\r
              * pageX and pageY in Internet Explorer\r
+             * @method _getScroll\r
+             * @static\r
              * @private\r
              */\r
             _getScroll: function() {\r
-                var dd = document.documentElement; db = document.body;\r
-                if (dd && dd.scrollTop) {\r
+                var dd = document.documentElement, db = document.body;\r
+                if (dd && (dd.scrollTop || dd.scrollLeft)) {\r
                     return [dd.scrollTop, dd.scrollLeft];\r
                 } else if (db) {\r
                     return [db.scrollTop, db.scrollLeft];\r
                 } else {\r
                     return [0, 0];\r
                 }\r
-            }\r
+            },\r
+\r
+            /**\r
+             * Adds a DOM event directly without the caching, cleanup, scope adj, etc\r
+             *\r
+             * @method _simpleAdd\r
+             * @param {HTMLElement} el      the element to bind the handler to\r
+             * @param {string}      sType   the type of event handler\r
+             * @param {function}    fn      the callback to invoke\r
+             * @param {boolen}      capture capture or bubble phase\r
+             * @static\r
+             * @private\r
+             */\r
+            _simpleAdd: function () {\r
+                if (window.addEventListener) {\r
+                    return function(el, sType, fn, capture) {\r
+                        el.addEventListener(sType, fn, (capture));\r
+                    };\r
+                } else if (window.attachEvent) {\r
+                    return function(el, sType, fn, capture) {\r
+                        el.attachEvent("on" + sType, fn);\r
+                    };\r
+                } else {\r
+                    return function(){};\r
+                }\r
+            }(),\r
+\r
+            /**\r
+             * Basic remove listener\r
+             *\r
+             * @method _simpleRemove\r
+             * @param {HTMLElement} el      the element to bind the handler to\r
+             * @param {string}      sType   the type of event handler\r
+             * @param {function}    fn      the callback to invoke\r
+             * @param {boolen}      capture capture or bubble phase\r
+             * @static\r
+             * @private\r
+             */\r
+            _simpleRemove: function() {\r
+                if (window.removeEventListener) {\r
+                    return function (el, sType, fn, capture) {\r
+                        el.removeEventListener(sType, fn, (capture));\r
+                    };\r
+                } else if (window.detachEvent) {\r
+                    return function (el, sType, fn) {\r
+                        el.detachEvent("on" + sType, fn);\r
+                    };\r
+                } else {\r
+                    return function(){};\r
+                }\r
+            }()\r
         };\r
-    } ();\r
+\r
+    }();\r
+\r
+    (function() {\r
+        var EU = YAHOO.util.Event;\r
+\r
+        /**\r
+         * YAHOO.util.Event.on is an alias for addListener\r
+         * @method on\r
+         * @see addListener\r
+         * @static\r
+         */\r
+        EU.on = EU.addListener;\r
+\r
+        // YAHOO.mix(EU, YAHOO.util.EventProvider.prototype);\r
+        // EU.createEvent("DOMContentReady");\r
+        // EU.subscribe("DOMContentReady", EU._load);\r
+\r
+        if (document && document.body) {\r
+            EU._load();\r
+        } else {\r
+            // EU._simpleAdd(document, "DOMContentLoaded", EU._load);\r
+            EU._simpleAdd(window, "load", EU._load);\r
+        }\r
+        EU._simpleAdd(window, "unload", EU._unload);\r
+        EU._tryPreloadAttach();\r
+    })();\r
+}\r
+\r
+/**\r
+ * EventProvider is designed to be used with YAHOO.augment to wrap\r
+ * CustomEvents in an interface that allows events to be subscribed to\r
+ * and fired by name.  This makes it possible for implementing code to\r
+ * subscribe to an event that either has not been created yet, or will\r
+ * not be created at all.\r
+ *\r
+ * @Class EventProvider\r
+ */\r
+YAHOO.util.EventProvider = function() { };\r
+\r
+YAHOO.util.EventProvider.prototype = {\r
 \r
     /**\r
+     * Private storage of custom events\r
+     * @property __yui_events\r
+     * @type Object[]\r
      * @private\r
      */\r
-    YAHOO.util.Event.on = YAHOO.util.Event.addListener;\r
+    __yui_events: null,\r
 \r
-    if (document && document.body) {\r
-        YAHOO.util.Event._load();\r
-    } else {\r
-        YAHOO.util.Event.on(window, "load", YAHOO.util.Event._load, \r
-                YAHOO.util.Event, true);\r
-    }\r
+    /**\r
+     * Private storage of custom event subscribers\r
+     * @property __yui_subscribers\r
+     * @type Object[]\r
+     * @private\r
+     */\r
+    __yui_subscribers: null,\r
+\r
+    /**\r
+     * Subscribe to a CustomEvent by event type\r
+     *\r
+     * @method subscribe\r
+     * @param p_type     {string}   the type, or name of the event\r
+     * @param p_fn       {function} the function to exectute when the event fires\r
+     * @param p_obj\r
+     * @param p_obj      {Object}   An object to be passed along when the event\r
+     *                              fires\r
+     * @param p_override {boolean}  If true, the obj passed in becomes the\r
+     *                              execution scope of the listener\r
+     */\r
+    subscribe: function(p_type, p_fn, p_obj, p_override) {\r
+\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+\r
+        if (ce) {\r
+            ce.subscribe(p_fn, p_obj, p_override);\r
+        } else {\r
+            this.__yui_subscribers = this.__yui_subscribers || {};\r
+            var subs = this.__yui_subscribers;\r
+            if (!subs[p_type]) {\r
+                subs[p_type] = [];\r
+            }\r
+            subs[p_type].push(\r
+                { fn: p_fn, obj: p_obj, override: p_override } );\r
+        }\r
+    },\r
 \r
-    YAHOO.util.Event.on(window, "unload", YAHOO.util.Event._unload, \r
-                YAHOO.util.Event, true);\r
+    /**\r
+     * Unsubscribes the from the specified event\r
+     * @method unsubscribe\r
+     * @param p_type {string}   The type, or name of the event\r
+     * @param p_fn   {Function} The function to execute\r
+     * @param p_obj  {Object}   The custom object passed to subscribe (optional)\r
+     * @return {boolean} true if the subscriber was found and detached.\r
+     */\r
+    unsubscribe: function(p_type, p_fn, p_obj) {\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+        if (ce) {\r
+            return ce.unsubscribe(p_fn, p_obj);\r
+        } else {\r
+            return false;\r
+        }\r
+    },\r
 \r
-    YAHOO.util.Event._tryPreloadAttach();\r
+    /**\r
+     * Creates a new custom event of the specified type.  If a custom event\r
+     * by that name already exists, it will not be re-created.  In either\r
+     * case the custom event is returned.\r
+     *\r
+     * @method createEvent\r
+     *\r
+     * @param p_type {string} the type, or name of the event\r
+     * @param p_config {object} optional config params.  Valid properties are:\r
+     *\r
+     *  <ul>\r
+     *    <li>\r
+     *      scope: defines the default execution scope.  If not defined\r
+     *      the default scope will be this instance.\r
+     *    </li>\r
+     *    <li>\r
+     *      silent: if true, the custom event will not generate log messages.\r
+     *      This is false by default.\r
+     *    </li>\r
+     *    <li>\r
+     *      onSubscribeCallback: specifies a callback to execute when the\r
+     *      event has a new subscriber.  This will fire immediately for\r
+     *      each queued subscriber if any exist prior to the creation of\r
+     *      the event.\r
+     *    </li>\r
+     *  </ul>\r
+     *\r
+     *  @return {CustomEvent} the custom event\r
+     *\r
+     */\r
+    createEvent: function(p_type, p_config) {\r
 \r
-}\r
+        this.__yui_events = this.__yui_events || {};\r
+        var opts = p_config || {};\r
+        var events = this.__yui_events;\r
+\r
+        if (events[p_type]) {\r
+            YAHOO.log("EventProvider: error, event already exists");\r
+        } else {\r
+\r
+            var scope  = opts.scope  || this;\r
+            var silent = opts.silent || null;\r
+\r
+            var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,\r
+                    YAHOO.util.CustomEvent.FLAT);\r
+            events[p_type] = ce;\r
+\r
+            if (opts.onSubscribeCallback) {\r
+                ce.subscribeEvent.subscribe(opts.onSubscribeCallback);\r
+            }\r
+\r
+            this.__yui_subscribers = this.__yui_subscribers || {};\r
+            var qs = this.__yui_subscribers[p_type];\r
+\r
+            if (qs) {\r
+                for (var i=0; i<qs.length; ++i) {\r
+                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].override);\r
+                }\r
+            }\r
+        }\r
+\r
+        return events[p_type];\r
+    },\r
+\r
+\r
+   /**\r
+     * Fire a custom event by name.  The callback functions will be executed\r
+     * from the scope specified when the event was created, and with the\r
+     * following parameters:\r
+     *   <ul>\r
+     *   <li>The first argument fire() was executed with</li>\r
+     *   <li>The custom object (if any) that was passed into the subscribe()\r
+     *       method</li>\r
+     *   </ul>\r
+     * @method fireEvent\r
+     * @param p_type    {string}  the type, or name of the event\r
+     * @param arguments {Object*} an arbitrary set of parameters to pass to\r
+     *                            the handler.\r
+     * @return {boolean} the return value from CustomEvent.fire, or null if\r
+     *                   the custom event does not exist.\r
+     */\r
+    fireEvent: function(p_type, arg1, arg2, etc) {\r
+\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+\r
+        if (ce) {\r
+            var args = [];\r
+            for (var i=1; i<arguments.length; ++i) {\r
+                args.push(arguments[i]);\r
+            }\r
+            return ce.fire.apply(ce, args);\r
+        } else {\r
+            YAHOO.log("EventProvider.fire could not find event: " + p_type);\r
+            return null;\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Returns true if the custom event of the provided type has been created\r
+     * with createEvent.\r
+     * @method hasEvent\r
+     * @param type {string} the type, or name of the event\r
+     */\r
+    hasEvent: function(type) {\r
+        if (this.__yui_events) {\r
+            if (this.__yui_events[type]) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+\r
+};\r
 \r
index cc8b0d621b5f9d7938695e88d041999143ecba86..142a99735e08d51c314df881e03ceaa2d238c2b7 100755 (executable)
@@ -1 +1 @@
-/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ YAHOO.util.CustomEvent=function(_1,_2,_3){this.type=_1;this.scope=_2||window;this.silent=_3;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_5,_6){this.subscribers.push(new YAHOO.util.Subscriber(fn,_5,_6));},unsubscribe:function(fn,_7){var _8=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_7)){this._delete(i);_8=true;}}return _8;},fire:function(){var len=this.subscribers.length;var _12=[];for(var i=0;i<arguments.length;++i){_12.push(arguments[i]);}if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _13=(s.override)?s.obj:this.scope;s.fn.call(_13,this.type,_12,s.obj);}}},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(i);}},_delete:function(_14){var s=this.subscribers[_14];if(s){delete s.fn;delete s.obj;}delete this.subscribers[_14];},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_16){this.fn=fn;this.obj=obj||null;this.override=(_16);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return (this.fn==fn&&this.obj==obj);};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _17=false;var _18=[];var _19=[];var _20=[];var _21=[];var _22=[];var _23=[];var _24=0;var _25=[];var _26=[];var _27=0;return {POLL_RETRYS:200,POLL_INTERVAL:50,EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),addDelayedListener:function(el,_29,fn,_30,_31){_19[_19.length]=[el,_29,fn,_30,_31];if(_17){_24=this.POLL_RETRYS;this.startTimeout(0);}},startTimeout:function(_32){var i=(_32||_32===0)?_32:this.POLL_INTERVAL;var _33=this;var _34=function(){_33._tryPreloadAttach();};this.timeout=setTimeout(_34,i);},onAvailable:function(_35,_36,_37,_38){_25.push({id:_35,fn:_36,obj:_37,override:_38});_24=this.POLL_RETRYS;this.startTimeout(0);},addListener:function(el,_39,fn,_40,_41){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],_39,fn,_40,_41)&&ok);}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(_17&&oEl){el=oEl;}else{this.addDelayedListener(el,_39,fn,_40,_41);return true;}}}if(!el){return false;}if("unload"==_39&&_40!==this){_20[_20.length]=[el,_39,fn,_40,_41];return true;}var _44=(_41)?_40:el;var _45=function(e){return fn.call(_44,YAHOO.util.Event.getEvent(e),_40);};var li=[el,_39,fn,_45,_44];var _48=_18.length;_18[_48]=li;if(this.useLegacyEvent(el,_39)){var _49=this.getLegacyIndex(el,_39);if(_49==-1){_49=_22.length;_26[el.id+_39]=_49;_22[_49]=[el,_39,el["on"+_39]];_23[_49]=[];el["on"+_39]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_49);};}_23[_49].push(_48);}else{if(el.addEventListener){el.addEventListener(_39,_45,false);}else{if(el.attachEvent){el.attachEvent("on"+_39,_45);}}}return true;},fireLegacyEvent:function(e,_50){var ok=true;var le=_23[_50];for(var i=0,len=le.length;i<len;++i){var _52=le[i];if(_52){var li=_18[_52];if(li&&li[this.WFN]){var _53=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_53,e);ok=(ok&&ret);}else{delete le[i];}}}return ok;},getLegacyIndex:function(el,_55){var key=this.generateId(el)+_55;if(typeof _26[key]=="undefined"){return -1;}else{return _26[key];}},useLegacyEvent:function(el,_57){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_57||"dblclick"==_57){return true;}}}return false;},removeListener:function(el,_58,fn,_59){if(!fn||!fn.call){return false;}if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_58,fn)&&ok);}return ok;}}if("unload"==_58){for(i=0,len=_20.length;i<len;i++){var li=_20[i];if(li&&li[0]==el&&li[1]==_58&&li[2]==fn){delete _20[i];return true;}}return false;}var _60=null;if("undefined"==typeof _59){_59=this._getCacheIndex(el,_58,fn);}if(_59>=0){_60=_18[_59];}if(!el||!_60){return false;}if(el.removeEventListener){el.removeEventListener(_58,_60[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_58,_60[this.WFN]);}}delete _18[_59][this.WFN];delete _18[_59][this.FN];delete _18[_59];return true;},getTarget:function(ev,_62){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_64){if(_64&&_64.nodeName&&"#TEXT"==_64.nodeName.toUpperCase()){return _64.parentNode;}else{return _64;}},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(e){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){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,_68,fn){for(var i=0,len=_18.length;i<len;++i){var li=_18[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_68){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_27;++_27;el.id=id;}return id;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},regCE:function(ce){_21.push(ce);},_load:function(e){_17=true;},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _72=!_17;if(!_72){_72=(_24>0);}var _73=[];for(var i=0,len=_19.length;i<len;++i){var d=_19[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete _19[i];}else{_73.push(d);}}}_19=_73;var _75=[];for(i=0,len=_25.length;i<len;++i){var _76=_25[i];if(_76){el=this.getEl(_76.id);if(el){var _77=(_76.override)?_76.obj:el;_76.fn.call(_77,_76.obj);delete _25[i];}else{_75.push(_76);}}}_24=(_73.length===0&&_75.length===0)?0:_24-1;if(_72){this.startTimeout();}this.locked=false;return true;},purgeElement:function(el,_78,_79){var _80=this.getListeners(el,_79);if(_80){for(var i=0,len=_80.length;i<len;++i){var l=_80[i];this.removeListener(el,l.type,l.fn,l.index);}}if(_78&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_78,_79);}}},getListeners:function(el,_82){var _83=[];if(_18&&_18.length>0){for(var i=0,len=_18.length;i<len;++i){var l=_18[i];if(l&&l[this.EL]===el&&(!_82||_82===l[this.TYPE])){_83.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.SCOPE],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_83.length)?_83:null;},_unload:function(e,me){for(var i=0,len=_20.length;i<len;++i){var l=_20[i];if(l){var _85=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(_85,this.getEvent(e),l[this.SCOPE]);}}if(_18&&_18.length>0){for(i=0,len=_18.length;i<len;++i){l=_18[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN],i);}}this.clearCache();}for(i=0,len=_21.length;i<len;++i){_21[i].unsubscribeAll();delete _21[i];}for(i=0,len=_22.length;i<len;++i){delete _22[i][0];delete _22[i];}},_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){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};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 _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){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],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,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],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);break;}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},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(e){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){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;el.id=id;}return id;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[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=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}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];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{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(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};
\ No newline at end of file
index 78ddd0800a9d4befedd55a09f3a0993da9ff735f..7bfac3b9eeca5317cea856b14af38613b9a4634e 100755 (executable)
@@ -1,25 +1,30 @@
 /*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
 */ \r
 \r
 /**\r
  * The CustomEvent class lets you define events for your application\r
  * that can be subscribed to by one or more independent component.\r
  *\r
- * @param {String} type The type of event, which is passed to the callback\r
- *                 when the event fires\r
- * @param {Object} oScope The context the event will fire from.  "this" will\r
- *                 refer to this object in the callback.  Default value: \r
- *                 the window object.  The listener can override this.\r
+ * @param {String}  type The type of event, which is passed to the callback\r
+ *                  when the event fires\r
+ * @param {Object}  oScope The context the event will fire from.  "this" will\r
+ *                  refer to this object in the callback.  Default value: \r
+ *                  the window object.  The listener can override this.\r
+ * @param {boolean} silent pass true to prevent the event from writing to\r
+ *                  the log system\r
+ * @namespace YAHOO.util\r
+ * @class CustomEvent\r
  * @constructor\r
  */\r
-YAHOO.util.CustomEvent = function(type, oScope, silent) {\r
+YAHOO.util.CustomEvent = function(type, oScope, silent, signature) {\r
 \r
     /**\r
      * The type of event, returned to subscribers when the event fires\r
+     * @property type\r
      * @type string\r
      */\r
     this.type = type;\r
@@ -27,6 +32,7 @@ YAHOO.util.CustomEvent = function(type, oScope, silent) {
     /**\r
      * The scope the the event will fire from by default.  Defaults to the window \r
      * obj\r
+     * @property scope\r
      * @type object\r
      */\r
     this.scope = oScope || window;\r
@@ -34,42 +40,119 @@ YAHOO.util.CustomEvent = function(type, oScope, silent) {
     /**\r
      * By default all custom events are logged in the debug build, set silent\r
      * to true to disable logging for this event.\r
+     * @property silent\r
      * @type boolean\r
      */\r
     this.silent = silent;\r
 \r
+    /**\r
+     * Custom events support two styles of arguments provided to the event\r
+     * subscribers.  \r
+     * <ul>\r
+     * <li>YAHOO.util.CustomEvent.LIST: \r
+     *   <ul>\r
+     *   <li>param1: event name</li>\r
+     *   <li>param2: array of arguments sent to fire</li>\r
+     *   <li>param3: <optional> a custom object supplied by the subscriber</li>\r
+     *   </ul>\r
+     * </li>\r
+     * <li>YAHOO.util.CustomEvent.FLAT\r
+     *   <ul>\r
+     *   <li>param1: the first argument passed to fire.  If you need to\r
+     *           pass multiple parameters, use and array or object literal</li>\r
+     *   <li>param2: <optional> a custom object supplied by the subscriber</li>\r
+     *   </ul>\r
+     * </li>\r
+     * </ul>\r
+     *   @property signature\r
+     *   @type int\r
+     */\r
+    this.signature = signature || YAHOO.util.CustomEvent.LIST;\r
+\r
     /**\r
      * The subscribers to this event\r
+     * @property subscribers\r
      * @type Subscriber[]\r
      */\r
     this.subscribers = [];\r
 \r
-    // Register with the event utility for automatic cleanup.  Made optional\r
-    // so that CustomEvent can be used independently of pe.event\r
-    if (YAHOO.util.Event) { \r
-        YAHOO.util.Event.regCE(this);\r
-    }\r
-\r
     if (!this.silent) {\r
     }\r
+\r
+    var onsubscribeType = "_YUICEOnSubscribe";\r
+\r
+    // Only add subscribe events for events that are not generated by \r
+    // CustomEvent\r
+    if (type !== onsubscribeType) {\r
+\r
+        /**\r
+         * Custom events provide a custom event that fires whenever there is\r
+         * a new subscriber to the event.  This provides an opportunity to\r
+         * handle the case where there is a non-repeating event that has\r
+         * already fired has a new subscriber.  \r
+         *\r
+         * @event subscribeEvent\r
+         * @type YAHOO.util.CustomEvent\r
+         * @param {Function} fn The function to execute\r
+         * @param {Object}   obj An object to be passed along when the event \r
+         *                       fires\r
+         * @param {boolean|Object}  override If true, the obj passed in becomes \r
+         *                                   the execution scope of the listener.\r
+         *                                   if an object, that object becomes the\r
+         *                                   the execution scope.\r
+         */\r
+        this.subscribeEvent = \r
+                new YAHOO.util.CustomEvent(onsubscribeType, this, true);\r
+\r
+    } \r
 };\r
 \r
+/**\r
+ * Subscriber listener sigature constant.  The LIST type returns three\r
+ * parameters: the event type, the array of args passed to fire, and\r
+ * the optional custom object\r
+ * @property YAHOO.util.CustomEvent.LIST\r
+ * @static\r
+ * @type int\r
+ */\r
+YAHOO.util.CustomEvent.LIST = 0;\r
+\r
+/**\r
+ * Subscriber listener sigature constant.  The FLAT type returns two\r
+ * parameters: the first argument passed to fire and the optional \r
+ * custom object\r
+ * @property YAHOO.util.CustomEvent.FLAT\r
+ * @static\r
+ * @type int\r
+ */\r
+YAHOO.util.CustomEvent.FLAT = 1;\r
+\r
 YAHOO.util.CustomEvent.prototype = {\r
+\r
     /**\r
      * Subscribes the caller to this event\r
-     * @param {Function} fn       The function to execute\r
-     * @param {Object}   obj      An object to be passed along when the event fires\r
-     * @param {boolean}  bOverride If true, the obj passed in becomes the execution\r
-     *                            scope of the listener\r
+     * @method subscribe\r
+     * @param {Function} fn        The function to execute\r
+     * @param {Object}   obj       An object to be passed along when the event \r
+     *                             fires\r
+     * @param {boolean|Object}  override If true, the obj passed in becomes \r
+     *                                   the execution scope of the listener.\r
+     *                                   if an object, that object becomes the\r
+     *                                   the execution scope.\r
      */\r
-    subscribe: function(fn, obj, bOverride) {\r
-        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, bOverride) );\r
+    subscribe: function(fn, obj, override) {\r
+        if (this.subscribeEvent) {\r
+            this.subscribeEvent.fire(fn, obj, override);\r
+        }\r
+\r
+        this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, override) );\r
     },\r
 \r
     /**\r
      * Unsubscribes the caller from this event\r
+     * @method unsubscribe\r
      * @param {Function} fn  The function to execute\r
-     * @param {Object}   obj An object to be passed along when the event fires\r
+     * @param {Object}   obj  The custom object passed to subscribe (optional)\r
      * @return {boolean} True if the subscriber was found and detached.\r
      */\r
     unsubscribe: function(fn, obj) {\r
@@ -87,25 +170,32 @@ YAHOO.util.CustomEvent.prototype = {
 \r
     /**\r
      * Notifies the subscribers.  The callback functions will be executed\r
-     * from the scope specified when the event was created, and with the following\r
-     * parameters:\r
-     *   <pre>\r
-     *   - The type of event\r
-     *   - All of the arguments fire() was executed with as an array\r
-     *   - The custom object (if any) that was passed into the subscribe() method\r
-     *   </pre>\r
-     *   \r
-     * @param {Array} an arbitrary set of parameters to pass to the handler\r
+     * from the scope specified when the event was created, and with the \r
+     * following parameters:\r
+     *   <ul>\r
+     *   <li>The type of event</li>\r
+     *   <li>All of the arguments fire() was executed with as an array</li>\r
+     *   <li>The custom object (if any) that was passed into the subscribe() \r
+     *       method</li>\r
+     *   </ul>\r
+     * @method fire \r
+     * @param {Object*} arguments an arbitrary set of parameters to pass to \r
+     *                            the handler.\r
      */\r
     fire: function() {\r
         var len=this.subscribers.length;\r
+        if (!len && this.silent) {\r
+            return true;\r
+        }\r
 \r
-        var args = [];\r
+        var args=[], ret=true, i;\r
 \r
-        for (var i=0; i<arguments.length; ++i) {\r
+        for (i=0; i<arguments.length; ++i) {\r
             args.push(arguments[i]);\r
         }\r
 \r
+        var argslength = args.length;\r
+\r
         if (!this.silent) {\r
         }\r
 \r
@@ -114,22 +204,43 @@ YAHOO.util.CustomEvent.prototype = {
             if (s) {\r
                 if (!this.silent) {\r
                 }\r
-                var scope = (s.override) ? s.obj : this.scope;\r
-                s.fn.call(scope, this.type, args, s.obj);\r
+\r
+                var scope = s.getScope(this.scope);\r
+\r
+                if (this.signature == YAHOO.util.CustomEvent.FLAT) {\r
+                    var param = null;\r
+                    if (args.length > 0) {\r
+                        param = args[0];\r
+                    }\r
+                    ret = s.fn.call(scope, param, s.obj);\r
+                } else {\r
+                    ret = s.fn.call(scope, this.type, args, s.obj);\r
+                }\r
+                if (false === ret) {\r
+                    if (!this.silent) {\r
+                    }\r
+\r
+                    //break;\r
+                    return false;\r
+                }\r
             }\r
         }\r
+\r
+        return true;\r
     },\r
 \r
     /**\r
      * Removes all listeners\r
+     * @method unsubscribeAll\r
      */\r
     unsubscribeAll: function() {\r
         for (var i=0, len=this.subscribers.length; i<len; ++i) {\r
-            this._delete(i);\r
+            this._delete(len - 1 - i);\r
         }\r
     },\r
 \r
     /**\r
+     * @method _delete\r
      * @private\r
      */\r
     _delete: function(index) {\r
@@ -139,9 +250,13 @@ YAHOO.util.CustomEvent.prototype = {
             delete s.obj;\r
         }\r
 \r
-        delete this.subscribers[index];\r
+        // delete this.subscribers[index];\r
+        this.subscribers.splice(index, 1);\r
     },\r
 \r
+    /**\r
+     * @method toString\r
+     */\r
     toString: function() {\r
          return "CustomEvent: " + "'" + this.type  + "', " + \r
              "scope: " + this.scope;\r
@@ -152,16 +267,19 @@ YAHOO.util.CustomEvent.prototype = {
 /////////////////////////////////////////////////////////////////////\r
 \r
 /**\r
- * @class Stores the subscriber information to be used when the event fires.\r
+ * Stores the subscriber information to be used when the event fires.\r
  * @param {Function} fn       The function to execute\r
  * @param {Object}   obj      An object to be passed along when the event fires\r
- * @param {boolean}  bOverride If true, the obj passed in becomes the execution\r
+ * @param {boolean}  override If true, the obj passed in becomes the execution\r
  *                            scope of the listener\r
+ * @class Subscriber\r
  * @constructor\r
  */\r
-YAHOO.util.Subscriber = function(fn, obj, bOverride) {\r
+YAHOO.util.Subscriber = function(fn, obj, override) {\r
+\r
     /**\r
      * The callback that will be execute when the event fires\r
+     * @property fn\r
      * @type function\r
      */\r
     this.fn = fn;\r
@@ -169,6 +287,7 @@ YAHOO.util.Subscriber = function(fn, obj, bOverride) {
     /**\r
      * An optional custom object that will passed to the callback when\r
      * the event fires\r
+     * @property obj\r
      * @type object\r
      */\r
     this.obj = obj || null;\r
@@ -177,88 +296,124 @@ YAHOO.util.Subscriber = function(fn, obj, bOverride) {
      * The default execution scope for the event listener is defined when the\r
      * event is created (usually the object which contains the event).\r
      * By setting override to true, the execution scope becomes the custom\r
-     * object passed in by the subscriber\r
-     * @type boolean\r
+     * object passed in by the subscriber.  If override is an object, that \r
+     * object becomes the scope.\r
+     * @property override\r
+     * @type boolean|object\r
      */\r
-    this.override = (bOverride);\r
+    this.override = override;\r
+\r
+};\r
+\r
+/**\r
+ * Returns the execution scope for this listener.  If override was set to true\r
+ * the custom obj will be the scope.  If override is an object, that is the\r
+ * scope, otherwise the default scope will be used.\r
+ * @method getScope\r
+ * @param {Object} defaultScope the scope to use if this listener does not\r
+ *                              override it.\r
+ */\r
+YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) {\r
+    if (this.override) {\r
+        if (this.override === true) {\r
+            return this.obj;\r
+        } else {\r
+            return this.override;\r
+        }\r
+    }\r
+    return defaultScope;\r
 };\r
 \r
 /**\r
  * Returns true if the fn and obj match this objects properties.\r
  * Used by the unsubscribe method to match the right subscriber.\r
  *\r
+ * @method contains\r
  * @param {Function} fn the function to execute\r
  * @param {Object} obj an object to be passed along when the event fires\r
  * @return {boolean} true if the supplied arguments match this \r
  *                   subscriber's signature.\r
  */\r
 YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {\r
-    return (this.fn == fn && this.obj == obj);\r
+    if (obj) {\r
+        return (this.fn == fn && this.obj == obj);\r
+    } else {\r
+        return (this.fn == fn);\r
+    }\r
 };\r
 \r
+/**\r
+ * @method toString\r
+ */\r
 YAHOO.util.Subscriber.prototype.toString = function() {\r
     return "Subscriber { obj: " + (this.obj || "")  + \r
            ", override: " +  (this.override || "no") + " }";\r
 };\r
-// Only load this library once.  If it is loaded a second time, existing\r
-// events cannot be detached.\r
+\r
+/**\r
+ * The Event Utility provides utilities for managing DOM Events and tools\r
+ * for building event systems\r
+ *\r
+ * @module event\r
+ * @title Event Utility\r
+ * @namespace YAHOO.util\r
+ * @requires yahoo\r
+ */\r
+\r
+// The first instance of Event will win if it is loaded more than once.\r
 if (!YAHOO.util.Event) {\r
 \r
 /**\r
- * @class\r
  * The event utility provides functions to add and remove event listeners,\r
  * event cleansing.  It also tries to automatically remove listeners it\r
  * registers during the unload event.\r
- * @constructor\r
+ *\r
+ * @class Event\r
+ * @static\r
  */\r
     YAHOO.util.Event = function() {\r
 \r
         /**\r
          * True after the onload event has fired\r
+         * @property loadComplete\r
          * @type boolean\r
+         * @static\r
          * @private\r
          */\r
         var loadComplete =  false;\r
 \r
         /**\r
          * Cache of wrapped listeners\r
+         * @property listeners\r
          * @type array\r
+         * @static\r
          * @private\r
          */\r
         var listeners = [];\r
 \r
-        /**\r
-         * Listeners that will be attached during the onload event\r
-         * @type array\r
-         * @private\r
-         */\r
-        var delayedListeners = [];\r
-\r
         /**\r
          * User-defined unload function that will be fired before all events\r
          * are detached\r
+         * @property unloadListeners\r
          * @type array\r
+         * @static\r
          * @private\r
          */\r
         var unloadListeners = [];\r
 \r
-        /**\r
-         * Cache of the custom events that have been defined.  Used for\r
-         * automatic cleanup\r
-         * @type array\r
-         * @private\r
-         */\r
-        var customEvents = [];\r
-\r
         /**\r
          * Cache of DOM0 event handlers to work around issues with DOM2 events\r
          * in Safari\r
+         * @property legacyEvents\r
+         * @static\r
          * @private\r
          */\r
         var legacyEvents = [];\r
 \r
         /**\r
          * Listener stack for DOM0 events\r
+         * @property legacyHandlers\r
+         * @static\r
          * @private\r
          */\r
         var legacyHandlers = [];\r
@@ -267,24 +422,32 @@ if (!YAHOO.util.Event) {
          * The number of times to poll after window.onload.  This number is\r
          * increased if additional late-bound handlers are requested after\r
          * the page load.\r
+         * @property retryCount\r
+         * @static\r
          * @private\r
          */\r
         var retryCount = 0;\r
 \r
         /**\r
          * onAvailable listeners\r
+         * @property onAvailStack\r
+         * @static\r
          * @private\r
          */\r
         var onAvailStack = [];\r
 \r
         /**\r
          * Lookup table for legacy events\r
+         * @property legacyMap\r
+         * @static\r
          * @private\r
          */\r
         var legacyMap = [];\r
 \r
         /**\r
          * Counter for auto id generation\r
+         * @property counter\r
+         * @static\r
          * @private\r
          */\r
         var counter = 0;\r
@@ -294,54 +457,78 @@ if (!YAHOO.util.Event) {
             /**\r
              * The number of times we should look for elements that are not\r
              * in the DOM at the time the event is requested after the document\r
-             * has been loaded.  The default is 200@50 ms, so it will poll\r
+             * has been loaded.  The default is 200@amp;50 ms, so it will poll\r
              * for 10 seconds or until all outstanding handlers are bound\r
              * (whichever comes first).\r
+             * @property POLL_RETRYS\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             POLL_RETRYS: 200,\r
 \r
             /**\r
              * The poll interval in milliseconds\r
+             * @property POLL_INTERVAL\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
-            POLL_INTERVAL: 50,\r
+            POLL_INTERVAL: 20,\r
 \r
             /**\r
              * Element to bind, int constant\r
+             * @property EL\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             EL: 0,\r
 \r
             /**\r
              * Type of event, int constant\r
+             * @property TYPE\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             TYPE: 1,\r
 \r
             /**\r
              * Function to execute, int constant\r
+             * @property FN\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             FN: 2,\r
 \r
             /**\r
              * Function wrapped for scope correction and cleanup, int constant\r
+             * @property WFN\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             WFN: 3,\r
 \r
             /**\r
              * Object passed in by the user that will be returned as a \r
              * parameter to the callback, int constant\r
+             * @property OBJ\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
-            SCOPE: 3,\r
+            OBJ: 3,\r
 \r
             /**\r
              * Adjusted scope, either the element we are registering the event\r
              * on or the custom object passed in by the listener, int constant\r
+             * @property ADJ_SCOPE\r
              * @type int\r
+             * @static\r
+             * @final\r
              */\r
             ADJ_SCOPE: 4,\r
 \r
@@ -349,7 +536,9 @@ if (!YAHOO.util.Event) {
              * Safari detection is necessary to work around the preventDefault\r
              * bug that makes it so you can't cancel a href click from the \r
              * handler.  There is not a capabilities check we can use here.\r
+             * @property isSafari\r
              * @private\r
+             * @static\r
              */\r
             isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),\r
 \r
@@ -358,36 +547,32 @@ if (!YAHOO.util.Event) {
              * capabilities checking didn't seem to work because another \r
              * browser that does not provide the properties have the values \r
              * calculated in a different manner than IE.\r
+             * @property isIE\r
              * @private\r
+             * @static\r
              */\r
             isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && \r
                     navigator.userAgent.match(/msie/gi)),\r
 \r
             /**\r
+             * poll handle\r
+             * @property _interval\r
              * @private\r
              */\r
-            addDelayedListener: function(el, sType, fn, oScope, bOverride) {\r
-                delayedListeners[delayedListeners.length] =\r
-                    [el, sType, fn, oScope, bOverride];\r
-\r
-                // If this happens after the inital page load, we need to\r
-                // reset the poll counter so that we continue to search for\r
-                // the element for a fixed period of time.\r
-                if (loadComplete) {\r
-                    retryCount = this.POLL_RETRYS;\r
-                    this.startTimeout(0);\r
-                    // this._tryPreloadAttach();\r
-                }\r
-            },\r
+            _interval: null,\r
 \r
             /**\r
+             * @method startInterval\r
+             * @static\r
              * @private\r
              */\r
-            startTimeout: function(interval) {\r
-                var i = (interval || interval === 0) ? interval : this.POLL_INTERVAL;\r
-                var self = this;\r
-                var callback = function() { self._tryPreloadAttach(); };\r
-                this.timeout = setTimeout(callback, i);\r
+            startInterval: function() {\r
+                if (!this._interval) {\r
+                    var self = this;\r
+                    var callback = function() { self._tryPreloadAttach(); };\r
+                    this._interval = setInterval(callback, this.POLL_INTERVAL);\r
+                    // this.timeout = setTimeout(callback, i);\r
+                }\r
             },\r
 \r
             /**\r
@@ -397,41 +582,75 @@ if (!YAHOO.util.Event) {
              * initial page load it will poll for a fixed time for the element.\r
              * The number of times it will poll and the frequency are\r
              * configurable.  By default it will poll for 10 seconds.\r
-             * @param {string} p_id the id of the element to look for.\r
+             *\r
+             * @method onAvailable\r
+             *\r
+             * @param {string}   p_id the id of the element to look for.\r
              * @param {function} p_fn what to execute when the element is found.\r
-             * @param {object} p_obj an optional object to be passed back as\r
-             * a parameter to p_fn.\r
-             * @param {boolean} p_override If set to true, p_fn will execute\r
-             * in the scope of p_obj\r
+             * @param {object}   p_obj an optional object to be passed back as\r
+             *                   a parameter to p_fn.\r
+             * @param {boolean}  p_override If set to true, p_fn will execute\r
+             *                   in the scope of p_obj\r
              *\r
+             * @static\r
              */\r
             onAvailable: function(p_id, p_fn, p_obj, p_override) {\r
-                onAvailStack.push( { id:       p_id, \r
-                                     fn:       p_fn, \r
-                                     obj:      p_obj, \r
-                                     override: p_override } );\r
+                onAvailStack.push( { id:         p_id, \r
+                                     fn:         p_fn, \r
+                                     obj:        p_obj, \r
+                                     override:   p_override, \r
+                                     checkReady: false    } );\r
+\r
+                retryCount = this.POLL_RETRYS;\r
+                this.startInterval();\r
+            },\r
+\r
+            /**\r
+             * Works the same way as onAvailable, but additionally checks the\r
+             * state of sibling elements to determine if the content of the\r
+             * available element is safe to modify.\r
+             *\r
+             * @method onContentReady\r
+             *\r
+             * @param {string}   p_id the id of the element to look for.\r
+             * @param {function} p_fn what to execute when the element is ready.\r
+             * @param {object}   p_obj an optional object to be passed back as\r
+             *                   a parameter to p_fn.\r
+             * @param {boolean}  p_override If set to true, p_fn will execute\r
+             *                   in the scope of p_obj\r
+             *\r
+             * @static\r
+             */\r
+            onContentReady: function(p_id, p_fn, p_obj, p_override) {\r
+                onAvailStack.push( { id:         p_id, \r
+                                     fn:         p_fn, \r
+                                     obj:        p_obj, \r
+                                     override:   p_override,\r
+                                     checkReady: true      } );\r
 \r
                 retryCount = this.POLL_RETRYS;\r
-                this.startTimeout(0);\r
-                // this._tryPreloadAttach();\r
+                this.startInterval();\r
             },\r
 \r
             /**\r
              * Appends an event handler\r
              *\r
+             * @method addListener\r
+             *\r
              * @param {Object}   el        The html element to assign the \r
              *                             event to\r
              * @param {String}   sType     The type of event to append\r
              * @param {Function} fn        The method the event invokes\r
-             * @param {Object}   oScope    An arbitrary object that will be \r
+             * @param {Object}   obj    An arbitrary object that will be \r
              *                             passed as a parameter to the handler\r
-             * @param {boolean}  bOverride If true, the obj passed in becomes\r
+             * @param {boolean}  override  If true, the obj passed in becomes\r
              *                             the execution scope of the listener\r
              * @return {boolean} True if the action was successful or defered,\r
              *                        false if one or more of the elements \r
              *                        could not have the event bound to it.\r
+             * @static\r
              */\r
-            addListener: function(el, sType, fn, oScope, bOverride) {\r
+            addListener: function(el, sType, fn, obj, override) {\r
 \r
                 if (!fn || !fn.call) {\r
                     return false;\r
@@ -441,11 +660,11 @@ if (!YAHOO.util.Event) {
                 if ( this._isValidCollection(el)) {\r
                     var ok = true;\r
                     for (var i=0,len=el.length; i<len; ++i) {\r
-                        ok = this.on(el[i], \r
+                        ok = this.on(el[i], \r
                                        sType, \r
                                        fn, \r
-                                       oScope\r
-                                       bOverride) && ok );\r
+                                       obj\r
+                                       override) && ok;\r
                     }\r
                     return ok;\r
 \r
@@ -458,15 +677,13 @@ if (!YAHOO.util.Event) {
 \r
                     // check to see if we need to delay hooking up the event \r
                     // until after the page loads.\r
-                    if (loadComplete && oEl) {\r
+                    if (oEl) {\r
                         el = oEl;\r
                     } else {\r
-                        // defer adding the event until onload fires\r
-                        this.addDelayedListener(el, \r
-                                                sType, \r
-                                                fn, \r
-                                                oScope, \r
-                                                bOverride);\r
+                        // defer adding the event until the element is available\r
+                        this.onAvailable(el, function() {\r
+                           YAHOO.util.Event.on(el, sType, fn, obj, override);\r
+                        });\r
 \r
                         return true;\r
                     }\r
@@ -482,22 +699,29 @@ if (!YAHOO.util.Event) {
                 // prior to automatically unhooking them.  So we hang on to \r
                 // these instead of attaching them to the window and fire the\r
                 // handles explicitly during our one unload event.\r
-                if ("unload" == sType && oScope !== this) {\r
+                if ("unload" == sType && obj !== this) {\r
                     unloadListeners[unloadListeners.length] =\r
-                            [el, sType, fn, oScope, bOverride];\r
+                            [el, sType, fn, obj, override];\r
                     return true;\r
                 }\r
 \r
                 // if the user chooses to override the scope, we use the custom\r
                 // object passed in, otherwise the executing scope will be the\r
                 // HTML element that the event is registered on\r
-                var scope = (bOverride) ? oScope : el;\r
+                var scope = el;\r
+                if (override) {\r
+                    if (override === true) {\r
+                        scope = obj;\r
+                    } else {\r
+                        scope = override;\r
+                    }\r
+                }\r
 \r
-                // wrap the function so we can return the oScope object when\r
+                // wrap the function so we can return the obj object when\r
                 // the event fires;\r
                 var wrappedFn = function(e) {\r
                         return fn.call(scope, YAHOO.util.Event.getEvent(e), \r
-                                oScope);\r
+                                obj);\r
                     };\r
 \r
                 var li = [el, sType, fn, wrappedFn, scope];\r
@@ -507,7 +731,11 @@ if (!YAHOO.util.Event) {
 \r
                 if (this.useLegacyEvent(el, sType)) {\r
                     var legacyIndex = this.getLegacyIndex(el, sType);\r
-                    if (legacyIndex == -1) {\r
+\r
+                    // Add a new dom0 wrapper if one is not detected for this\r
+                    // element\r
+                    if ( legacyIndex == -1 || \r
+                                el != legacyEvents[legacyIndex][0] ) {\r
 \r
                         legacyIndex = legacyEvents.length;\r
                         legacyMap[el.id + sType] = legacyIndex;\r
@@ -527,29 +755,22 @@ if (!YAHOO.util.Event) {
 \r
                     // add a reference to the wrapped listener to our custom\r
                     // stack of events\r
-                    legacyHandlers[legacyIndex].push(index);\r
-\r
-                // DOM2 Event model\r
-                } else if (el.addEventListener) {\r
-                    el.addEventListener(sType, wrappedFn, false);\r
-                // IE\r
-                } else if (el.attachEvent) {\r
-                    el.attachEvent("on" + sType, wrappedFn);\r
+                    //legacyHandlers[legacyIndex].push(index);\r
+                    legacyHandlers[legacyIndex].push(li);\r
+\r
+                } else {\r
+                    this._simpleAdd(el, sType, wrappedFn, false);\r
                 }\r
 \r
                 return true;\r
                 \r
             },\r
 \r
-            /**\r
-             * Shorthand for YAHOO.util.Event.addListener\r
-             * @type function\r
-             */\r
-            // on: this.addListener,\r
-\r
             /**\r
              * When using legacy events, the handler is routed to this object\r
              * so we can fire our custom listener stack.\r
+             * @method fireLegacyEvent\r
+             * @static\r
              * @private\r
              */\r
             fireLegacyEvent: function(e, legacyIndex) {\r
@@ -557,18 +778,11 @@ if (!YAHOO.util.Event) {
 \r
                 var le = legacyHandlers[legacyIndex];\r
                 for (var i=0,len=le.length; i<len; ++i) {\r
-                    var index = le[i];\r
-                    if (index) {\r
-                        var li = listeners[index];\r
-                        if ( li && li[this.WFN] ) {\r
-                            var scope = li[this.ADJ_SCOPE];\r
-                            var ret = li[this.WFN].call(scope, e);\r
-                            ok = (ok && ret);\r
-                        } else {\r
-                            // This listener was removed, so delete it from\r
-                            // the array\r
-                            delete le[i];\r
-                        }\r
+                    var li = le[i];\r
+                    if ( li && li[this.WFN] ) {\r
+                        var scope = li[this.ADJ_SCOPE];\r
+                        var ret = li[this.WFN].call(scope, e);\r
+                        ok = (ok && ret);\r
                     }\r
                 }\r
 \r
@@ -578,35 +792,27 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns the legacy event index that matches the supplied \r
              * signature\r
+             * @method getLegacyIndex\r
+             * @static\r
              * @private\r
              */\r
             getLegacyIndex: function(el, sType) {\r
-                /*\r
-                for (var i=0,len=legacyEvents.length; i<len; ++i) {\r
-                    var le = legacyEvents[i];\r
-                    if (le && le[0] === el && le[1] === sType) {\r
-                        return i;\r
-                    }\r
-                }\r
-                return -1;\r
-                */\r
-\r
                 var key = this.generateId(el) + sType;\r
                 if (typeof legacyMap[key] == "undefined") { \r
                     return -1;\r
                 } else {\r
                     return legacyMap[key];\r
                 }\r
-\r
             },\r
 \r
             /**\r
              * Logic that determines when we should automatically use legacy\r
              * events instead of DOM2 events.\r
+             * @method useLegacyEvent\r
+             * @static\r
              * @private\r
              */\r
             useLegacyEvent: function(el, sType) {\r
-\r
                 if (!el.addEventListener && !el.attachEvent) {\r
                     return true;\r
                 } else if (this.isSafari) {\r
@@ -614,25 +820,26 @@ if (!YAHOO.util.Event) {
                         return true;\r
                     }\r
                 }\r
-\r
                 return false;\r
             },\r
                     \r
             /**\r
              * Removes an event handler\r
              *\r
+             * @method removeListener\r
+             *\r
              * @param {Object} el the html element or the id of the element to \r
              * assign the event to.\r
-             * @param {String} sType the type of event to remove\r
-             * @param {Function} fn the method the event invokes\r
+             * @param {String} sType the type of event to remove.\r
+             * @param {Function} fn the method the event invokes.  If fn is\r
+             * undefined, then all event handlers for the type of event are \r
+             * removed.\r
              * @return {boolean} true if the unbind was successful, false \r
-             * otherwise\r
+             * otherwise.\r
+             * @static\r
              */\r
-            removeListener: function(el, sType, fn, index) {\r
-\r
-                if (!fn || !fn.call) {\r
-                    return false;\r
-                }\r
+            removeListener: function(el, sType, fn) {\r
+                var i, len;\r
 \r
                 // The el argument can be a string\r
                 if (typeof el == "string") {\r
@@ -640,12 +847,17 @@ if (!YAHOO.util.Event) {
                 // The el argument can be an array of elements or element ids.\r
                 } else if ( this._isValidCollection(el)) {\r
                     var ok = true;\r
-                    for (var i=0,len=el.length; i<len; ++i) {\r
+                    for (i=0,len=el.length; i<len; ++i) {\r
                         ok = ( this.removeListener(el[i], sType, fn) && ok );\r
                     }\r
                     return ok;\r
                 }\r
 \r
+                if (!fn || !fn.call) {\r
+                    //return false;\r
+                    return this.purgeElement(el, false, sType);\r
+                }\r
+\r
                 if ("unload" == sType) {\r
 \r
                     for (i=0, len=unloadListeners.length; i<len; i++) {\r
@@ -654,7 +866,7 @@ if (!YAHOO.util.Event) {
                             li[0] == el && \r
                             li[1] == sType && \r
                             li[2] == fn) {\r
-                                delete unloadListeners[i];\r
+                                unloadListeners.splice(i, 1);\r
                                 return true;\r
                         }\r
                     }\r
@@ -663,6 +875,11 @@ if (!YAHOO.util.Event) {
                 }\r
 \r
                 var cacheItem = null;\r
+\r
+                // The index is a hidden parameter; needed to remove it from\r
+                // the method signature because it was tempting users to\r
+                // try and take advantage of it, which is not possible.\r
+                var index = arguments[3];\r
   \r
                 if ("undefined" == typeof index) {\r
                     index = this._getCacheIndex(el, sType, fn);\r
@@ -676,16 +893,30 @@ if (!YAHOO.util.Event) {
                     return false;\r
                 }\r
 \r
-                if (el.removeEventListener) {\r
-                    el.removeEventListener(sType, cacheItem[this.WFN], false);\r
-                } else if (el.detachEvent) {\r
-                    el.detachEvent("on" + sType, cacheItem[this.WFN]);\r
+                if (this.useLegacyEvent(el, sType)) {\r
+                    var legacyIndex = this.getLegacyIndex(el, sType);\r
+                    var llist = legacyHandlers[legacyIndex];\r
+                    if (llist) {\r
+                        for (i=0, len=llist.length; i<len; ++i) {\r
+                            li = llist[i];\r
+                            if (li && \r
+                                li[this.EL] == el && \r
+                                li[this.TYPE] == sType && \r
+                                li[this.FN] == fn) {\r
+                                    llist.splice(i, 1);\r
+                                    break;\r
+                            }\r
+                        }\r
+                    }\r
+\r
+                } else {\r
+                    this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
                 }\r
 \r
                 // removed the wrapped handler\r
                 delete listeners[index][this.WFN];\r
                 delete listeners[index][this.FN];\r
-                delete listeners[index];\r
+                listeners.splice(index, 1);\r
 \r
                 return true;\r
 \r
@@ -693,12 +924,14 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's target element\r
+             * @method getTarget\r
              * @param {Event} ev the event\r
              * @param {boolean} resolveTextNode when set to true the target's\r
              *                  parent will be returned if the target is a \r
              *                  text node.  @deprecated, the text node is\r
              *                  now resolved automatically\r
              * @return {HTMLElement} the event's target\r
+             * @static\r
              */\r
             getTarget: function(ev, resolveTextNode) {\r
                 var t = ev.target || ev.srcElement;\r
@@ -709,12 +942,15 @@ if (!YAHOO.util.Event) {
              * In some cases, some browsers will return a text node inside\r
              * the actual element that was targeted.  This normalizes the\r
              * return value for getTarget and getRelatedTarget.\r
-             * @param {HTMLElement} node to resolve\r
-             * @return  the normized node\r
+             * @method resolveTextNode\r
+             * @param {HTMLElement} node node to resolve\r
+             * @return {HTMLElement} the normized node\r
+             * @static\r
              */\r
             resolveTextNode: function(node) {\r
-                if (node && node.nodeName && \r
-                        "#TEXT" == node.nodeName.toUpperCase()) {\r
+                // if (node && node.nodeName && \r
+                        // "#TEXT" == node.nodeName.toUpperCase()) {\r
+                if (node && 3 == node.nodeType) {\r
                     return node.parentNode;\r
                 } else {\r
                     return node;\r
@@ -723,8 +959,10 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's pageX\r
+             * @method getPageX\r
              * @param {Event} ev the event\r
              * @return {int} the event's pageX\r
+             * @static\r
              */\r
             getPageX: function(ev) {\r
                 var x = ev.pageX;\r
@@ -741,8 +979,10 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's pageY\r
+             * @method getPageY\r
              * @param {Event} ev the event\r
              * @return {int} the event's pageY\r
+             * @static\r
              */\r
             getPageY: function(ev) {\r
                 var y = ev.pageY;\r
@@ -759,7 +999,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the pageX and pageY properties as an indexed array.\r
+             * @method getXY\r
              * @type int[]\r
+             * @static\r
              */\r
             getXY: function(ev) {\r
                 return [this.getPageX(ev), this.getPageY(ev)];\r
@@ -767,8 +1009,10 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the event's related target \r
+             * @method getRelatedTarget\r
              * @param {Event} ev the event\r
              * @return {HTMLElement} the event's relatedTarget\r
+             * @static\r
              */\r
             getRelatedTarget: function(ev) {\r
                 var t = ev.relatedTarget;\r
@@ -786,8 +1030,10 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns the time of the event.  If the time is not included, the\r
              * event is modified using the current time.\r
+             * @method getTime\r
              * @param {Event} ev the event\r
              * @return {Date} the time of the event\r
+             * @static\r
              */\r
             getTime: function(ev) {\r
                 if (!ev.time) {\r
@@ -795,7 +1041,6 @@ if (!YAHOO.util.Event) {
                     try {\r
                         ev.time = t;\r
                     } catch(e) { \r
-                        // can't set the time property  \r
                         return t;\r
                     }\r
                 }\r
@@ -805,7 +1050,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Convenience method for stopPropagation + preventDefault\r
+             * @method stopEvent\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             stopEvent: function(ev) {\r
                 this.stopPropagation(ev);\r
@@ -814,7 +1061,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Stops event propagation\r
+             * @method stopPropagation\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             stopPropagation: function(ev) {\r
                 if (ev.stopPropagation) {\r
@@ -826,7 +1075,9 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Prevents the default behavior of the event\r
+             * @method preventDefault\r
              * @param {Event} ev the event\r
+             * @static\r
              */\r
             preventDefault: function(ev) {\r
                 if (ev.preventDefault) {\r
@@ -842,8 +1093,10 @@ if (!YAHOO.util.Event) {
              * executed automatically for events registered through the event\r
              * manager, so the implementer should not normally need to execute\r
              * this function at all.\r
-             * @param {Event} the event parameter from the handler\r
+             * @method getEvent\r
+             * @param {Event} e the event parameter from the handler\r
              * @return {Event} the event \r
+             * @static\r
              */\r
             getEvent: function(e) {\r
                 var ev = e || window.event;\r
@@ -864,16 +1117,21 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns the charcode for an event\r
+             * @method getCharCode\r
              * @param {Event} ev the event\r
              * @return {int} the event's charCode\r
+             * @static\r
              */\r
             getCharCode: function(ev) {\r
-                return ev.charCode || ((ev.type == "keypress") ? ev.keyCode : 0);\r
+                return ev.charCode || ev.keyCode || 0;\r
             },\r
 \r
             /**\r
-             * @private\r
              * Locating the saved event handler data by function ref\r
+             *\r
+             * @method _getCacheIndex\r
+             * @static\r
+             * @private\r
              */\r
             _getCacheIndex: function(el, sType, fn) {\r
                 for (var i=0,len=listeners.length; i<len; ++i) {\r
@@ -892,8 +1150,10 @@ if (!YAHOO.util.Event) {
             /**\r
              * Generates an unique ID for the element if it does not already \r
              * have one.\r
-             * @param el the element\r
-             * @return {string} the id of the element\r
+             * @method generateId\r
+             * @param el the element to create the id for\r
+             * @return {string} the resulting id of the element\r
+             * @static\r
              */\r
             generateId: function(el) {\r
                 var id = el.id;\r
@@ -913,11 +1173,15 @@ if (!YAHOO.util.Event) {
              * browsers return different types of collections.  This function\r
              * tests to determine if the object is array-like.  It will also \r
              * fail if the object is an array, but is empty.\r
+             * @method _isValidCollection\r
              * @param o the object to test\r
              * @return {boolean} true if the object is array-like and populated\r
+             * @static\r
              * @private\r
              */\r
             _isValidCollection: function(o) {\r
+                // this.logger.debug(o.constructor.toString())\r
+                // this.logger.debug(typeof o)\r
 \r
                 return ( o                    && // o is something\r
                          o.length             && // o is indexed\r
@@ -930,13 +1194,17 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * @private\r
+             * @property elCache\r
              * DOM element cache\r
+             * @static\r
              */\r
             elCache: {},\r
 \r
             /**\r
              * We cache elements bound by id because when the unload event \r
              * fires, we can no longer use document.getElementById\r
+             * @method getEl\r
+             * @static\r
              * @private\r
              */\r
             getEl: function(id) {\r
@@ -945,33 +1213,35 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Clears the element cache\r
-             * @deprecated\r
+             * @deprecated Elements are not cached any longer\r
+             * @method clearCache\r
+             * @static\r
              * @private\r
              */\r
             clearCache: function() { },\r
 \r
             /**\r
-             * Called by CustomEvent instances to provide a handle to the \r
-             * event * that can be removed later on.  Should be package \r
-             * protected.\r
-             * @private\r
-             */\r
-            regCE: function(ce) {\r
-                customEvents.push(ce);\r
-            },\r
-\r
-            /**\r
-             * @private\r
              * hook up any deferred listeners\r
+             * @method _load\r
+             * @static\r
+             * @private\r
              */\r
             _load: function(e) {\r
                 loadComplete = true;\r
+                var EU = YAHOO.util.Event;\r
+                // Remove the listener to assist with the IE memory issue, but not\r
+                // for other browsers because FF 1.0x does not like it.\r
+                if (this.isIE) {\r
+                    EU._simpleRemove(window, "load", EU._load);\r
+                }\r
             },\r
 \r
             /**\r
              * Polling function that runs before the onload event fires, \r
              * attempting to attach to DOM Nodes as soon as they are \r
              * available\r
+             * @method _tryPreloadAttach\r
+             * @static\r
              * @private\r
              */\r
             _tryPreloadAttach: function() {\r
@@ -991,53 +1261,45 @@ if (!YAHOO.util.Event) {
                     tryAgain = (retryCount > 0);\r
                 }\r
 \r
-                // Delayed listeners\r
-                var stillDelayed = [];\r
-\r
-                for (var i=0,len=delayedListeners.length; i<len; ++i) {\r
-                    var d = delayedListeners[i];\r
-                    // There may be a race condition here, so we need to \r
-                    // verify the array element is usable.\r
-                    if (d) {\r
-\r
-                        // el will be null if document.getElementById did not\r
-                        // work\r
-                        var el = this.getEl(d[this.EL]);\r
-\r
-                        if (el) {\r
-                            this.on(el, d[this.TYPE], d[this.FN], \r
-                                    d[this.SCOPE], d[this.ADJ_SCOPE]);\r
-                            delete delayedListeners[i];\r
-                        } else {\r
-                            stillDelayed.push(d);\r
-                        }\r
-                    }\r
-                }\r
-\r
-                delayedListeners = stillDelayed;\r
-\r
                 // onAvailable\r
                 var notAvail = [];\r
-                for (i=0,len=onAvailStack.length; i<len ; ++i) {\r
+                for (var i=0,len=onAvailStack.length; i<len ; ++i) {\r
                     var item = onAvailStack[i];\r
                     if (item) {\r
-                        el = this.getEl(item.id);\r
+                        var el = this.getEl(item.id);\r
 \r
                         if (el) {\r
-                            var scope = (item.override) ? item.obj : el;\r
-                            item.fn.call(scope, item.obj);\r
-                            delete onAvailStack[i];\r
+                            // The element is available, but not necessarily ready\r
+\r
+                            if ( !item.checkReady || \r
+                                    loadComplete || \r
+                                    el.nextSibling ||\r
+                                    (document && document.body) ) {\r
+\r
+                                var scope = el;\r
+                                if (item.override) {\r
+                                    if (item.override === true) {\r
+                                        scope = item.obj;\r
+                                    } else {\r
+                                        scope = item.override;\r
+                                    }\r
+                                }\r
+                                item.fn.call(scope, item.obj);\r
+                                delete onAvailStack[i];\r
+                            }\r
                         } else {\r
                             notAvail.push(item);\r
                         }\r
                     }\r
                 }\r
 \r
-                retryCount = (stillDelayed.length === 0 && \r
-                                    notAvail.length === 0) ? 0 : retryCount - 1;\r
+                retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;\r
 \r
                 if (tryAgain) {\r
-                    this.startTimeout();\r
+                    this.startInterval();\r
+                } else {\r
+                    clearInterval(this._interval);\r
+                    this._interval = null;\r
                 }\r
 \r
                 this.locked = false;\r
@@ -1050,18 +1312,22 @@ if (!YAHOO.util.Event) {
              * Removes all listeners attached to the given element via addListener.\r
              * Optionally, the node's children can also be purged.\r
              * Optionally, you can specify a specific type of event to remove.\r
+             * @method purgeElement\r
              * @param {HTMLElement} el the element to purge\r
              * @param {boolean} recurse recursively purge this element's children\r
              * as well.  Use with caution.\r
              * @param {string} sType optional type of listener to purge. If\r
              * left out, all listeners will be removed\r
+             * @static\r
              */\r
             purgeElement: function(el, recurse, sType) {\r
                 var elListeners = this.getListeners(el, sType);\r
                 if (elListeners) {\r
                     for (var i=0,len=elListeners.length; i<len ; ++i) {\r
                         var l = elListeners[i];\r
-                        this.removeListener(el, l.type, l.fn, l.index);\r
+                        // can't use the index on the changing collection\r
+                        //this.removeListener(el, l.type, l.fn, l.index);\r
+                        this.removeListener(el, l.type, l.fn);\r
                     }\r
                 }\r
 \r
@@ -1075,15 +1341,17 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns all listeners attached to the given element via addListener.\r
              * Optionally, you can specify a specific type of event to return.\r
+             * @method getListeners\r
              * @param el {HTMLElement} the element to inspect \r
              * @param sType {string} optional type of listener to return. If\r
              * left out, all listeners will be returned\r
              * @return {Object} the listener. Contains the following fields:\r
-             *    type:   (string)   the type of event\r
-             *    fn:     (function) the callback supplied to addListener\r
-             *    obj:    (object)   the custom object supplied to addListener\r
-             *    adjust: (boolean)  whether or not to adjust the default scope\r
-             *    index:  (int)      its position in the Event util listener cache\r
+             * &nbsp;&nbsp;type:   (string)   the type of event\r
+             * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener\r
+             * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener\r
+             * &nbsp;&nbsp;adjust: (boolean)  whether or not to adjust the default scope\r
+             * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache\r
+             * @static\r
              */           \r
             getListeners: function(el, sType) {\r
                 var elListeners = [];\r
@@ -1095,7 +1363,7 @@ if (!YAHOO.util.Event) {
                             elListeners.push({\r
                                 type:   l[this.TYPE],\r
                                 fn:     l[this.FN],\r
-                                obj:    l[this.SCOPE],\r
+                                obj:    l[this.OBJ],\r
                                 adjust: l[this.ADJ_SCOPE],\r
                                 index:  i\r
                             });\r
@@ -1109,32 +1377,46 @@ if (!YAHOO.util.Event) {
             /**\r
              * Removes all listeners registered by pe.event.  Called \r
              * automatically during the unload event.\r
+             * @method _unload\r
+             * @static\r
              * @private\r
              */\r
-            _unload: function(e, me) {\r
-                for (var i=0,len=unloadListeners.length; i<len; ++i) {\r
-                    var l = unloadListeners[i];\r
+            _unload: function(e) {\r
+\r
+                var EU = YAHOO.util.Event, i, j, l, len, index;\r
+\r
+                for (i=0,len=unloadListeners.length; i<len; ++i) {\r
+                    l = unloadListeners[i];\r
                     if (l) {\r
-                        var scope = (l[this.ADJ_SCOPE]) ? l[this.SCOPE]: window;\r
-                        l[this.FN].call(scope, this.getEvent(e), l[this.SCOPE] );\r
+                        var scope = window;\r
+                        if (l[EU.ADJ_SCOPE]) {\r
+                            if (l[EU.ADJ_SCOPE] === true) {\r
+                                scope = l[EU.OBJ];\r
+                            } else {\r
+                                scope = l[EU.ADJ_SCOPE];\r
+                            }\r
+                        }\r
+                        l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );\r
+                        delete unloadListeners[i];\r
+                        l=null;\r
+                        scope=null;\r
                     }\r
                 }\r
 \r
                 if (listeners && listeners.length > 0) {\r
-                    for (i=0,len=listeners.length; i<len ; ++i) {\r
-                        l = listeners[i];\r
+                    j = listeners.length;\r
+                    while (j) {\r
+                        index = j-1;\r
+                        l = listeners[index];\r
                         if (l) {\r
-                            this.removeListener(l[this.EL], l[this.TYPE], \r
-                                    l[this.FN], i);\r
-                        }\r
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], \r
+                                    l[EU.FN], index);\r
+                        } \r
+                        j = j - 1;\r
                     }\r
+                    l=null;\r
 \r
-                    this.clearCache();\r
-                }\r
-\r
-                for (i=0,len=customEvents.length; i<len; ++i) {\r
-                    customEvents[i].unsubscribeAll();\r
-                    delete customEvents[i];\r
+                    EU.clearCache();\r
                 }\r
 \r
                 for (i=0,len=legacyEvents.length; i<len; ++i) {\r
@@ -1143,10 +1425,15 @@ if (!YAHOO.util.Event) {
                     // delete the array item\r
                     delete legacyEvents[i];\r
                 }\r
+\r
+                EU._simpleRemove(window, "unload", EU._unload);\r
+\r
             },\r
 \r
             /**\r
              * Returns scrollLeft\r
+             * @method _getScrollLeft\r
+             * @static\r
              * @private\r
              */\r
             _getScrollLeft: function() {\r
@@ -1155,6 +1442,8 @@ if (!YAHOO.util.Event) {
 \r
             /**\r
              * Returns scrollTop\r
+             * @method _getScrollTop\r
+             * @static\r
              * @private\r
              */\r
             _getScrollTop: function() {\r
@@ -1164,37 +1453,286 @@ if (!YAHOO.util.Event) {
             /**\r
              * Returns the scrollTop and scrollLeft.  Used to calculate the \r
              * pageX and pageY in Internet Explorer\r
+             * @method _getScroll\r
+             * @static\r
              * @private\r
              */\r
             _getScroll: function() {\r
-                var dd = document.documentElement; db = document.body;\r
-                if (dd && dd.scrollTop) {\r
+                var dd = document.documentElement, db = document.body;\r
+                if (dd && (dd.scrollTop || dd.scrollLeft)) {\r
                     return [dd.scrollTop, dd.scrollLeft];\r
                 } else if (db) {\r
                     return [db.scrollTop, db.scrollLeft];\r
                 } else {\r
                     return [0, 0];\r
                 }\r
-            }\r
+            },\r
+\r
+            /**\r
+             * Adds a DOM event directly without the caching, cleanup, scope adj, etc\r
+             *\r
+             * @method _simpleAdd\r
+             * @param {HTMLElement} el      the element to bind the handler to\r
+             * @param {string}      sType   the type of event handler\r
+             * @param {function}    fn      the callback to invoke\r
+             * @param {boolen}      capture capture or bubble phase\r
+             * @static\r
+             * @private\r
+             */\r
+            _simpleAdd: function () {\r
+                if (window.addEventListener) {\r
+                    return function(el, sType, fn, capture) {\r
+                        el.addEventListener(sType, fn, (capture));\r
+                    };\r
+                } else if (window.attachEvent) {\r
+                    return function(el, sType, fn, capture) {\r
+                        el.attachEvent("on" + sType, fn);\r
+                    };\r
+                } else {\r
+                    return function(){};\r
+                }\r
+            }(),\r
+\r
+            /**\r
+             * Basic remove listener\r
+             *\r
+             * @method _simpleRemove\r
+             * @param {HTMLElement} el      the element to bind the handler to\r
+             * @param {string}      sType   the type of event handler\r
+             * @param {function}    fn      the callback to invoke\r
+             * @param {boolen}      capture capture or bubble phase\r
+             * @static\r
+             * @private\r
+             */\r
+            _simpleRemove: function() {\r
+                if (window.removeEventListener) {\r
+                    return function (el, sType, fn, capture) {\r
+                        el.removeEventListener(sType, fn, (capture));\r
+                    };\r
+                } else if (window.detachEvent) {\r
+                    return function (el, sType, fn) {\r
+                        el.detachEvent("on" + sType, fn);\r
+                    };\r
+                } else {\r
+                    return function(){};\r
+                }\r
+            }()\r
         };\r
-    } ();\r
+\r
+    }();\r
+\r
+    (function() {\r
+        var EU = YAHOO.util.Event;\r
+\r
+        /**\r
+         * YAHOO.util.Event.on is an alias for addListener\r
+         * @method on\r
+         * @see addListener\r
+         * @static\r
+         */\r
+        EU.on = EU.addListener;\r
+\r
+        // YAHOO.mix(EU, YAHOO.util.EventProvider.prototype);\r
+        // EU.createEvent("DOMContentReady");\r
+        // EU.subscribe("DOMContentReady", EU._load);\r
+\r
+        if (document && document.body) {\r
+            EU._load();\r
+        } else {\r
+            // EU._simpleAdd(document, "DOMContentLoaded", EU._load);\r
+            EU._simpleAdd(window, "load", EU._load);\r
+        }\r
+        EU._simpleAdd(window, "unload", EU._unload);\r
+        EU._tryPreloadAttach();\r
+    })();\r
+}\r
+\r
+/**\r
+ * EventProvider is designed to be used with YAHOO.augment to wrap \r
+ * CustomEvents in an interface that allows events to be subscribed to \r
+ * and fired by name.  This makes it possible for implementing code to\r
+ * subscribe to an event that either has not been created yet, or will\r
+ * not be created at all.\r
+ *\r
+ * @Class EventProvider\r
+ */\r
+YAHOO.util.EventProvider = function() { };\r
+\r
+YAHOO.util.EventProvider.prototype = {\r
 \r
     /**\r
+     * Private storage of custom events\r
+     * @property __yui_events\r
+     * @type Object[]\r
      * @private\r
      */\r
-    YAHOO.util.Event.on = YAHOO.util.Event.addListener;\r
+    __yui_events: null,\r
 \r
-    if (document && document.body) {\r
-        YAHOO.util.Event._load();\r
-    } else {\r
-        YAHOO.util.Event.on(window, "load", YAHOO.util.Event._load, \r
-                YAHOO.util.Event, true);\r
-    }\r
+    /**\r
+     * Private storage of custom event subscribers\r
+     * @property __yui_subscribers\r
+     * @type Object[]\r
+     * @private\r
+     */\r
+    __yui_subscribers: null,\r
+    \r
+    /**\r
+     * Subscribe to a CustomEvent by event type\r
+     *\r
+     * @method subscribe\r
+     * @param p_type     {string}   the type, or name of the event\r
+     * @param p_fn       {function} the function to exectute when the event fires\r
+     * @param p_obj\r
+     * @param p_obj      {Object}   An object to be passed along when the event \r
+     *                              fires\r
+     * @param p_override {boolean}  If true, the obj passed in becomes the \r
+     *                              execution scope of the listener\r
+     */\r
+    subscribe: function(p_type, p_fn, p_obj, p_override) {\r
+\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+\r
+        if (ce) {\r
+            ce.subscribe(p_fn, p_obj, p_override);\r
+        } else {\r
+            this.__yui_subscribers = this.__yui_subscribers || {};\r
+            var subs = this.__yui_subscribers;\r
+            if (!subs[p_type]) {\r
+                subs[p_type] = [];\r
+            }\r
+            subs[p_type].push(\r
+                { fn: p_fn, obj: p_obj, override: p_override } );\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Unsubscribes the from the specified event\r
+     * @method unsubscribe\r
+     * @param p_type {string}   The type, or name of the event\r
+     * @param p_fn   {Function} The function to execute\r
+     * @param p_obj  {Object}   The custom object passed to subscribe (optional)\r
+     * @return {boolean} true if the subscriber was found and detached.\r
+     */\r
+    unsubscribe: function(p_type, p_fn, p_obj) {\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+        if (ce) {\r
+            return ce.unsubscribe(p_fn, p_obj);\r
+        } else {\r
+            return false;\r
+        }\r
+    },\r
 \r
-    YAHOO.util.Event.on(window, "unload", YAHOO.util.Event._unload, \r
-                YAHOO.util.Event, true);\r
+    /**\r
+     * Creates a new custom event of the specified type.  If a custom event\r
+     * by that name already exists, it will not be re-created.  In either\r
+     * case the custom event is returned. \r
+     *\r
+     * @method createEvent\r
+     *\r
+     * @param p_type {string} the type, or name of the event\r
+     * @param p_config {object} optional config params.  Valid properties are:\r
+     *\r
+     *  <ul>\r
+     *    <li>\r
+     *      scope: defines the default execution scope.  If not defined\r
+     *      the default scope will be this instance.\r
+     *    </li>\r
+     *    <li>\r
+     *      silent: if true, the custom event will not generate log messages.\r
+     *      This is false by default.\r
+     *    </li>\r
+     *    <li>\r
+     *      onSubscribeCallback: specifies a callback to execute when the\r
+     *      event has a new subscriber.  This will fire immediately for\r
+     *      each queued subscriber if any exist prior to the creation of\r
+     *      the event.\r
+     *    </li>\r
+     *  </ul>\r
+     *\r
+     *  @return {CustomEvent} the custom event\r
+     *\r
+     */\r
+    createEvent: function(p_type, p_config) {\r
 \r
-    YAHOO.util.Event._tryPreloadAttach();\r
+        this.__yui_events = this.__yui_events || {};\r
+        var opts = p_config || {};\r
+        var events = this.__yui_events;\r
 \r
-}\r
+        if (events[p_type]) {\r
+        } else {\r
+\r
+            var scope  = opts.scope  || this;\r
+            var silent = opts.silent || null;\r
+\r
+            var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,\r
+                    YAHOO.util.CustomEvent.FLAT);\r
+            events[p_type] = ce;\r
+\r
+            if (opts.onSubscribeCallback) {\r
+                ce.subscribeEvent.subscribe(opts.onSubscribeCallback);\r
+            }\r
+\r
+            this.__yui_subscribers = this.__yui_subscribers || {};\r
+            var qs = this.__yui_subscribers[p_type];\r
+\r
+            if (qs) {\r
+                for (var i=0; i<qs.length; ++i) {\r
+                    ce.subscribe(qs[i].fn, qs[i].obj, qs[i].override);\r
+                }\r
+            }\r
+        }\r
+\r
+        return events[p_type];\r
+    },\r
+\r
+   /**\r
+     * Fire a custom event by name.  The callback functions will be executed\r
+     * from the scope specified when the event was created, and with the \r
+     * following parameters:\r
+     *   <ul>\r
+     *   <li>The first argument fire() was executed with</li>\r
+     *   <li>The custom object (if any) that was passed into the subscribe() \r
+     *       method</li>\r
+     *   </ul>\r
+     * @method fireEvent\r
+     * @param p_type    {string}  the type, or name of the event\r
+     * @param arguments {Object*} an arbitrary set of parameters to pass to \r
+     *                            the handler.\r
+     * @return {boolean} the return value from CustomEvent.fire, or null if \r
+     *                   the custom event does not exist.\r
+     */\r
+    fireEvent: function(p_type, arg1, arg2, etc) {\r
+\r
+        this.__yui_events = this.__yui_events || {};\r
+        var ce = this.__yui_events[p_type];\r
+\r
+        if (ce) {\r
+            var args = [];\r
+            for (var i=1; i<arguments.length; ++i) {\r
+                args.push(arguments[i]);\r
+            }\r
+            return ce.fire.apply(ce, args);\r
+        } else {\r
+            return null;\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Returns true if the custom event of the provided type has been created\r
+     * with createEvent.\r
+     * @method hasEvent\r
+     * @param type {string} the type, or name of the event\r
+     */\r
+    hasEvent: function(type) {\r
+        if (this.__yui_events) {\r
+            if (this.__yui_events[type]) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+\r
+};\r
 \r
index 18261a4bc6d4708582e4ff7a2388df712614ddcd..e93676e52a5fbe5ee819ec17ad347ebe9f01151b 100755 (executable)
@@ -1,9 +1,13 @@
-CSS Fonts Release Notes\r
+YUI Library - Fonts - Release Notes\r
 \r
-*** version 0.11.0 ***\r
+Version 0.12.0\r
 \r
-* No changes.\r
+  * No changes.\r
 \r
-*** version 0.10.0 ***\r
+Version 0.11.0\r
 \r
-* Initial release.\r
+  * No changes.\r
+\r
+Version 0.10.0\r
+\r
+  * Initial release.\r
index cdb152b4022425f0479b5f9a70f7f167ff17e378..236a1fa3bf4d11973142e0603e45d6b069e09b7d 100755 (executable)
@@ -1,7 +1 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
index 59808b1bae035b3e0905cc0cdf4d38c65b13ecc5..0e687b183e5b76de43eeb85c445eda948e8cc9a9 100755 (executable)
@@ -2,14 +2,14 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
+version: 0.12.0\r
 */\r
 \r
 /**\r
- * 84.5% for !IE, keywords for IE\r
+ * 84.5% for !IE, keywords for IE to preserve user font-size adjustment\r
  * Percents could work for IE, but for backCompat purposes, we are using keywords.\r
- * x-small is for IE < 6 and IE6 quirks mode.\r
- * \r
+ * x-small is for IE6/7 quirks mode.\r
+ *\r
  */\r
 body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}\r
 table {font-size:inherit;font:100%;}\r
index 16fe8fbc9a1b09ea835a769224ddeb99dbf68271..f2e0b4f4e87f25da3bbbddcda7737bd57c03311a 100755 (executable)
@@ -1,10 +1,40 @@
-CSS Grids Release Notes\r
+YUI Library - Grids - Release Notes\r
 \r
-*** version 0.11.0 ***\r
+Version 0.12.0\r
 \r
-* Removed line #43 because it set an already-set value. \r
-  Was: ".yui-t7  #main .yui-b{min-width:750px;}"\r
+  * Removed redundant "text-align:left" from nodes below #doc.\r
+\r
+  * Removed small-font treatment on #ft.\r
+\r
+  * Removed margin-bottom from #hd,#bd.\r
+\r
+  * Added two new #doc definitions (#doc2 and #doc3) that provide \r
+    950px centered and 100% page width presets to supplement the \r
+    original 750px centered page width.\r
+\r
+  * Made ".first" selectors more precise by binding to divs, to \r
+    make it less likely that our .first definitions will impact \r
+    nested content elements wishing to use this nomenclature.\r
+\r
+  * Fixed "nested yui-gc" bug.\r
+\r
+  * Fixed build-process whitespace bug with .yui-t2 and .yui-t5.\r
+\r
+  * Migrated .yui-t's technique to "negative margins" technique \r
+    from "floated ems".\r
+\r
+  * The "negative margins" technique caused z-index issues, so \r
+    position:relative was added to the secondary yui-b to enable \r
+       correct z-index.\r
+\r
+  * Make optimization benefits from inheritence wins via code \r
+    reorganizations.\r
+\r
+Version 0.11.0\r
+\r
+  * Removed line #43 because it set an already-set value.\r
+    Was: ".yui-t7  #main .yui-b{min-width:750px;}"\r
   \r
-*** version 0.10.0 ***\r
+Version 0.10.0\r
 \r
-* Initial release.
\ No newline at end of file
+  * Initial release.
\ No newline at end of file
index b3f285342fe3d6d6ad3663b81d730ad75b649d17..b381490df9ab27e43270bf365aa9442f745f3221 100755 (executable)
@@ -1,7 +1,2 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-body{text-align:center;}#doc{width:57.69em;*width:56.3em;min-width:750px;margin:auto;text-align:left;}#hd,#bd{margin-bottom:1em;text-align:left;}#ft{font-size:77%;font-family:verdana;clear:both;}.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b{float:right;}.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{float:left;}.yui-t1 #yui-main .yui-b{width:76%;min-width:570px;}.yui-t1 .yui-b{width:21.33%;min-width:160px;}.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b{width:73.4%;min-width:550px;}.yui-t2 .yui-b, .yui-t4 .yui-b{width:24%;min-width:180px;}.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{width:57.6%;min-width:430px;}.yui-t3 .yui-b, .yui-t6 .yui-b{width:40%;min-width:300px;}.yui-t5 #yui-main .yui-b{width:65.4%;min-width:490px;}.yui-t5 .yui-b{width:32%;min-width:240px;}.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u{float:right;display:inline;}.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first{float:left;}.yui-g .yui-u, .yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb .first, .yui-gc .first, .yui-gd .first{margin-left:0;}.yui-gc .first, .yui-gd .yui-u{width:66%;}.yui-gd .first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge .first, .yui-gf .yui-u{width:74.2%;}.yui-gf .first{width:24%;}.yui-ge .first{width:74.2%;}#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
+/* Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.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-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.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-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#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 2af0f6a030dc93dcae5b4d8c05867af589f3249f..81918d247c5b371c986086666ac11c86d0aceb34 100755 (executable)
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
+version: 0.12.0\r
 */\r
-body {\r
-   text-align:center;\r
-}\r
 \r
-#doc {\r
-   width:57.69em;\r
-   *width:56.3em; /* IE */\r
-   min-width:750px;\r
-   margin:auto;\r
-   text-align:left;\r
+/* for all templates and grids */\r
+body{text-align:center;}\r
+#ft{clear:both;}\r
+/**/\r
+/* 750 centered, and backward compatibility */\r
+#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {\r
+       margin:auto;text-align:left;\r
+       width:57.69em;*width:56.3em;min-width:750px;}\r
+/* 950 centered */\r
+#doc2 {\r
+       width:73.074em;*width:71.313em;min-width:950px;}\r
+/* 100% with 10px viewport side matting */\r
+#doc3 {\r
+       margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */\r
+       width:auto;}\r
+\r
+/* below required for all fluid grids; adjust widths and margins above accordingly */\r
+\r
+       /* to preserve source-order independence for Gecko */\r
+       .yui-b{position:relative;}\r
+       .yui-b{_position:static;} /* for IE < 7 */\r
+       #yui-main .yui-b{position:static;}\r
+\r
+#yui-main {width:100%;}\r
+.yui-t1 #yui-main,\r
+.yui-t2 #yui-main,\r
+.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}\r
+\r
+.yui-t4 #yui-main,\r
+.yui-t5 #yui-main,\r
+.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}\r
+\r
+.yui-t1 .yui-b {\r
+       float:left;\r
+    width:12.3207em;*width:12.0106em;}\r
+.yui-t1 #yui-main .yui-b{\r
+    margin-left:13.3207em;*margin-left:13.0106em;\r
 }\r
 \r
-#hd,#bd {margin-bottom:1em;text-align:left;}\r
-#ft {font-size:77%;font-family:verdana;clear:both;}\r
-\r
-/* rules for main templates */\r
-.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b {float:right;}\r
-.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {float:left;}\r
-\r
-/* t1: L160 */\r
-.yui-t1 #yui-main .yui-b {width:76%;min-width:570px;}\r
-.yui-t1 .yui-b {width:21.33%;min-width:160px;}\r
-\r
-/* t2 & t4: L180 & R180 */\r
-.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b {width:73.4%;min-width:550px;}\r
-.yui-t2 .yui-b, .yui-t4 .yui-b {width:24%;min-width:180px;}\r
-\r
-/* t3 & t6: L300 & R300 */\r
-.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {width:57.6%;min-width:430px;}\r
-.yui-t3 .yui-b, .yui-t6 .yui-b {width:40%;min-width:300px;}\r
-\r
-/* t5: R240 */\r
-.yui-t5 #yui-main .yui-b {width:65.4%;min-width:490px;}\r
-.yui-t5 .yui-b {width:32%;min-width:240px;}\r
-\r
-/* t7: 750 */\r
-\r
-\r
-\r
-/*     grid-generic rules for all templates */\r
-\r
-/* all modules and grids nested in a grid get floated */\r
-.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u {\r
-   float:right; \r
-   display:inline;   /* IE */ \r
+.yui-t2 .yui-b {\r
+       float:left;\r
+    width:13.8456em;*width:13.512em;}\r
+.yui-t2 #yui-main .yui-b {\r
+    margin-left:14.8456em;*margin-left:14.512em;\r
 }\r
 \r
-/* float left and kill margin on first for added flex */\r
-.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first {float:left; }\r
-\r
-/* 2 col */\r
-.yui-g .yui-u, .yui-g .yui-g {width:49.1%;}\r
-.yui-g .yui-g .yui-u {width:48.1%;} /* smaller for nested to preserve margins */\r
-\r
-/* 3 col */\r
-.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u {\r
-   float:left; /* need to reverse the order for 3 */\r
-   margin-left:2%; *margin-left:1.895%;   \r
-   width:32%;\r
+.yui-t3 .yui-b {\r
+       float:left;\r
+    width:23.0759em;*width:22.52em;}\r
+.yui-t3 #yui-main .yui-b {\r
+    margin-left:24.0759em;*margin-left:23.52em;\r
 }\r
 \r
-.yui-gb .first, .yui-gc .first, .yui-gd .first {margin-left:0;}\r
+.yui-t4 .yui-b {\r
+       float:right;\r
+    width:13.8456em;*width:13.512em;}\r
+.yui-t4 #yui-main .yui-b {\r
+    margin-right:14.8456em;*margin-right:14.512em;\r
+}\r
 \r
-/* colspan 2 */\r
-.yui-gc .first, .yui-gd .yui-u {width:66%;}\r
-.yui-gd .first {width:32%;}\r
+.yui-t5 .yui-b {\r
+       float:right;\r
+    width:18.4608em;*width:18.016em;}\r
+.yui-t5 #yui-main .yui-b {\r
+    margin-right:19.4608em;*margin-right:19.016em;\r
+}\r
 \r
-/* colspan 3 */\r
-.yui-ge .yui-u {width:24%;}\r
-.yui-ge .first, .yui-gf .yui-u {width:74.2%;}\r
-.yui-gf .first {width:24%;}\r
-.yui-ge .first {width:74.2%;}\r
+.yui-t6 .yui-b {\r
+       float:right;\r
+    width:23.0759em;*width:22.52em;}\r
+.yui-t6 #yui-main .yui-b {\r
+    margin-right:24.0759em;*margin-right:23.52em;\r
+}\r
 \r
-/* self clear floated parent containers */\r
-#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;}  \r
-#bd, .yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf {zoom:1;} /* IE */
\ No newline at end of file
+.yui-t7 #yui-main .yui-b {\r
+       display:block;margin:0 0 1em 0;\r
+}\r
+#yui-main .yui-b {float:none;width:auto;}\r
+/* GRIDS (not TEMPLATES) */\r
+.yui-g .yui-u,\r
+.yui-g .yui-g,\r
+.yui-gc .yui-u,\r
+.yui-gc .yui-g .yui-u,\r
+.yui-ge .yui-u,\r
+.yui-gf .yui-u{float:right;display:inline;}\r
+.yui-g div.first,\r
+.yui-gc div.first,\r
+.yui-gc div.first div.first,\r
+.yui-gd div.first,\r
+.yui-ge div.first,\r
+.yui-gf div.first{float:left;}\r
+.yui-g .yui-u,\r
+.yui-g .yui-g{width:49.1%;}\r
+.yui-g .yui-g .yui-u,\r
+.yui-gc .yui-g .yui-u {width:48.1%;}\r
+.yui-gb .yui-u,\r
+.yui-gc .yui-u,\r
+.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}\r
+.yui-gb div.first,\r
+.yui-gc div.first,\r
+.yui-gd div.first{margin-left:0;}\r
+.yui-gc div.first,\r
+.yui-gd .yui-u{width:66%;}\r
+.yui-gd div.first{width:32%;}\r
+.yui-ge .yui-u{width:24%;}\r
+.yui-ge div.first,\r
+.yui-gf .yui-u{width:74.2%;}\r
+.yui-gf div.first{width:24%;}\r
+.yui-ge div.first{width:74.2%;}\r
+#bd:after,\r
+.yui-g:after,\r
+.yui-gb:after,\r
+.yui-gc:after,\r
+.yui-gd:after,\r
+.yui-ge:after,\r
+.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}\r
+#bd,\r
+.yui-g,\r
+.yui-gb,\r
+.yui-gc,\r
+.yui-gd,\r
+.yui-ge,\r
+.yui-gf{zoom:1;}
\ No newline at end of file
index 1099a2b261a722e568e737a45d2c879a24c73756..f73981cea05bd1d64f0299db406953a9ca70d644 100755 (executable)
@@ -1,5 +1,33 @@
 Logger Release Notes\r
 \r
+*** version 0.12.0 ***\r
+\r
+* Added method formatMsg(oLogMsg) to support custom formatting of log messages\r
+for output to a LogReader.\r
+\r
+\r
+\r
+*** version 0.11.3 ***\r
+\r
+* The Logger static method enableFirebug() has been RENAMED to\r
+enableBrowserConsole().\r
+\r
+* The Logger static method disableFirebug() has been RENAMED to\r
+disableBrowserConsole().\r
+\r
+* By default, the Logger will not automatically output to Firebug or Safari's\r
+JavaScript console. To enable this feature, implementers should now explicitly\r
+call\r
+YAHOO.widget.Logger.enableBrowserConsole().\r
+\r
+* Implementers may now cap the size of the YAHOO.widget.Logger stack by setting\r
+the property YAHOO.widget.Logger.maxStackEntries.\r
+\r
+* Implementers may now control the number of items displayed in each console by\r
+setting the LogReader properties thresholdMax and thresholdMin.\r
+\r
+\r
+\r
 *** version 0.11.0 ***\r
 \r
 * Initial release\r
index 86f90240d3cbd98beef21658bd4b1a9894427802..a7e9a50bbde17e982214889a997bdb8d1249336e 100755 (executable)
@@ -1 +1,20 @@
-/* logger default styles */\r\r/* font size is controlled here: default 77% */\r\r#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}\r\r/* width is controlled here: default 31em */\r\r.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}\r\r.yui-log p {margin:1px;padding:.1em;}\r\r.yui-log button {font-family:monospace;}\r\r.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}\r\r/* height is controlled here: default 20em*/\r\r.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}\r\r.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}\r\r.yui-log .yui-log-ft .yui-log-categoryfilters {}\r\r.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}\r\r.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}\r\r.yui-log .yui-log-filtergrp {margin-right:.5em;}\r\r.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */\r\r.yui-log .warn {background-color:#F58516;} /* F58516 orange */\r\r.yui-log .error {background-color:#E32F0B;color:black;} /* E32F0B red */\r\r.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */\r\r.yui-log .window {background-color:#F2E886;} /* F2E886 tan */\r\r
\ No newline at end of file
+/* logger default styles */\r\r
+/* font size is controlled here: default 77% */\r\r
+#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}\r\r
+/* width is controlled here: default 31em */\r\r
+.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}\r\r
+.yui-log p {margin:1px;padding:.1em;}\r\r
+.yui-log button {font-family:monospace;}\r\r
+.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}\r\r
+/* height is controlled here: default 20em*/\r\r
+.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}\r\r
+.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}\r\r
+.yui-log .yui-log-ft .yui-log-categoryfilters {}\r\r
+.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}\r\r
+.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}\r\r
+.yui-log .yui-log-filtergrp {margin-right:.5em;}\r\r
+.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */\r\r
+.yui-log .warn {background-color:#F58516;} /* F58516 orange */\r\r
+.yui-log .error {background-color:#E32F0B;} /* E32F0B red */\r\r
+.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */\r\r
+.yui-log .window {background-color:#F2E886;} /* F2E886 tan */\r\r
index bbd42f558ad72b1656ce9dde272736df1bbcd8d7..a2b40b29cccdb0450950d73821ab18c485bc127a 100755 (executable)
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-\r
+/*\r\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
+Code licensed under the BSD License:\r\r
+http://developer.yahoo.com/yui/license.txt\r\r
+version: 0.12.0\r\r
+*/\r\r
+\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
-/**\r\r
- * Singleton providing core logging functionality. Saves logs written through the\r\r
- * global YAHOO.log function or written by LogWriter. Provides access to logs\r\r
- * for reading by LogReader. Log messages are automatically output to Firebug,\r\r
- * if present.\r\r
- *\r\r
- * requires YAHOO.util.Event Event utility\r\r
- */\r\r
-YAHOO.widget.Logger = {\r\r
-    // Initialize members\r\r
-    loggerEnabled: true,\r\r
-    _firebugEnabled: true,\r\r
-    categories: ["info","warn","error","time","window"],\r\r
-    sources: ["global"],\r\r
-    _stack: [], // holds all log msgs\r\r
-    _startTime: new Date().getTime(), // static start timestamp\r\r
-    _lastTime: null // timestamp of last logged message\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Fired when a new category has been created. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The category name\r\r
- */\r\r
-YAHOO.widget.Logger.categoryCreateEvent = new YAHOO.util.CustomEvent("categoryCreate", this, true);\r\r
 \r\r
 /**\r\r
- * Fired when a new source has been named. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The source name\r\r
- */\r\r
-YAHOO.widget.Logger.sourceCreateEvent = new YAHOO.util.CustomEvent("sourceCreate", this, true);\r\r
-\r\r
-/**\r\r
- * Fired when a new log message has been created. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The log message\r\r
- */\r\r
-YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r\r
-\r\r
-/**\r\r
- * Fired when the Logger has been reset has been created.\r\r
- */\r\r
-YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r\r
-\r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Saves a log message to the stack and fires newLogEvent. If the log message is\r\r
- * assigned to an unknown category, creates a new category. If the log message is\r\r
- * from an unknown source, creates a new source.  If Firebug is enabled,\r\r
- * outputs the log message to Firebug.\r\r
+ * The LogMsg class defines a single log message.\r\r
  *\r\r
- * @param {string} sMsg The log message\r\r
- * @param {string} sCategory Category of log message, or null\r\r
- * @param {string} sSource Source of LogWriter, or null if global\r\r
+ * @class LogMsg\r\r
+ * @constructor\r\r
+ * @param oConfigs {Object} Object literal of configuration params.\r\r
  */\r\r
-YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r\r
-    if(this.loggerEnabled) {\r\r
-        if(!sCategory) {\r\r
-            sCategory = "info"; // default category\r\r
-        }\r\r
-        else if(this._isNewCategory(sCategory)) {\r\r
-            this._createNewCategory(sCategory);\r\r
-        }\r\r
-        var sClass = "global"; // default source\r\r
-        var sDetail = null;\r\r
-        if(sSource) {\r\r
-            var spaceIndex = sSource.indexOf(" ");\r\r
-            if(spaceIndex > 0) {\r\r
-                sClass = sSource.substring(0,spaceIndex);// substring until first space\r\r
-                sDetail = sSource.substring(spaceIndex,sSource.length);// the rest of the source\r\r
-            }\r\r
-            else {\r\r
-                sClass = sSource;\r\r
-            }\r\r
-            if(this._isNewSource(sClass)) {\r\r
-                this._createNewSource(sClass);\r\r
-            }\r\r
+ YAHOO.widget.LogMsg = function(oConfigs) {\r\r
+    // Parse configs\r\r
+    if (typeof oConfigs == "object") {\r\r
+        for(var param in oConfigs) {\r\r
+            this[param] = oConfigs[param];\r\r
         }\r\r
-\r\r
-        var timestamp = new Date();\r\r
-        var logEntry = {\r\r
-            time: timestamp,\r\r
-            category: sCategory,\r\r
-            source: sClass,\r\r
-            sourceDetail: sDetail,\r\r
-            msg: sMsg\r\r
-        };\r\r
-\r\r
-        this._stack.push(logEntry);\r\r
-        this.newLogEvent.fire(logEntry);\r\r
-\r\r
-        if(this._firebugEnabled) {\r\r
-            this._printToFirebug(logEntry);\r\r
-        }\r\r
-        return true;\r\r
     }\r\r
-    else {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r\r
- *\r\r
- */\r\r
-YAHOO.widget.Logger.reset = function() {\r\r
-    this._stack = [];\r\r
-    this._startTime = new Date().getTime();\r\r
-    this.loggerEnabled = true;\r\r
-    this.log(null, "Logger reset");\r\r
-    this.logResetEvent.fire();\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to internal stack of log messages.\r\r
- *\r\r
- * @return {array} Array of log messages.\r\r
- */\r\r
-YAHOO.widget.Logger.getStack = function() {\r\r
-    return this._stack;\r\r
-};\r\r
+ };\r\r
\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
 /**\r\r
- * Public accessor to internal start time.\r\r
+ * Log message.\r\r
  *\r\r
- * @return {date} Internal date of when Logger singleton was initialized.\r\r
- */\r\r
-YAHOO.widget.Logger.getStartTime = function() {\r\r
-    return this._startTime;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Disables output to the Firebug Firefox extension.\r\r
- */\r\r
-YAHOO.widget.Logger.disableFirebug = function() {\r\r
-    YAHOO.log("YAHOO.Logger output to Firebug has been disabled.");\r\r
-    this._firebugEnabled = false;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Enables output to the Firebug Firefox extension.\r\r
+ * @property msg\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger.enableFirebug = function() {\r\r
-    this._firebugEnabled = true;\r\r
-    YAHOO.log("YAHOO.Logger output to Firebug has been enabled.");\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+YAHOO.widget.LogMsg.prototype.msg = null;\r\r
\r\r
 /**\r\r
- * Creates a new category of log messages and fires categoryCreateEvent.\r\r
+ * Log timestamp.\r\r
  *\r\r
- * @param {string} category Category name\r\r
- * @private\r\r
+ * @property time\r\r
+ * @type Date\r\r
  */\r\r
-YAHOO.widget.Logger._createNewCategory = function(category) {\r\r
-    this.categories.push(category);\r\r
-    this.categoryCreateEvent.fire(category);\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.time = null;\r\r
 \r\r
 /**\r\r
- * Checks to see if a category has already been created.\r\r
+ * Log category.\r\r
  *\r\r
- * @param {string} category Category name\r\r
- * @return {boolean} Returns true if category is unknown, else returns false\r\r
- * @private\r\r
+ * @property category\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._isNewCategory = function(category) {\r\r
-    for(var i=0; i < this.categories.length; i++) {\r\r
-        if(category == this.categories[i]) {\r\r
-            return false;\r\r
-        }\r\r
-    }\r\r
-    return true;\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.category = null;\r\r
 \r\r
 /**\r\r
- * Creates a new source of log messages and fires sourceCreateEvent.\r\r
+ * Log source. The first word passed in as the source argument.\r\r
  *\r\r
- * @param {string} source Source name\r\r
- * @private\r\r
+ * @property source\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._createNewSource = function(source) {\r\r
-    this.sources.push(source);\r\r
-    this.sourceCreateEvent.fire(source);\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.source = null;\r\r
 \r\r
 /**\r\r
- * Checks to see if a source has already been created.\r\r
+ * Log source detail. The remainder of the string passed in as the source argument, not\r\r
+ * including the first word (if any).\r\r
  *\r\r
- * @param {string} source Source name\r\r
- * @return {boolean} Returns true if source is unknown, else returns false\r\r
- * @private\r\r
+ * @property sourceDetail\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._isNewSource = function(source) {\r\r
-    if(source) {\r\r
-        for(var i=0; i < this.sources.length; i++) {\r\r
-            if(source == this.sources[i]) {\r\r
-                return false;\r\r
-            }\r\r
-        }\r\r
-        return true;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Outputs a log message to Firebug.\r\r
- *\r\r
- * @param {object} entry Log entry object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.Logger._printToFirebug = function(entry) {\r\r
-    if(window.console && console.log) {\r\r
-        var category = entry.category;\r\r
-        var label = entry.category.substring(0,4).toUpperCase();\r\r
-\r\r
-        var time = entry.time;\r\r
-        if (time.toLocaleTimeString) {\r\r
-            var localTime  = time.toLocaleTimeString();\r\r
-        }\r\r
-        else {\r\r
-            localTime = time.toString();\r\r
-        }\r\r
-\r\r
-        var msecs = time.getTime();\r\r
-        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r\r
-            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r\r
-        YAHOO.widget.Logger._lastTime = msecs;\r\r
-\r\r
-        var output = //Firebug doesn't support HTML "<span class='"+category+"'>"+label+"</span> " +\r\r
-            localTime + " (" +\r\r
-            elapsedTime + "ms): " +\r\r
-            entry.source + ": " +\r\r
-            entry.msg;\r\r
-\r\r
-        \r\r
-        console.log(output);\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Private event handlers\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Handles logging of messages due to window error events.\r\r
- *\r\r
- * @param {string} msg The error message\r\r
- * @param {string} url URL of the error\r\r
- * @param {string} line Line number of the error\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.Logger._onWindowError = function(msg,url,line) {\r\r
-    // Logger is not in scope of this event handler\r\r
-    try {\r\r
-        YAHOO.widget.Logger.log(msg+' ('+url+', line '+line+')', "window");\r\r
-        if(YAHOO.widget.Logger._origOnWindowError) {\r\r
-            YAHOO.widget.Logger._origOnWindowError();\r\r
-        }\r\r
-    }\r\r
-    catch(e) {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handle native JavaScript errors\r\r
- */\r\r
-//NB: Not all browsers support the window.onerror event\r\r
-if(window.onerror) {\r\r
-    // Save any previously defined handler to call\r\r
-    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r\r
-}\r\r
-window.onerror = YAHOO.widget.Logger._onWindowError;\r\r
-\r\r
-/**\r\r
- * First log\r\r
- */\r\r
-YAHOO.widget.Logger.log("Logger initialized");\r\r
+YAHOO.widget.LogMsg.prototype.sourceDetail = null;\r\r
 \r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
+\r\r
 /**\r\r
- * Class providing ability to log messages through YAHOO.widget.Logger from a\r\r
- * named source.\r\r
+ * The LogWriter class provides a mechanism to log messages through\r\r
+ * YAHOO.widget.Logger from a named source.\r\r
  *\r\r
+ * @class LogWriter\r\r
  * @constructor\r\r
- * @param {string} sSource Source of LogWriter instance\r\r
+ * @param sSource {String} Source of LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter = function(sSource) {\r\r
     if(!sSource) {\r\r
-        YAHOO.log("Could not instantiate LogWriter due to invalid source.", "error", "LogWriter");\r\r
+        YAHOO.log("Could not instantiate LogWriter due to invalid source.",\r\r
+            "error", "LogWriter");\r\r
         return;\r\r
     }\r\r
     this._source = sSource;\r\r
  };\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
  /**\r\r
  * Public accessor to the unique name of the LogWriter instance.\r\r
  *\r\r
- * @return {string} Unique name of the LogWriter instance\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.toString = function() {\r\r
     return "LogWriter " + this._sSource;\r\r
@@ -327,8 +112,9 @@ YAHOO.widget.LogWriter.prototype.toString = function() {
 /**\r\r
  * Logs a message attached to the source of the LogWriter.\r\r
  *\r\r
- * @param {string} sMsg The log message\r\r
- * @param {string} sCategory Category name\r\r
+ * @method log\r\r
+ * @param sMsg {String} The log message.\r\r
+ * @param sCategory {String} Category name.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {\r\r
     YAHOO.widget.Logger.log(sMsg, sCategory, this._source);\r\r
@@ -337,7 +123,8 @@ YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {
 /**\r\r
  * Public accessor to get the source name.\r\r
  *\r\r
- * @return {string} The LogWriter source\r\r
+ * @method getSource\r\r
+ * @return {String} The LogWriter source.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.getSource = function() {\r\r
     return this._sSource;\r\r
@@ -346,7 +133,8 @@ YAHOO.widget.LogWriter.prototype.getSource = function() {
 /**\r\r
  * Public accessor to set the source name.\r\r
  *\r\r
- * @param {string} sSource Source of LogWriter instance\r\r
+ * @method setSource\r\r
+ * @param sSource {String} Source of LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {\r\r
     if(!sSource) {\r\r
@@ -357,13 +145,18 @@ YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {
         this._sSource = sSource;\r\r
     }\r\r
 };\r\r
-/***************************************************************************\r\r
- * Private members\r\r
- ***************************************************************************/\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Source of the log writer instance.\r\r
+ * Source of the LogWriter instance.\r\r
  *\r\r
- * @type string\r\r
+ * @property _source\r\r
+ * @type String\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype._source = null;\r\r
@@ -375,51 +168,51 @@ YAHOO.widget.LogWriter.prototype._source = null;
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Class providing UI to read messages logged to YAHOO.widget.Logger.\r\r
- *\r\r
- * requires YAHOO.util.Dom DOM utility\r\r
- * requires YAHOO.util.Event Event utility\r\r
- * optional YAHOO.util.DragDrop Drag and drop utility\r\r
+ * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.\r\r
  *\r\r
+ * @class LogReader\r\r
  * @constructor\r\r
- * @param {el or ID} containerEl DOM element object or ID of container to wrap reader UI\r\r
- * @param {object} oConfig Optional object literal of configuration params\r\r
+ * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.\r\r
+ * @param elContainer {String} (optional) String ID of an existing DIV.\r\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params.\r\r
  */\r\r
-YAHOO.widget.LogReader = function(containerEl, oConfig) {\r\r
+YAHOO.widget.LogReader = function(elContainer, oConfigs) {\r\r
     var oSelf = this;\r\r
+    this._sName = YAHOO.widget.LogReader._index;\r\r
+    YAHOO.widget.LogReader._index++;\r\r
 \r\r
     // Parse config vars here\r\r
-    if (typeof oConfig == "object") {\r\r
-        for(var param in oConfig) {\r\r
-            this[param] = oConfig[param];\r\r
+    if (typeof oConfigs == "object") {\r\r
+        for(var param in oConfigs) {\r\r
+            this[param] = oConfigs[param];\r\r
         }\r\r
     }\r\r
 \r\r
     // Attach container...\r\r
-    if(containerEl) {\r\r
-        if(typeof containerEl == "string") {\r\r
-            this._containerEl = document.getElementById(containerEl);\r\r
+    if(elContainer) {\r\r
+        if(typeof elContainer == "string") {\r\r
+            this._elContainer = document.getElementById(elContainer);\r\r
         }\r\r
-        else if(containerEl.tagName) {\r\r
-            this._containerEl = containerEl;\r\r
+        else if(elContainer.tagName) {\r\r
+            this._elContainer = elContainer;\r\r
         }\r\r
-        this._containerEl.className = "yui-log";\r\r
+        this._elContainer.className = "yui-log";\r\r
     }\r\r
     // ...or create container from scratch\r\r
-    if(!this._containerEl) {\r\r
-        if(YAHOO.widget.LogReader._defaultContainerEl) {\r\r
-            this._containerEl =  YAHOO.widget.LogReader._defaultContainerEl;\r\r
+    if(!this._elContainer) {\r\r
+        if(YAHOO.widget.LogReader._elDefaultContainer) {\r\r
+            this._elContainer =  YAHOO.widget.LogReader._elDefaultContainer;\r\r
         }\r\r
         else {\r\r
-            this._containerEl = document.body.appendChild(document.createElement("div"));\r\r
-            this._containerEl.id = "yui-log";\r\r
-            this._containerEl.className = "yui-log";\r\r
+            this._elContainer = document.body.appendChild(document.createElement("div"));\r\r
+            this._elContainer.id = "yui-log";\r\r
+            this._elContainer.className = "yui-log";\r\r
 \r\r
-            YAHOO.widget.LogReader._defaultContainerEl = this._containerEl;\r\r
+            YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;\r\r
         }\r\r
 \r\r
         // If implementer has provided container values, trust and set those\r\r
-        var containerStyle = this._containerEl.style;\r\r
+        var containerStyle = this._elContainer.style;\r\r
         if(this.width) {\r\r
             containerStyle.width = this.width;\r\r
         }\r\r
@@ -440,89 +233,100 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
         }\r\r
     }\r\r
 \r\r
-    if(this._containerEl) {\r\r
+    if(this._elContainer) {\r\r
         // Create header\r\r
-        if(!this._hdEl) {\r\r
-            this._hdEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._hdEl.id = "yui-log-hd" + YAHOO.widget.LogReader._index;\r\r
-            this._hdEl.className = "yui-log-hd";\r\r
-\r\r
-            this._collapseEl = this._hdEl.appendChild(document.createElement("div"));\r\r
-            this._collapseEl.className = "yui-log-btns";\r\r
-\r\r
-            this._collapseBtn = document.createElement("input");\r\r
-            this._collapseBtn.type = "button";\r\r
-            this._collapseBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._collapseBtn.className = "yui-log-button";\r\r
-            this._collapseBtn.value = "Collapse";\r\r
-            this._collapseBtn = this._collapseEl.appendChild(this._collapseBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._collapseBtn,'click',oSelf._onClickCollapseBtn,oSelf);\r\r
-\r\r
-            this._title = this._hdEl.appendChild(document.createElement("h4"));\r\r
+        if(!this._elHd) {\r\r
+            this._elHd = this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elHd.id = "yui-log-hd" + this._sName;\r\r
+            this._elHd.className = "yui-log-hd";\r\r
+\r\r
+            this._elCollapse = this._elHd.appendChild(document.createElement("div"));\r\r
+            this._elCollapse.className = "yui-log-btns";\r\r
+\r\r
+            this._btnCollapse = document.createElement("input");\r\r
+            this._btnCollapse.type = "button";\r\r
+            this._btnCollapse.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnCollapse.className = "yui-log-button";\r\r
+            this._btnCollapse.value = "Collapse";\r\r
+            this._btnCollapse = this._elCollapse.appendChild(this._btnCollapse);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);\r\r
+\r\r
+            this._title = this._elHd.appendChild(document.createElement("h4"));\r\r
             this._title.innerHTML = "Logger Console";\r\r
 \r\r
             // If Drag and Drop utility is available...\r\r
             // ...and this container was created from scratch...\r\r
             // ...then make the header draggable\r\r
             if(YAHOO.util.DD &&\r\r
-            (YAHOO.widget.LogReader._defaultContainerEl == this._containerEl)) {\r\r
-                var ylog_dd = new YAHOO.util.DD(this._containerEl.id);\r\r
-                ylog_dd.setHandleElId(this._hdEl.id);\r\r
-                this._hdEl.style.cursor = "move";\r\r
+            (YAHOO.widget.LogReader._elDefaultContainer == this._elContainer)) {\r\r
+                var ylog_dd = new YAHOO.util.DD(this._elContainer.id);\r\r
+                ylog_dd.setHandleElId(this._elHd.id);\r\r
+                this._elHd.style.cursor = "move";\r\r
             }\r\r
         }\r\r
         // Ceate console\r\r
-        if(!this._consoleEl) {\r\r
-            this._consoleEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._consoleEl.className = "yui-log-bd";\r\r
-            \r\r
+        if(!this._elConsole) {\r\r
+            this._elConsole =\r\r
+                this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elConsole.className = "yui-log-bd";\r\r
+\r\r
             // If implementer has provided console, trust and set those\r\r
             if(this.height) {\r\r
-                this._consoleEl.style.height = this.height;\r\r
+                this._elConsole.style.height = this.height;\r\r
             }\r\r
         }\r\r
         // Don't create footer if disabled\r\r
-        if(!this._ftEl && this.footerEnabled) {\r\r
-            this._ftEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._ftEl.className = "yui-log-ft";\r\r
-\r\r
-            this._btnsEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._btnsEl.className = "yui-log-btns";\r\r
-\r\r
-            this._pauseBtn = document.createElement("input");\r\r
-            this._pauseBtn.type = "button";\r\r
-            this._pauseBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._pauseBtn.className = "yui-log-button";\r\r
-            this._pauseBtn.value = "Pause";\r\r
-            this._pauseBtn = this._btnsEl.appendChild(this._pauseBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._pauseBtn,'click',oSelf._onClickPauseBtn,oSelf);\r\r
-\r\r
-            this._clearBtn = document.createElement("input");\r\r
-            this._clearBtn.type = "button";\r\r
-            this._clearBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._clearBtn.className = "yui-log-button";\r\r
-            this._clearBtn.value = "Clear";\r\r
-            this._clearBtn = this._btnsEl.appendChild(this._clearBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._clearBtn,'click',oSelf._onClickClearBtn,oSelf);\r\r
-\r\r
-            this._categoryFiltersEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._categoryFiltersEl.className = "yui-log-categoryfilters";\r\r
-            this._sourceFiltersEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._sourceFiltersEl.className = "yui-log-sourcefilters";\r\r
+        if(!this._elFt && this.footerEnabled) {\r\r
+            this._elFt = this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elFt.className = "yui-log-ft";\r\r
+\r\r
+            this._elBtns = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elBtns.className = "yui-log-btns";\r\r
+\r\r
+            this._btnPause = document.createElement("input");\r\r
+            this._btnPause.type = "button";\r\r
+            this._btnPause.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnPause.className = "yui-log-button";\r\r
+            this._btnPause.value = "Pause";\r\r
+            this._btnPause = this._elBtns.appendChild(this._btnPause);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);\r\r
+\r\r
+            this._btnClear = document.createElement("input");\r\r
+            this._btnClear.type = "button";\r\r
+            this._btnClear.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnClear.className = "yui-log-button";\r\r
+            this._btnClear.value = "Clear";\r\r
+            this._btnClear = this._elBtns.appendChild(this._btnClear);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);\r\r
+\r\r
+            this._elCategoryFilters = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elCategoryFilters.className = "yui-log-categoryfilters";\r\r
+            this._elSourceFilters = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elSourceFilters.className = "yui-log-sourcefilters";\r\r
         }\r\r
     }\r\r
 \r\r
-    // Initialize buffer\r\r
+    // Initialize internal vars\r\r
     if(!this._buffer) {\r\r
         this._buffer = []; // output buffer\r\r
     }\r\r
+    // Timestamp of last log message to console\r\r
+    this._lastTime = YAHOO.widget.Logger.getStartTime(); \r\r
+    \r\r
+    // Subscribe to Logger custom events\r\r
     YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime(); // timestamp of last log message to console\r\r
+    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r\r
 \r\r
     // Initialize category filters\r\r
     this._categoryFilters = [];\r\r
     var catsLen = YAHOO.widget.Logger.categories.length;\r\r
-    if(this._categoryFiltersEl) {\r\r
+    if(this._elCategoryFilters) {\r\r
         for(var i=0; i < catsLen; i++) {\r\r
             this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);\r\r
         }\r\r
@@ -530,7 +334,7 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
     // Initialize source filters\r\r
     this._sourceFilters = [];\r\r
     var sourcesLen = YAHOO.widget.Logger.sources.length;\r\r
-    if(this._sourceFiltersEl) {\r\r
+    if(this._elSourceFilters) {\r\r
         for(var j=0; j < sourcesLen; j++) {\r\r
             this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);\r\r
         }\r\r
@@ -538,98 +342,147 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
     YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);\r\r
     YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);\r\r
 \r\r
-    YAHOO.widget.LogReader._index++;\r\r
     this._filterLogs();\r\r
+    YAHOO.log("LogReader initialized", null, this.toString());\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Public members\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Whether or not the log reader is enabled to output log messages. Default:\r\r
- * true.\r\r
+ * Whether or not the log reader is enabled to output log messages.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property logReaderEnabled\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.logReaderEnabled = true;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS width of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property width\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.width = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS height of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property height\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.height = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS top position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property top\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.top = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS left position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property left\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.left = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS right position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property right\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.right = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS bottom position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property bottom\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.bottom = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS font size of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property fontSize\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.fontSize = null;\r\r
 \r\r
 /**\r\r
- * Whether or not the footer UI is enabled for the log reader. Default: true.\r\r
+ * Whether or not the footer UI is enabled for the log reader.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property footerEnabled\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.footerEnabled = true;\r\r
 \r\r
 /**\r\r
  * Whether or not output is verbose (more readable). Setting to true will make\r\r
- * output more compact (less readable). Default: true.\r\r
+ * output more compact (less readable).\r\r
  *\r\r
- * @type boolean\r\r
+ * @property verboseOutput\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.verboseOutput = true;\r\r
 \r\r
 /**\r\r
- * Whether or not newest message is printed on top. Default: true.\r\r
+ * Whether or not newest message is printed on top.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property newestOnTop\r\r
+ * @type Boolean\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.newestOnTop = true;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/**\r\r
+ * Maximum number of messages a LogReader console will display.\r\r
+ *\r\r
+ * @property thresholdMax\r\r
+ * @type Number\r\r
+ * @default 500\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.thresholdMax = 500;\r\r
+\r\r
+/**\r\r
+ * When a LogReader console reaches its thresholdMax, it will clear out messages\r\r
+ * and print out the latest thresholdMin number of messages.\r\r
+ *\r\r
+ * @property thresholdMin\r\r
+ * @type Number\r\r
+ * @default 100\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.thresholdMin = 100;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+ /**\r\r
+ * Public accessor to the unique name of the LogReader instance.\r\r
+ *\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the LogReader instance.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.toString = function() {\r\r
+    return "LogReader instance" + this._sName;\r\r
+};\r\r
 /**\r\r
  * Pauses output of log messages. While paused, log messages are not lost, but\r\r
  * get saved to a buffer and then output upon resume of log reader.\r\r
+ *\r\r
+ * @method pause\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.pause = function() {\r\r
     this._timeout = null;\r\r
@@ -639,6 +492,8 @@ YAHOO.widget.LogReader.prototype.pause = function() {
 /**\r\r
  * Resumes output of log messages, including outputting any log messages that\r\r
  * have been saved to buffer while paused.\r\r
+ *\r\r
+ * @method resume\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.resume = function() {\r\r
     this.logReaderEnabled = true;\r\r
@@ -647,63 +502,175 @@ YAHOO.widget.LogReader.prototype.resume = function() {
 \r\r
 /**\r\r
  * Hides UI of log reader. Logging functionality is not disrupted.\r\r
+ *\r\r
+ * @method hide\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.hide = function() {\r\r
-    this._containerEl.style.display = "none";\r\r
+    this._elContainer.style.display = "none";\r\r
 };\r\r
 \r\r
 /**\r\r
  * Shows UI of log reader. Logging functionality is not disrupted.\r\r
+ *\r\r
+ * @method show\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.show = function() {\r\r
-    this._containerEl.style.display = "block";\r\r
+    this._elContainer.style.display = "block";\r\r
 };\r\r
 \r\r
 /**\r\r
  * Updates title to given string.\r\r
  *\r\r
- * @param {string} sTitle String to display in log reader's title bar.\r\r
+ * @method setTitle\r\r
+ * @param sTitle {String} New title.\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {\r\r
-    var regEx = />/g;\r\r
-    sTitle = sTitle.replace(regEx,"&gt;");\r\r
-    regEx = /</g;\r\r
-    sTitle = sTitle.replace(regEx,"&lt;");\r\r
-    this._title.innerHTML = (sTitle);\r\r
+    this._title.innerHTML = this.html2Text(sTitle);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Gets timestamp of the last log.\r\r
+ *\r\r
+ * @method getLastTime\r\r
+ * @return {Date} Timestamp of the last log.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.getLastTime = function() {\r\r
+    return this._lastTime;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Formats message string to HTML for output to console.\r\r
+ *\r\r
+ * @method formatMsg\r\r
+ * @param oLogMsg {Object} Log message object.\r\r
+ * @return {String} HTML-formatted message for output to console.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r\r
+    var category = oLogMsg.category;\r\r
+    \r\r
+    // Label for color-coded display\r\r
+    var label = category.substring(0,4).toUpperCase();\r\r
+\r\r
+    // Calculate the elapsed time to be from the last item that passed through the filter,\r\r
+    // not the absolute previous item in the stack\r\r
+\r\r
+    var time = oLogMsg.time;\r\r
+    if (time.toLocaleTimeString) {\r\r
+        var localTime  = time.toLocaleTimeString();\r\r
+    }\r\r
+    else {\r\r
+        localTime = time.toString();\r\r
+    }\r\r
+\r\r
+    var msecs = time.getTime();\r\r
+    var startTime = YAHOO.widget.Logger.getStartTime();\r\r
+    var totalTime = msecs - startTime;\r\r
+    var elapsedTime = msecs - this.getLastTime();\r\r
+\r\r
+    var source = oLogMsg.source;\r\r
+    var sourceDetail = oLogMsg.sourceDetail;\r\r
+    var sourceAndDetail = (sourceDetail) ?\r\r
+        source + " " + sourceDetail : source;\r\r
+        \r\r
+    // Escape HTML entities in the log message itself for output to console\r\r
+    var msg = this.html2Text(oLogMsg.msg);\r\r
+\r\r
+    // Verbose output includes extra line breaks\r\r
+    var output =  (this.verboseOutput) ?\r\r
+        ["<p><span class='", category, "'>", label, "</span> ",\r\r
+        totalTime, "ms (+", elapsedTime, ") ",\r\r
+        localTime, ": ",\r\r
+        "</p><p>",\r\r
+        sourceAndDetail,\r\r
+        ": </p><p>",\r\r
+        msg,\r\r
+        "</p>"] :\r\r
+\r\r
+        ["<p><span class='", category, "'>", label, "</span> ",\r\r
+        totalTime, "ms (+", elapsedTime, ") ",\r\r
+        localTime, ": ",\r\r
+        sourceAndDetail, ": ",\r\r
+        msg,"</p>"];\r\r
+\r\r
+    return output.join("");\r\r
 };\r\r
- /***************************************************************************\r\r
- * Private members\r\r
- ***************************************************************************/\r\r
+\r\r
+/**\r\r
+ * Converts input chars "<", ">", and "&" to HTML entities.\r\r
+ *\r\r
+ * @method html2Text\r\r
+ * @param sHtml {String} String to convert.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {\r\r
+    if(sHtml) {\r\r
+        sHtml += "";\r\r
+        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");\r\r
+    }\r\r
+    return "";\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Internal class member to index multiple log reader instances.\r\r
  *\r\r
- * @type number\r\r
+ * @property _memberName\r\r
+ * @static\r\r
+ * @type Number\r\r
+ * @default 0\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader._index = 0;\r\r
 \r\r
+/**\r\r
+ * Name of LogReader instance.\r\r
+ *\r\r
+ * @property _sName\r\r
+ * @type String\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._sName = null;\r\r
+\r\r
 /**\r\r
  * A class member shared by all log readers if a container needs to be\r\r
  * created during instantiation. Will be null if a container element never needs to\r\r
  * be created on the fly, such as when the implementer passes in their own element.\r\r
  *\r\r
+ * @property _elDefaultContainer\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader._defaultContainerEl = null;\r\r
+YAHOO.widget.LogReader._elDefaultContainer = null;\r\r
 \r\r
 /**\r\r
- * Buffer of log messages for batch output.\r\r
+ * Buffer of log message objects for batch output.\r\r
  *\r\r
- * @type array\r\r
+ * @property _buffer\r\r
+ * @type Object[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._buffer = null;\r\r
 \r\r
+/**\r\r
+ * Number of log messages output to console.\r\r
+ *\r\r
+ * @property _consoleMsgCount\r\r
+ * @type Number\r\r
+ * @default 0\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;\r\r
+\r\r
 /**\r\r
  * Date of last output log message.\r\r
  *\r\r
- * @type date\r\r
+ * @property _lastTime\r\r
+ * @type Date\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._lastTime = null;\r\r
@@ -711,7 +678,8 @@ YAHOO.widget.LogReader.prototype._lastTime = null;
 /**\r\r
  * Batched output timeout ID.\r\r
  *\r\r
- * @type number\r\r
+ * @property _timeout\r\r
+ * @type Number\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._timeout = null;\r\r
@@ -719,7 +687,8 @@ YAHOO.widget.LogReader.prototype._timeout = null;
 /**\r\r
  * Array of filters for log message categories.\r\r
  *\r\r
- * @type array\r\r
+ * @property _categoryFilters\r\r
+ * @type String[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._categoryFilters = null;\r\r
@@ -727,7 +696,8 @@ YAHOO.widget.LogReader.prototype._categoryFilters = null;
 /**\r\r
  * Array of filters for log message sources.\r\r
  *\r\r
- * @type array\r\r
+ * @property _sourceFilters\r\r
+ * @type String[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._sourceFilters = null;\r\r
@@ -735,38 +705,43 @@ YAHOO.widget.LogReader.prototype._sourceFilters = null;
 /**\r\r
  * Log reader container element.\r\r
  *\r\r
+ * @property _elContainer\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._containerEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elContainer = null;\r\r
 \r\r
 /**\r\r
  * Log reader header element.\r\r
  *\r\r
+ * @property _elHd\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._hdEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elHd = null;\r\r
 \r\r
 /**\r\r
  * Log reader collapse element.\r\r
  *\r\r
+ * @property _elCollapse\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._collapseEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elCollapse = null;\r\r
 \r\r
 /**\r\r
  * Log reader collapse button element.\r\r
  *\r\r
+ * @property _btnCollapse\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._collapseBtn = null;\r\r
+YAHOO.widget.LogReader.prototype._btnCollapse = null;\r\r
 \r\r
 /**\r\r
  * Log reader title header element.\r\r
  *\r\r
+ * @property _title\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
@@ -775,140 +750,160 @@ YAHOO.widget.LogReader.prototype._title = null;
 /**\r\r
  * Log reader console element.\r\r
  *\r\r
+ * @property _elConsole\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._consoleEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elConsole = null;\r\r
 \r\r
 /**\r\r
  * Log reader footer element.\r\r
  *\r\r
+ * @property _elFt\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._ftEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elFt = null;\r\r
 \r\r
 /**\r\r
  * Log reader buttons container element.\r\r
  *\r\r
+ * @property _elBtns\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._btnsEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elBtns = null;\r\r
 \r\r
 /**\r\r
  * Container element for log reader category filter checkboxes.\r\r
  *\r\r
+ * @property _elCategoryFilters\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._categoryFiltersEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elCategoryFilters = null;\r\r
 \r\r
 /**\r\r
  * Container element for log reader source filter checkboxes.\r\r
  *\r\r
+ * @property _elSourceFilters\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._sourceFiltersEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elSourceFilters = null;\r\r
 \r\r
 /**\r\r
  * Log reader pause button element.\r\r
  *\r\r
+ * @property _btnPause\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._pauseBtn = null;\r\r
+YAHOO.widget.LogReader.prototype._btnPause = null;\r\r
 \r\r
 /**\r\r
- * lear button element.\r\r
+ * Clear button element.\r\r
  *\r\r
+ * @property _btnClear\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._clearBtn = null;\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+YAHOO.widget.LogReader.prototype._btnClear = null;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Creates the UI for a category filter in the log reader footer element.\r\r
  *\r\r
- * @param {string} category Category name\r\r
+ * @method _createCategoryCheckbox\r\r
+ * @param sCategory {String} Category name.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(category) {\r\r
+YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {\r\r
     var oSelf = this;\r\r
-    \r\r
-    if(this._ftEl) {\r\r
-        var parentEl = this._categoryFiltersEl;\r\r
+\r\r
+    if(this._elFt) {\r\r
+        var elParent = this._elCategoryFilters;\r\r
         var filters = this._categoryFilters;\r\r
 \r\r
-        var filterEl = parentEl.appendChild(document.createElement("span"));\r\r
-        filterEl.className = "yui-log-filtergrp";\r\r
+        var elFilter = elParent.appendChild(document.createElement("span"));\r\r
+        elFilter.className = "yui-log-filtergrp";\r\r
             // Append el at the end so IE 5.5 can set "type" attribute\r\r
             // and THEN set checked property\r\r
-            var categoryChk = document.createElement("input");\r\r
-            categoryChk.id = "yui-log-filter-" + category + YAHOO.widget.LogReader._index;\r\r
-            categoryChk.className = "yui-log-filter-" + category;\r\r
-            categoryChk.type = "checkbox";\r\r
-            categoryChk.category = category;\r\r
-            categoryChk = filterEl.appendChild(categoryChk);\r\r
-            categoryChk.checked = true;\r\r
+            var chkCategory = document.createElement("input");\r\r
+            chkCategory.id = "yui-log-filter-" + sCategory + this._sName;\r\r
+            chkCategory.className = "yui-log-filter-" + sCategory;\r\r
+            chkCategory.type = "checkbox";\r\r
+            chkCategory.category = sCategory;\r\r
+            chkCategory = elFilter.appendChild(chkCategory);\r\r
+            chkCategory.checked = true;\r\r
 \r\r
             // Add this checked filter to the internal array of filters\r\r
-            filters.push(category);\r\r
+            filters.push(sCategory);\r\r
             // Subscribe to the click event\r\r
-            YAHOO.util.Event.addListener(categoryChk,'click',oSelf._onCheckCategory,oSelf);\r\r
+            YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);\r\r
 \r\r
             // Create and class the text label\r\r
-            var categoryChkLbl = filterEl.appendChild(document.createElement("label"));\r\r
-            categoryChkLbl.htmlFor = categoryChk.id;\r\r
-            categoryChkLbl.className = category;\r\r
-            categoryChkLbl.innerHTML = category;\r\r
+            var lblCategory = elFilter.appendChild(document.createElement("label"));\r\r
+            lblCategory.htmlFor = chkCategory.id;\r\r
+            lblCategory.className = sCategory;\r\r
+            lblCategory.innerHTML = sCategory;\r\r
     }\r\r
 };\r\r
 \r\r
-YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(source) {\r\r
+/**\r\r
+ * Creates a checkbox in the log reader footer element to filter by source.\r\r
+ *\r\r
+ * @method _createSourceCheckbox\r\r
+ * @param sSource {String} Source name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {\r\r
     var oSelf = this;\r\r
 \r\r
-    if(this._ftEl) {\r\r
-        var parentEl = this._sourceFiltersEl;\r\r
+    if(this._elFt) {\r\r
+        var elParent = this._elSourceFilters;\r\r
         var filters = this._sourceFilters;\r\r
 \r\r
-        var filterEl = parentEl.appendChild(document.createElement("span"));\r\r
-        filterEl.className = "yui-log-filtergrp";\r\r
+        var elFilter = elParent.appendChild(document.createElement("span"));\r\r
+        elFilter.className = "yui-log-filtergrp";\r\r
 \r\r
         // Append el at the end so IE 5.5 can set "type" attribute\r\r
         // and THEN set checked property\r\r
-        var sourceChk = document.createElement("input");\r\r
-        sourceChk.id = "yui-log-filter" + source + YAHOO.widget.LogReader._index;\r\r
-        sourceChk.className = "yui-log-filter" + source;\r\r
-        sourceChk.type = "checkbox";\r\r
-        sourceChk.source = source;\r\r
-        sourceChk = filterEl.appendChild(sourceChk);\r\r
-        sourceChk.checked = true;\r\r
+        var chkSource = document.createElement("input");\r\r
+        chkSource.id = "yui-log-filter" + sSource + this._sName;\r\r
+        chkSource.className = "yui-log-filter" + sSource;\r\r
+        chkSource.type = "checkbox";\r\r
+        chkSource.source = sSource;\r\r
+        chkSource = elFilter.appendChild(chkSource);\r\r
+        chkSource.checked = true;\r\r
 \r\r
         // Add this checked filter to the internal array of filters\r\r
-        filters.push(source);\r\r
+        filters.push(sSource);\r\r
         // Subscribe to the click event\r\r
-        YAHOO.util.Event.addListener(sourceChk,'click',oSelf._onCheckSource,oSelf);\r\r
+        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);\r\r
 \r\r
         // Create and class the text label\r\r
-        var sourceChkLbl = filterEl.appendChild(document.createElement("label"));\r\r
-        sourceChkLbl.htmlFor = sourceChk.id;\r\r
-        sourceChkLbl.className = source;\r\r
-        sourceChkLbl.innerHTML = source;\r\r
+        var lblSource = elFilter.appendChild(document.createElement("label"));\r\r
+        lblSource.htmlFor = chkSource.id;\r\r
+        lblSource.className = sSource;\r\r
+        lblSource.innerHTML = sSource;\r\r
     }\r\r
 };\r\r
 \r\r
 /**\r\r
  * Reprints all log messages in the stack through filters.\r\r
  *\r\r
+ * @method _filterLogs\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._filterLogs = function() {\r\r
     // Reprint stack with new filters\r\r
-    if (this._consoleEl !== null) {\r\r
+    if (this._elConsole !== null) {\r\r
         this._clearConsole();\r\r
         this._printToConsole(YAHOO.widget.Logger.getStack());\r\r
     }\r\r
@@ -918,39 +913,50 @@ YAHOO.widget.LogReader.prototype._filterLogs = function() {
  * Clears all outputted log messages from the console and resets the time of the\r\r
  * last output log message.\r\r
  *\r\r
+ * @method _clearConsole\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._clearConsole = function() {\r\r
     // Clear the buffer of any pending messages\r\r
     this._timeout = null;\r\r
     this._buffer = [];\r\r
+    this._consoleMsgCount = 0;\r\r
 \r\r
     // Reset the rolling timer\r\r
     this._lastTime = YAHOO.widget.Logger.getStartTime();\r\r
 \r\r
-    var consoleEl = this._consoleEl;\r\r
-    while(consoleEl.hasChildNodes()) {\r\r
-        consoleEl.removeChild(consoleEl.firstChild);\r\r
+    var elConsole = this._elConsole;\r\r
+    while(elConsole.hasChildNodes()) {\r\r
+        elConsole.removeChild(elConsole.firstChild);\r\r
     }\r\r
 };\r\r
 \r\r
 /**\r\r
  * Sends buffer of log messages to output and clears buffer.\r\r
  *\r\r
+ * @method _printBuffer\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._printBuffer = function() {\r\r
     this._timeout = null;\r\r
 \r\r
-    if (this._consoleEl !== null) {\r\r
-        var entries = [];\r\r
-        for (var i=0; i<this._buffer.length; i++) {\r\r
-            entries[i] = this._buffer[i];\r\r
+    if(this._elConsole !== null) {\r\r
+        var thresholdMax = this.thresholdMax;\r\r
+        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;\r\r
+        if(this._consoleMsgCount < thresholdMax) {\r\r
+            var entries = [];\r\r
+            for (var i=0; i<this._buffer.length; i++) {\r\r
+                entries[i] = this._buffer[i];\r\r
+            }\r\r
+            this._buffer = [];\r\r
+            this._printToConsole(entries);\r\r
+        }\r\r
+        else {\r\r
+            this._filterLogs();\r\r
         }\r\r
-        this._buffer = [];\r\r
-        this._printToConsole(entries);\r\r
+        \r\r
         if(!this.newestOnTop) {\r\r
-            this._consoleEl.scrollTop = this._consoleEl.scrollHeight;\r\r
+            this._elConsole.scrollTop = this._elConsole.scrollHeight;\r\r
         }\r\r
     }\r\r
 };\r\r
@@ -959,22 +965,32 @@ YAHOO.widget.LogReader.prototype._printBuffer = function() {
  * Cycles through an array of log messages, and outputs each one to the console\r\r
  * if its category has not been filtered out.\r\r
  *\r\r
- * @param {array} aEntries\r\r
+ * @method _printToConsole\r\r
+ * @param aEntries {Object[]} Array of LogMsg objects to output to console.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {\r\r
+    // Manage the number of messages displayed in the console\r\r
     var entriesLen = aEntries.length;\r\r
+    var thresholdMin = this.thresholdMin;\r\r
+    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {\r\r
+        thresholdMin = 0;\r\r
+    }\r\r
+    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r\r
+    \r\r
+    // Iterate through all log entries \r\r
     var sourceFiltersLen = this._sourceFilters.length;\r\r
     var categoryFiltersLen = this._categoryFilters.length;\r\r
-    // Iterate through all log entries to print the ones that filter through\r\r
-    for(var i=0; i<entriesLen; i++) {\r\r
-        var entry = aEntries[i];\r\r
-        var category = entry.category;\r\r
-        var source = entry.source;\r\r
-        var sourceDetail = entry.sourceDetail;\r\r
+    for(var i=entriesStartIndex; i<entriesLen; i++) {\r\r
+        // Print only the ones that filter through\r\r
         var okToPrint = false;\r\r
         var okToFilterCats = false;\r\r
 \r\r
+        // Get log message details\r\r
+        var entry = aEntries[i];\r\r
+        var source = entry.source;\r\r
+        var category = entry.category;\r\r
+\r\r
         for(var j=0; j<sourceFiltersLen; j++) {\r\r
             if(source == this._sourceFilters[j]) {\r\r
                 okToFilterCats = true;\r\r
@@ -990,58 +1006,40 @@ YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {
             }\r\r
         }\r\r
         if(okToPrint) {\r\r
-            // To format for console, calculate the elapsed time\r\r
-            // to be from the last item that passed through the filter,\r\r
-            // not the absolute previous item in the stack\r\r
-            var label = entry.category.substring(0,4).toUpperCase();\r\r
-\r\r
-            var time = entry.time;\r\r
-            if (time.toLocaleTimeString) {\r\r
-                var localTime  = time.toLocaleTimeString();\r\r
-            }\r\r
-            else {\r\r
-                localTime = time.toString();\r\r
-            }\r\r
-\r\r
-            var msecs = time.getTime();\r\r
-            var startTime = YAHOO.widget.Logger.getStartTime();\r\r
-            var totalTime = msecs - startTime;\r\r
-            var elapsedTime = msecs - this._lastTime;\r\r
-            this._lastTime = msecs;\r\r
-            \r\r
-            var verboseOutput = (this.verboseOutput) ? "<br>" : "";\r\r
-            var sourceAndDetail = (sourceDetail) ?\r\r
-                source + " " + sourceDetail : source;\r\r
-\r\r
-            var output =  "<span class='"+category+"'>"+label+"</span> " +\r\r
-                totalTime + "ms (+" +\r\r
-                elapsedTime + ") " + localTime + ": " +\r\r
-                sourceAndDetail + ": " +\r\r
-                verboseOutput +\r\r
-                entry.msg;\r\r
+            var output = this.formatMsg(entry);\r\r
 \r\r
+            // Verbose output uses <code> tag instead of <pre> tag (for wrapping)\r\r
+            var container = (this.verboseOutput) ? "CODE" : "PRE";\r\r
             var oNewElement = (this.newestOnTop) ?\r\r
-                this._consoleEl.insertBefore(document.createElement("p"),this._consoleEl.firstChild):\r\r
-                this._consoleEl.appendChild(document.createElement("p"));\r\r
+                this._elConsole.insertBefore(\r\r
+                    document.createElement(container),this._elConsole.firstChild):\r\r
+                this._elConsole.appendChild(document.createElement(container));\r\r
+\r\r
             oNewElement.innerHTML = output;\r\r
+            this._consoleMsgCount++;\r\r
+            this._lastTime = entry.time.getTime();\r\r
         }\r\r
     }\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Private event handlers\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private event handlers\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Handles Logger's categoryCreateEvent.\r\r
  *\r\r
- * @param {string} type The event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCategoryCreate\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onCategoryCreate = function(type, args, oSelf) {\r\r
-    var category = args[0];\r\r
-    if(oSelf._ftEl) {\r\r
+YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {\r\r
+    var category = aArgs[0];\r\r
+    if(oSelf._elFt) {\r\r
         oSelf._createCategoryCheckbox(category);\r\r
     }\r\r
 };\r\r
@@ -1049,14 +1047,15 @@ YAHOO.widget.LogReader.prototype._onCategoryCreate = function(type, args, oSelf)
 /**\r\r
  * Handles Logger's sourceCreateEvent.\r\r
  *\r\r
- * @param {string} type The event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onSourceCreate\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onSourceCreate = function(type, args, oSelf) {\r\r
-    var source = args[0];\r\r
-    if(oSelf._ftEl) {\r\r
+YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {\r\r
+    var source = aArgs[0];\r\r
+    if(oSelf._elFt) {\r\r
         oSelf._createSourceCheckbox(source);\r\r
     }\r\r
 };\r\r
@@ -1064,8 +1063,9 @@ YAHOO.widget.LogReader.prototype._onSourceCreate = function(type, args, oSelf) {
 /**\r\r
  * Handles check events on the category filter checkboxes.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCheckCategory\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {\r\r
@@ -1089,14 +1089,15 @@ YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {
 /**\r\r
  * Handles check events on the category filter checkboxes.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCheckSource\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The log reader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {\r\r
     var newFilter = this.source;\r\r
     var filtersArray = oSelf._sourceFilters;\r\r
-    \r\r
+\r\r
     if(!this.checked) { // Remove category from filters\r\r
         for(var i=0; i<filtersArray.length; i++) {\r\r
             if(newFilter == filtersArray[i]) {\r\r
@@ -1114,23 +1115,24 @@ YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {
 /**\r\r
  * Handles click events on the collapse button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickCollapseBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {\r\r
-    var btn = oSelf._collapseBtn;\r\r
+    var btn = oSelf._btnCollapse;\r\r
     if(btn.value == "Expand") {\r\r
-        oSelf._consoleEl.style.display = "block";\r\r
-        if(oSelf._ftEl) {\r\r
-            oSelf._ftEl.style.display = "block";\r\r
+        oSelf._elConsole.style.display = "block";\r\r
+        if(oSelf._elFt) {\r\r
+            oSelf._elFt.style.display = "block";\r\r
         }\r\r
         btn.value = "Collapse";\r\r
     }\r\r
     else {\r\r
-        oSelf._consoleEl.style.display = "none";\r\r
-        if(oSelf._ftEl) {\r\r
-            oSelf._ftEl.style.display = "none";\r\r
+        oSelf._elConsole.style.display = "none";\r\r
+        if(oSelf._elFt) {\r\r
+            oSelf._elFt.style.display = "none";\r\r
         }\r\r
         btn.value = "Expand";\r\r
     }\r\r
@@ -1139,12 +1141,13 @@ YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {
 /**\r\r
  * Handles click events on the pause button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickPauseBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {\r\r
-    var btn = oSelf._pauseBtn;\r\r
+    var btn = oSelf._btnPause;\r\r
     if(btn.value == "Resume") {\r\r
         oSelf.resume();\r\r
         btn.value = "Pause";\r\r
@@ -1158,8 +1161,9 @@ YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {
 /**\r\r
  * Handles click events on the clear button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickClearBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {\r\r
@@ -1167,15 +1171,16 @@ YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {
 };\r\r
 \r\r
 /**\r\r
- * Handles Logger's onNewEvent.\r\r
+ * Handles Logger's newLogEvent.\r\r
  *\r\r
- * @param {string} type The click event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onNewLog\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onNewLog = function(type, args, oSelf) {\r\r
-    var logEntry = args[0];\r\r
+YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {\r\r
+    var logEntry = aArgs[0];\r\r
     oSelf._buffer.push(logEntry);\r\r
 \r\r
     if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {\r\r
@@ -1183,4 +1188,372 @@ YAHOO.widget.LogReader.prototype._onNewLog = function(type, args, oSelf) {
     }\r\r
 };\r\r
 \r\r
+/**\r\r
+ * Handles Logger's resetEvent.\r\r
+ *\r\r
+ * @method _onReset\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {\r\r
+    oSelf._filterLogs();\r\r
+};\r\r
+ /**\r\r
+ * The Logger widget provides a simple way to read or write log messages in\r\r
+ * JavaScript code. Integration with the YUI Library's debug builds allow\r\r
+ * implementers to access under-the-hood events, errors, and debugging messages.\r\r
+ * Output may be read through a LogReader console and/or output to a browser\r\r
+ * console.\r\r
+ *\r\r
+ * @module logger\r\r
+ * @requires yahoo, event, dom\r\r
+ * @optional dragdrop\r\r
+ * @namespace YAHOO.widget\r\r
+ * @title Logger Widget\r\r
+ */\r\r
+\r\r
+/****************************************************************************/\r\r
+/****************************************************************************/\r\r
+/****************************************************************************/\r\r
+\r\r
+/**\r\r
+ * The singleton Logger class provides core log management functionality. Saves\r\r
+ * logs written through the global YAHOO.log function or written by a LogWriter\r\r
+ * instance. Provides access to logs for reading by a LogReader instance or\r\r
+ * native browser console such as the Firebug extension to Firefox or Safari's\r\r
+ * JavaScript console through integration with the console.log() method.\r\r
+ *\r\r
+ * @class Logger\r\r
+ * @static\r\r
+ */\r\r
+YAHOO.widget.Logger = {\r\r
+    // Initialize members\r\r
+    loggerEnabled: true,\r\r
+    _browserConsoleEnabled: false,\r\r
+    categories: ["info","warn","error","time","window"],\r\r
+    sources: ["global"],\r\r
+    _stack: [], // holds all log msgs\r\r
+    maxStackEntries: 2500,\r\r
+    _startTime: new Date().getTime(), // static start timestamp\r\r
+    _lastTime: null // timestamp of last logged message\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+/**\r\r
+ * Saves a log message to the stack and fires newLogEvent. If the log message is\r\r
+ * assigned to an unknown category, creates a new category. If the log message is\r\r
+ * from an unknown source, creates a new source.  If browser console is enabled,\r\r
+ * outputs the log message to browser console.\r\r
+ *\r\r
+ * @method log\r\r
+ * @param sMsg {String} The log message.\r\r
+ * @param sCategory {String} Category of log message, or null.\r\r
+ * @param sSource {String} Source of LogWriter, or null if global.\r\r
+ */\r\r
+YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r\r
+    if(this.loggerEnabled) {\r\r
+        if(!sCategory) {\r\r
+            sCategory = "info"; // default category\r\r
+        }\r\r
+        else {\r\r
+            sCategory = sCategory.toLocaleLowerCase();\r\r
+            if(this._isNewCategory(sCategory)) {\r\r
+                this._createNewCategory(sCategory);\r\r
+            }\r\r
+        }\r\r
+        var sClass = "global"; // default source\r\r
+        var sDetail = null;\r\r
+        if(sSource) {\r\r
+            var spaceIndex = sSource.indexOf(" ");\r\r
+            if(spaceIndex > 0) {\r\r
+                // Substring until first space\r\r
+                sClass = sSource.substring(0,spaceIndex);\r\r
+                // The rest of the source\r\r
+                sDetail = sSource.substring(spaceIndex,sSource.length);\r\r
+            }\r\r
+            else {\r\r
+                sClass = sSource;\r\r
+            }\r\r
+            if(this._isNewSource(sClass)) {\r\r
+                this._createNewSource(sClass);\r\r
+            }\r\r
+        }\r\r
+\r\r
+        var timestamp = new Date();\r\r
+        var logEntry = new YAHOO.widget.LogMsg({\r\r
+            msg: sMsg,\r\r
+            time: timestamp,\r\r
+            category: sCategory,\r\r
+            source: sClass,\r\r
+            sourceDetail: sDetail\r\r
+        });\r\r
+\r\r
+        var stack = this._stack;\r\r
+        var maxStackEntries = this.maxStackEntries;\r\r
+        if(maxStackEntries && !isNaN(maxStackEntries) &&\r\r
+            (stack.length >= maxStackEntries)) {\r\r
+            stack.shift();\r\r
+        }\r\r
+        stack.push(logEntry);\r\r
+        this.newLogEvent.fire(logEntry);\r\r
+\r\r
+        if(this._browserConsoleEnabled) {\r\r
+            this._printToBrowserConsole(logEntry);\r\r
+        }\r\r
+        return true;\r\r
+    }\r\r
+    else {\r\r
+        return false;\r\r
+    }\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r\r
+ *\r\r
+ * @method reset\r\r
+ */\r\r
+YAHOO.widget.Logger.reset = function() {\r\r
+    this._stack = [];\r\r
+    this._startTime = new Date().getTime();\r\r
+    this.loggerEnabled = true;\r\r
+    this.log("Logger reset");\r\r
+    this.logResetEvent.fire();\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Public accessor to internal stack of log message objects.\r\r
+ *\r\r
+ * @method getStack\r\r
+ * @return {Object[]} Array of log message objects.\r\r
+ */\r\r
+YAHOO.widget.Logger.getStack = function() {\r\r
+    return this._stack;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Public accessor to internal start time.\r\r
+ *\r\r
+ * @method getStartTime\r\r
+ * @return {Date} Internal date of when Logger singleton was initialized.\r\r
+ */\r\r
+YAHOO.widget.Logger.getStartTime = function() {\r\r
+    return this._startTime;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Disables output to the browser's global console.log() function, which is used\r\r
+ * by the Firebug extension to Firefox as well as Safari.\r\r
+ *\r\r
+ * @method disableBrowserConsole\r\r
+ */\r\r
+YAHOO.widget.Logger.disableBrowserConsole = function() {\r\r
+    YAHOO.log("Logger output to the function console.log() has been disabled.");\r\r
+    this._browserConsoleEnabled = false;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Enables output to the browser's global console.log() function, which is used\r\r
+ * by the Firebug extension to Firefox as well as Safari.\r\r
+ *\r\r
+ * @method enableBrowserConsole\r\r
+ */\r\r
+YAHOO.widget.Logger.enableBrowserConsole = function() {\r\r
+    this._browserConsoleEnabled = true;\r\r
+    YAHOO.log("Logger output to the function console.log() has been enabled.");\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public events\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+ /**\r\r
+ * Fired when a new category has been created.\r\r
+ *\r\r
+ * @event categoryCreateEvent\r\r
+ * @param sCategory {String} Category name.\r\r
+ */\r\r
+YAHOO.widget.Logger.categoryCreateEvent =\r\r
+    new YAHOO.util.CustomEvent("categoryCreate", this, true);\r\r
+\r\r
+ /**\r\r
+ * Fired when a new source has been named.\r\r
+ *\r\r
+ * @event sourceCreateEvent\r\r
+ * @param sSource {String} Source name.\r\r
+ */\r\r
+YAHOO.widget.Logger.sourceCreateEvent =\r\r
+    new YAHOO.util.CustomEvent("sourceCreate", this, true);\r\r
+\r\r
+ /**\r\r
+ * Fired when a new log message has been created.\r\r
+ *\r\r
+ * @event newLogEvent\r\r
+ * @param sMsg {String} Log message.\r\r
+ */\r\r
+YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r\r
+\r\r
+/**\r\r
+ * Fired when the Logger has been reset has been created.\r\r
+ *\r\r
+ * @event logResetEvent\r\r
+ */\r\r
+YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Creates a new category of log messages and fires categoryCreateEvent.\r\r
+ *\r\r
+ * @method _createNewCategory\r\r
+ * @param sCategory {String} Category name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._createNewCategory = function(sCategory) {\r\r
+    this.categories.push(sCategory);\r\r
+    this.categoryCreateEvent.fire(sCategory);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Checks to see if a category has already been created.\r\r
+ *\r\r
+ * @method _isNewCategory\r\r
+ * @param sCategory {String} Category name.\r\r
+ * @return {Boolean} Returns true if category is unknown, else returns false.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._isNewCategory = function(sCategory) {\r\r
+    for(var i=0; i < this.categories.length; i++) {\r\r
+        if(sCategory == this.categories[i]) {\r\r
+            return false;\r\r
+        }\r\r
+    }\r\r
+    return true;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Creates a new source of log messages and fires sourceCreateEvent.\r\r
+ *\r\r
+ * @method _createNewSource\r\r
+ * @param sSource {String} Source name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._createNewSource = function(sSource) {\r\r
+    this.sources.push(sSource);\r\r
+    this.sourceCreateEvent.fire(sSource);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Checks to see if a source already exists.\r\r
+ *\r\r
+ * @method _isNewSource\r\r
+ * @param sSource {String} Source name.\r\r
+ * @return {Boolean} Returns true if source is unknown, else returns false.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._isNewSource = function(sSource) {\r\r
+    if(sSource) {\r\r
+        for(var i=0; i < this.sources.length; i++) {\r\r
+            if(sSource == this.sources[i]) {\r\r
+                return false;\r\r
+            }\r\r
+        }\r\r
+        return true;\r\r
+    }\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Outputs a log message to global console.log() function.\r\r
+ *\r\r
+ * @method _printToBrowserConsole\r\r
+ * @param oEntry {Object} Log entry object.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {\r\r
+    if(window.console && console.log) {\r\r
+        var category = oEntry.category;\r\r
+        var label = oEntry.category.substring(0,4).toUpperCase();\r\r
+\r\r
+        var time = oEntry.time;\r\r
+        if (time.toLocaleTimeString) {\r\r
+            var localTime  = time.toLocaleTimeString();\r\r
+        }\r\r
+        else {\r\r
+            localTime = time.toString();\r\r
+        }\r\r
+\r\r
+        var msecs = time.getTime();\r\r
+        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r\r
+            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r\r
+        YAHOO.widget.Logger._lastTime = msecs;\r\r
+\r\r
+        var output =\r\r
+            localTime + " (" +\r\r
+            elapsedTime + "ms): " +\r\r
+            oEntry.source + ": " +\r\r
+            oEntry.msg;\r\r
+\r\r
+        console.log(output);\r\r
+    }\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private event handlers\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Handles logging of messages due to window error events.\r\r
+ *\r\r
+ * @method _onWindowError\r\r
+ * @param sMsg {String} The error message.\r\r
+ * @param sUrl {String} URL of the error.\r\r
+ * @param sLine {String} Line number of the error.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {\r\r
+    // Logger is not in scope of this event handler\r\r
+    try {\r\r
+        YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");\r\r
+        if(YAHOO.widget.Logger._origOnWindowError) {\r\r
+            YAHOO.widget.Logger._origOnWindowError();\r\r
+        }\r\r
+    }\r\r
+    catch(e) {\r\r
+        return false;\r\r
+    }\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Enable handling of native JavaScript errors\r\r
+// NB: Not all browsers support the window.onerror event\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+if(window.onerror) {\r\r
+    // Save any previously defined handler to call\r\r
+    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r\r
+}\r\r
+window.onerror = YAHOO.widget.Logger._onWindowError;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// First log\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+YAHOO.widget.Logger.log("Logger initialized");\r\r
 \r\r
index 04cada55c94b658a96a0552de0a8785c79cff6d6..f7c0e637ccd275998d0bd0d4ebb1458ffc17d86b 100755 (executable)
@@ -1,63 +1,56 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-\r
-\r\r
-YAHOO.widget.Logger={loggerEnabled:true,_firebugEnabled:true,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],_startTime:new Date().getTime(),_lastTime:null};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.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}\r\r
-else if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}\r\r
-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);}\r\r
-else{sClass=sSource;}\r\r
-if(this._isNewSource(sClass)){this._createNewSource(sClass);}}\r\r
-var timestamp=new Date();var logEntry={time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail,msg:sMsg};this._stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._firebugEnabled){this._printToFirebug(logEntry);}\r\r
-return true;}\r\r
-else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log(null,"Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableFirebug=function(){YAHOO.log("YAHOO.Logger output to Firebug has been disabled.");this._firebugEnabled=false;};YAHOO.widget.Logger.enableFirebug=function(){this._firebugEnabled=true;YAHOO.log("YAHOO.Logger output to Firebug has been enabled.");};YAHOO.widget.Logger._createNewCategory=function(category){this.categories.push(category);this.categoryCreateEvent.fire(category);};YAHOO.widget.Logger._isNewCategory=function(category){for(var i=0;i<this.categories.length;i++){if(category==this.categories[i]){return false;}}\r\r
-return true;};YAHOO.widget.Logger._createNewSource=function(source){this.sources.push(source);this.sourceCreateEvent.fire(source);};YAHOO.widget.Logger._isNewSource=function(source){if(source){for(var i=0;i<this.sources.length;i++){if(source==this.sources[i]){return false;}}\r\r
-return true;}};YAHOO.widget.Logger._printToFirebug=function(entry){if(window.console&&console.log){var category=entry.category;var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}\r\r
-else{localTime=time.toString();}\r\r
-var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+\r\r
-elapsedTime+"ms): "+\r\r
-entry.source+": "+\r\r
-entry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(msg,url,line){try{YAHOO.widget.Logger.log(msg+' ('+url+', line '+line+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}\r\r
-catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}\r\r
-window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}\r\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r\r
+YAHOO.widget.LogMsg=function(oConfigs){if(typeof oConfigs=="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;}\r\r
 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;}\r\r
-else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(containerEl,oConfig){var oSelf=this;if(typeof oConfig=="object"){for(var param in oConfig){this[param]=oConfig[param];}}\r\r
-if(containerEl){if(typeof containerEl=="string"){this._containerEl=document.getElementById(containerEl);}\r\r
-else if(containerEl.tagName){this._containerEl=containerEl;}\r\r
-this._containerEl.className="yui-log";}\r\r
-if(!this._containerEl){if(YAHOO.widget.LogReader._defaultContainerEl){this._containerEl=YAHOO.widget.LogReader._defaultContainerEl;}\r\r
-else{this._containerEl=document.body.appendChild(document.createElement("div"));this._containerEl.id="yui-log";this._containerEl.className="yui-log";YAHOO.widget.LogReader._defaultContainerEl=this._containerEl;}\r\r
-var containerStyle=this._containerEl.style;if(this.width){containerStyle.width=this.width;}\r\r
+else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){var oSelf=this;this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}\r\r
+if(elContainer){if(typeof elContainer=="string"){this._elContainer=document.getElementById(elContainer);}\r\r
+else if(elContainer.tagName){this._elContainer=elContainer;}\r\r
+this._elContainer.className="yui-log";}\r\r
+if(!this._elContainer){if(YAHOO.widget.LogReader._elDefaultContainer){this._elContainer=YAHOO.widget.LogReader._elDefaultContainer;}\r\r
+else{this._elContainer=document.body.appendChild(document.createElement("div"));this._elContainer.id="yui-log";this._elContainer.className="yui-log";YAHOO.widget.LogReader._elDefaultContainer=this._elContainer;}\r\r
+var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}\r\r
 if(this.left){containerStyle.left=this.left;}\r\r
 if(this.right){containerStyle.right=this.right;}\r\r
 if(this.bottom){containerStyle.bottom=this.bottom;}\r\r
 if(this.top){containerStyle.top=this.top;}\r\r
 if(this.fontSize){containerStyle.fontSize=this.fontSize;}}\r\r
-if(this._containerEl){if(!this._hdEl){this._hdEl=this._containerEl.appendChild(document.createElement("div"));this._hdEl.id="yui-log-hd"+YAHOO.widget.LogReader._index;this._hdEl.className="yui-log-hd";this._collapseEl=this._hdEl.appendChild(document.createElement("div"));this._collapseEl.className="yui-log-btns";this._collapseBtn=document.createElement("input");this._collapseBtn.type="button";this._collapseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._collapseBtn.className="yui-log-button";this._collapseBtn.value="Collapse";this._collapseBtn=this._collapseEl.appendChild(this._collapseBtn);YAHOO.util.Event.addListener(oSelf._collapseBtn,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._hdEl.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._defaultContainerEl==this._containerEl)){var ylog_dd=new YAHOO.util.DD(this._containerEl.id);ylog_dd.setHandleElId(this._hdEl.id);this._hdEl.style.cursor="move";}}\r\r
-if(!this._consoleEl){this._consoleEl=this._containerEl.appendChild(document.createElement("div"));this._consoleEl.className="yui-log-bd";if(this.height){this._consoleEl.style.height=this.height;}}\r\r
-if(!this._ftEl&&this.footerEnabled){this._ftEl=this._containerEl.appendChild(document.createElement("div"));this._ftEl.className="yui-log-ft";this._btnsEl=this._ftEl.appendChild(document.createElement("div"));this._btnsEl.className="yui-log-btns";this._pauseBtn=document.createElement("input");this._pauseBtn.type="button";this._pauseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._pauseBtn.className="yui-log-button";this._pauseBtn.value="Pause";this._pauseBtn=this._btnsEl.appendChild(this._pauseBtn);YAHOO.util.Event.addListener(oSelf._pauseBtn,'click',oSelf._onClickPauseBtn,oSelf);this._clearBtn=document.createElement("input");this._clearBtn.type="button";this._clearBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._clearBtn.className="yui-log-button";this._clearBtn.value="Clear";this._clearBtn=this._btnsEl.appendChild(this._clearBtn);YAHOO.util.Event.addListener(oSelf._clearBtn,'click',oSelf._onClickClearBtn,oSelf);this._categoryFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._categoryFiltersEl.className="yui-log-categoryfilters";this._sourceFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._sourceFiltersEl.className="yui-log-sourcefilters";}}\r\r
+if(this._elContainer){if(!this._elHd){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.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");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";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._elDefaultContainer==this._elContainer)){var ylog_dd=new YAHOO.util.DD(this._elContainer.id);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}}\r\r
+if(!this._elConsole){this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}}\r\r
+if(!this._elFt&&this.footerEnabled){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.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");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.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");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";}}\r\r
 if(!this._buffer){this._buffer=[];}\r\r
-YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);this._lastTime=YAHOO.widget.Logger.getStartTime();this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._categoryFiltersEl){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}\r\r
-this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._sourceFiltersEl){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}\r\r
-YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);YAHOO.widget.LogReader._index++;this._filterLogs();};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.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._containerEl.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._containerEl.style.display="block";};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){var regEx=/>/g;sTitle=sTitle.replace(regEx,"&gt;");regEx=/</g;sTitle=sTitle.replace(regEx,"&lt;");this._title.innerHTML=(sTitle);};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader._defaultContainerEl=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._containerEl=null;YAHOO.widget.LogReader.prototype._hdEl=null;YAHOO.widget.LogReader.prototype._collapseEl=null;YAHOO.widget.LogReader.prototype._collapseBtn=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._consoleEl=null;YAHOO.widget.LogReader.prototype._ftEl=null;YAHOO.widget.LogReader.prototype._btnsEl=null;YAHOO.widget.LogReader.prototype._categoryFiltersEl=null;YAHOO.widget.LogReader.prototype._sourceFiltersEl=null;YAHOO.widget.LogReader.prototype._pauseBtn=null;YAHOO.widget.LogReader.prototype._clearBtn=null;YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(category){var oSelf=this;if(this._ftEl){var parentEl=this._categoryFiltersEl;var filters=this._categoryFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var categoryChk=document.createElement("input");categoryChk.id="yui-log-filter-"+category+YAHOO.widget.LogReader._index;categoryChk.className="yui-log-filter-"+category;categoryChk.type="checkbox";categoryChk.category=category;categoryChk=filterEl.appendChild(categoryChk);categoryChk.checked=true;filters.push(category);YAHOO.util.Event.addListener(categoryChk,'click',oSelf._onCheckCategory,oSelf);var categoryChkLbl=filterEl.appendChild(document.createElement("label"));categoryChkLbl.htmlFor=categoryChk.id;categoryChkLbl.className=category;categoryChkLbl.innerHTML=category;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(source){var oSelf=this;if(this._ftEl){var parentEl=this._sourceFiltersEl;var filters=this._sourceFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var sourceChk=document.createElement("input");sourceChk.id="yui-log-filter"+source+YAHOO.widget.LogReader._index;sourceChk.className="yui-log-filter"+source;sourceChk.type="checkbox";sourceChk.source=source;sourceChk=filterEl.appendChild(sourceChk);sourceChk.checked=true;filters.push(source);YAHOO.util.Event.addListener(sourceChk,'click',oSelf._onCheckSource,oSelf);var sourceChkLbl=filterEl.appendChild(document.createElement("label"));sourceChkLbl.htmlFor=sourceChk.id;sourceChkLbl.className=source;sourceChkLbl.innerHTML=source;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._consoleEl!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._lastTime=YAHOO.widget.Logger.getStartTime();var consoleEl=this._consoleEl;while(consoleEl.hasChildNodes()){consoleEl.removeChild(consoleEl.firstChild);}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._consoleEl!==null){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}\r\r
-this._buffer=[];this._printToConsole(entries);if(!this.newestOnTop){this._consoleEl.scrollTop=this._consoleEl.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=0;i<entriesLen;i++){var entry=aEntries[i];var category=entry.category;var source=entry.source;var sourceDetail=entry.sourceDetail;var okToPrint=false;var okToFilterCats=false;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}\r\r
-if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}\r\r
-if(okToPrint){var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}\r\r
+this._lastTime=YAHOO.widget.Logger.getStartTime();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._elCategoryFilters){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}\r\r
+this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._elSourceFilters){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}\r\r
+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.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){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.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();}\r\r
 else{localTime=time.toString();}\r\r
-var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this._lastTime;this._lastTime=msecs;var verboseOutput=(this.verboseOutput)?"<br>":"";var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var output="<span class='"+category+"'>"+label+"</span> "+\r\r
-totalTime+"ms (+"+\r\r
-elapsedTime+") "+localTime+": "+\r\r
-sourceAndDetail+": "+\r\r
-verboseOutput+\r\r
-entry.msg;var oNewElement=(this.newestOnTop)?this._consoleEl.insertBefore(document.createElement("p"),this._consoleEl.firstChild):this._consoleEl.appendChild(document.createElement("p"));oNewElement.innerHTML=output;}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(type,args,oSelf){var category=args[0];if(oSelf._ftEl){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(type,args,oSelf){var source=args[0];if(oSelf._ftEl){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}\r\r
+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(oLogMsg.msg);var output=(this.verboseOutput)?["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ","</p><p>",sourceAndDetail,": </p><p>",msg,"</p>"]:["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ",sourceAndDetail,": ",msg,"</p>"];return output.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}\r\r
+return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader._elDefaultContainer=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._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._createCategoryCheckbox=function(sCategory){var oSelf=this;if(this._elFt){var elParent=this._elCategoryFilters;var filters=this._categoryFilters;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;filters.push(sCategory);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;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(sSource){var oSelf=this;if(this._elFt){var elParent=this._elSourceFilters;var filters=this._sourceFilters;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;filters.push(sSource);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;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;this._lastTime=YAHOO.widget.Logger.getStartTime();var elConsole=this._elConsole;while(elConsole.hasChildNodes()){elConsole.removeChild(elConsole.firstChild);}};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];}\r\r
+this._buffer=[];this._printToConsole(entries);}\r\r
+else{this._filterLogs();}\r\r
+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;}\r\r
+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;}}\r\r
+if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}\r\r
+if(okToPrint){var output=this.formatMsg(entry);var container=(this.verboseOutput)?"CODE":"PRE";var oNewElement=(this.newestOnTop)?this._elConsole.insertBefore(document.createElement(container),this._elConsole.firstChild):this._elConsole.appendChild(document.createElement(container));oNewElement.innerHTML=output;this._consoleMsgCount++;this._lastTime=entry.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(sType,aArgs,oSelf){var category=aArgs[0];if(oSelf._elFt){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(sType,aArgs,oSelf){var source=aArgs[0];if(oSelf._elFt){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}\r\r
 else{filtersArray.push(newFilter);}\r\r
 oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onCheckSource=function(v,oSelf){var newFilter=this.source;var filtersArray=oSelf._sourceFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}\r\r
 else{filtersArray.push(newFilter);}\r\r
-oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._collapseBtn;if(btn.value=="Expand"){oSelf._consoleEl.style.display="block";if(oSelf._ftEl){oSelf._ftEl.style.display="block";}\r\r
+oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._btnCollapse;if(btn.value=="Expand"){oSelf._elConsole.style.display="block";if(oSelf._elFt){oSelf._elFt.style.display="block";}\r\r
 btn.value="Collapse";}\r\r
-else{oSelf._consoleEl.style.display="none";if(oSelf._ftEl){oSelf._ftEl.style.display="none";}\r\r
-btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._pauseBtn;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}\r\r
-else{oSelf.pause();btn.value="Resume";}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf._clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(type,args,oSelf){var logEntry=args[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},100);}};
\ No newline at end of file
+else{oSelf._elConsole.style.display="none";if(oSelf._elFt){oSelf._elFt.style.display="none";}\r\r
+btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._btnPause;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}\r\r
+else{oSelf.pause();btn.value="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();},100);}};YAHOO.widget.LogReader.prototype._onReset=function(sType,aArgs,oSelf){oSelf._filterLogs();};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";}\r\r
+else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}\r\r
+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);}\r\r
+else{sClass=sSource;}\r\r
+if(this._isNewSource(sClass)){this._createNewSource(sClass);}}\r\r
+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();}\r\r
+stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}\r\r
+return true;}\r\r
+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;}}\r\r
+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;}}\r\r
+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();}\r\r
+else{localTime=time.toString();}\r\r
+var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+\r\r
+elapsedTime+"ms): "+\r\r
+oEntry.source+": "+\r\r
+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();}}\r\r
+catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}\r\r
+window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");
\ No newline at end of file
index bbd42f558ad72b1656ce9dde272736df1bbcd8d7..a2b40b29cccdb0450950d73821ab18c485bc127a 100755 (executable)
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-\r
+/*\r\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
+Code licensed under the BSD License:\r\r
+http://developer.yahoo.com/yui/license.txt\r\r
+version: 0.12.0\r\r
+*/\r\r
+\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
-/**\r\r
- * Singleton providing core logging functionality. Saves logs written through the\r\r
- * global YAHOO.log function or written by LogWriter. Provides access to logs\r\r
- * for reading by LogReader. Log messages are automatically output to Firebug,\r\r
- * if present.\r\r
- *\r\r
- * requires YAHOO.util.Event Event utility\r\r
- */\r\r
-YAHOO.widget.Logger = {\r\r
-    // Initialize members\r\r
-    loggerEnabled: true,\r\r
-    _firebugEnabled: true,\r\r
-    categories: ["info","warn","error","time","window"],\r\r
-    sources: ["global"],\r\r
-    _stack: [], // holds all log msgs\r\r
-    _startTime: new Date().getTime(), // static start timestamp\r\r
-    _lastTime: null // timestamp of last logged message\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Events\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Fired when a new category has been created. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The category name\r\r
- */\r\r
-YAHOO.widget.Logger.categoryCreateEvent = new YAHOO.util.CustomEvent("categoryCreate", this, true);\r\r
 \r\r
 /**\r\r
- * Fired when a new source has been named. Subscribers receive the following\r\r
- * array:<br>\r\r
- *     - args[0] The source name\r\r
- */\r\r
-YAHOO.widget.Logger.sourceCreateEvent = new YAHOO.util.CustomEvent("sourceCreate", this, true);\r\r
-\r\r
-/**\r\r
- * Fired when a new log message has been created. Subscribers receive the\r\r
- * following array:<br>\r\r
- *     - args[0] The log message\r\r
- */\r\r
-YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r\r
-\r\r
-/**\r\r
- * Fired when the Logger has been reset has been created.\r\r
- */\r\r
-YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r\r
-\r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Saves a log message to the stack and fires newLogEvent. If the log message is\r\r
- * assigned to an unknown category, creates a new category. If the log message is\r\r
- * from an unknown source, creates a new source.  If Firebug is enabled,\r\r
- * outputs the log message to Firebug.\r\r
+ * The LogMsg class defines a single log message.\r\r
  *\r\r
- * @param {string} sMsg The log message\r\r
- * @param {string} sCategory Category of log message, or null\r\r
- * @param {string} sSource Source of LogWriter, or null if global\r\r
+ * @class LogMsg\r\r
+ * @constructor\r\r
+ * @param oConfigs {Object} Object literal of configuration params.\r\r
  */\r\r
-YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r\r
-    if(this.loggerEnabled) {\r\r
-        if(!sCategory) {\r\r
-            sCategory = "info"; // default category\r\r
-        }\r\r
-        else if(this._isNewCategory(sCategory)) {\r\r
-            this._createNewCategory(sCategory);\r\r
-        }\r\r
-        var sClass = "global"; // default source\r\r
-        var sDetail = null;\r\r
-        if(sSource) {\r\r
-            var spaceIndex = sSource.indexOf(" ");\r\r
-            if(spaceIndex > 0) {\r\r
-                sClass = sSource.substring(0,spaceIndex);// substring until first space\r\r
-                sDetail = sSource.substring(spaceIndex,sSource.length);// the rest of the source\r\r
-            }\r\r
-            else {\r\r
-                sClass = sSource;\r\r
-            }\r\r
-            if(this._isNewSource(sClass)) {\r\r
-                this._createNewSource(sClass);\r\r
-            }\r\r
+ YAHOO.widget.LogMsg = function(oConfigs) {\r\r
+    // Parse configs\r\r
+    if (typeof oConfigs == "object") {\r\r
+        for(var param in oConfigs) {\r\r
+            this[param] = oConfigs[param];\r\r
         }\r\r
-\r\r
-        var timestamp = new Date();\r\r
-        var logEntry = {\r\r
-            time: timestamp,\r\r
-            category: sCategory,\r\r
-            source: sClass,\r\r
-            sourceDetail: sDetail,\r\r
-            msg: sMsg\r\r
-        };\r\r
-\r\r
-        this._stack.push(logEntry);\r\r
-        this.newLogEvent.fire(logEntry);\r\r
-\r\r
-        if(this._firebugEnabled) {\r\r
-            this._printToFirebug(logEntry);\r\r
-        }\r\r
-        return true;\r\r
     }\r\r
-    else {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r\r
- *\r\r
- */\r\r
-YAHOO.widget.Logger.reset = function() {\r\r
-    this._stack = [];\r\r
-    this._startTime = new Date().getTime();\r\r
-    this.loggerEnabled = true;\r\r
-    this.log(null, "Logger reset");\r\r
-    this.logResetEvent.fire();\r\r
-};\r\r
-\r\r
-/**\r\r
- * Public accessor to internal stack of log messages.\r\r
- *\r\r
- * @return {array} Array of log messages.\r\r
- */\r\r
-YAHOO.widget.Logger.getStack = function() {\r\r
-    return this._stack;\r\r
-};\r\r
+ };\r\r
\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
 \r\r
 /**\r\r
- * Public accessor to internal start time.\r\r
+ * Log message.\r\r
  *\r\r
- * @return {date} Internal date of when Logger singleton was initialized.\r\r
- */\r\r
-YAHOO.widget.Logger.getStartTime = function() {\r\r
-    return this._startTime;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Disables output to the Firebug Firefox extension.\r\r
- */\r\r
-YAHOO.widget.Logger.disableFirebug = function() {\r\r
-    YAHOO.log("YAHOO.Logger output to Firebug has been disabled.");\r\r
-    this._firebugEnabled = false;\r\r
-};\r\r
-\r\r
-/**\r\r
- * Enables output to the Firebug Firefox extension.\r\r
+ * @property msg\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger.enableFirebug = function() {\r\r
-    this._firebugEnabled = true;\r\r
-    YAHOO.log("YAHOO.Logger output to Firebug has been enabled.");\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+YAHOO.widget.LogMsg.prototype.msg = null;\r\r
\r\r
 /**\r\r
- * Creates a new category of log messages and fires categoryCreateEvent.\r\r
+ * Log timestamp.\r\r
  *\r\r
- * @param {string} category Category name\r\r
- * @private\r\r
+ * @property time\r\r
+ * @type Date\r\r
  */\r\r
-YAHOO.widget.Logger._createNewCategory = function(category) {\r\r
-    this.categories.push(category);\r\r
-    this.categoryCreateEvent.fire(category);\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.time = null;\r\r
 \r\r
 /**\r\r
- * Checks to see if a category has already been created.\r\r
+ * Log category.\r\r
  *\r\r
- * @param {string} category Category name\r\r
- * @return {boolean} Returns true if category is unknown, else returns false\r\r
- * @private\r\r
+ * @property category\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._isNewCategory = function(category) {\r\r
-    for(var i=0; i < this.categories.length; i++) {\r\r
-        if(category == this.categories[i]) {\r\r
-            return false;\r\r
-        }\r\r
-    }\r\r
-    return true;\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.category = null;\r\r
 \r\r
 /**\r\r
- * Creates a new source of log messages and fires sourceCreateEvent.\r\r
+ * Log source. The first word passed in as the source argument.\r\r
  *\r\r
- * @param {string} source Source name\r\r
- * @private\r\r
+ * @property source\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._createNewSource = function(source) {\r\r
-    this.sources.push(source);\r\r
-    this.sourceCreateEvent.fire(source);\r\r
-};\r\r
+YAHOO.widget.LogMsg.prototype.source = null;\r\r
 \r\r
 /**\r\r
- * Checks to see if a source has already been created.\r\r
+ * Log source detail. The remainder of the string passed in as the source argument, not\r\r
+ * including the first word (if any).\r\r
  *\r\r
- * @param {string} source Source name\r\r
- * @return {boolean} Returns true if source is unknown, else returns false\r\r
- * @private\r\r
+ * @property sourceDetail\r\r
+ * @type String\r\r
  */\r\r
-YAHOO.widget.Logger._isNewSource = function(source) {\r\r
-    if(source) {\r\r
-        for(var i=0; i < this.sources.length; i++) {\r\r
-            if(source == this.sources[i]) {\r\r
-                return false;\r\r
-            }\r\r
-        }\r\r
-        return true;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Outputs a log message to Firebug.\r\r
- *\r\r
- * @param {object} entry Log entry object\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.Logger._printToFirebug = function(entry) {\r\r
-    if(window.console && console.log) {\r\r
-        var category = entry.category;\r\r
-        var label = entry.category.substring(0,4).toUpperCase();\r\r
-\r\r
-        var time = entry.time;\r\r
-        if (time.toLocaleTimeString) {\r\r
-            var localTime  = time.toLocaleTimeString();\r\r
-        }\r\r
-        else {\r\r
-            localTime = time.toString();\r\r
-        }\r\r
-\r\r
-        var msecs = time.getTime();\r\r
-        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r\r
-            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r\r
-        YAHOO.widget.Logger._lastTime = msecs;\r\r
-\r\r
-        var output = //Firebug doesn't support HTML "<span class='"+category+"'>"+label+"</span> " +\r\r
-            localTime + " (" +\r\r
-            elapsedTime + "ms): " +\r\r
-            entry.source + ": " +\r\r
-            entry.msg;\r\r
-\r\r
-        \r\r
-        console.log(output);\r\r
-    }\r\r
-};\r\r
-\r\r
-/***************************************************************************\r\r
- * Private event handlers\r\r
- ***************************************************************************/\r\r
-/**\r\r
- * Handles logging of messages due to window error events.\r\r
- *\r\r
- * @param {string} msg The error message\r\r
- * @param {string} url URL of the error\r\r
- * @param {string} line Line number of the error\r\r
- * @private\r\r
- */\r\r
-YAHOO.widget.Logger._onWindowError = function(msg,url,line) {\r\r
-    // Logger is not in scope of this event handler\r\r
-    try {\r\r
-        YAHOO.widget.Logger.log(msg+' ('+url+', line '+line+')', "window");\r\r
-        if(YAHOO.widget.Logger._origOnWindowError) {\r\r
-            YAHOO.widget.Logger._origOnWindowError();\r\r
-        }\r\r
-    }\r\r
-    catch(e) {\r\r
-        return false;\r\r
-    }\r\r
-};\r\r
-\r\r
-/**\r\r
- * Handle native JavaScript errors\r\r
- */\r\r
-//NB: Not all browsers support the window.onerror event\r\r
-if(window.onerror) {\r\r
-    // Save any previously defined handler to call\r\r
-    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r\r
-}\r\r
-window.onerror = YAHOO.widget.Logger._onWindowError;\r\r
-\r\r
-/**\r\r
- * First log\r\r
- */\r\r
-YAHOO.widget.Logger.log("Logger initialized");\r\r
+YAHOO.widget.LogMsg.prototype.sourceDetail = null;\r\r
 \r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
 /****************************************************************************/\r\r
+\r\r
 /**\r\r
- * Class providing ability to log messages through YAHOO.widget.Logger from a\r\r
- * named source.\r\r
+ * The LogWriter class provides a mechanism to log messages through\r\r
+ * YAHOO.widget.Logger from a named source.\r\r
  *\r\r
+ * @class LogWriter\r\r
  * @constructor\r\r
- * @param {string} sSource Source of LogWriter instance\r\r
+ * @param sSource {String} Source of LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter = function(sSource) {\r\r
     if(!sSource) {\r\r
-        YAHOO.log("Could not instantiate LogWriter due to invalid source.", "error", "LogWriter");\r\r
+        YAHOO.log("Could not instantiate LogWriter due to invalid source.",\r\r
+            "error", "LogWriter");\r\r
         return;\r\r
     }\r\r
     this._source = sSource;\r\r
  };\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
  /**\r\r
  * Public accessor to the unique name of the LogWriter instance.\r\r
  *\r\r
- * @return {string} Unique name of the LogWriter instance\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.toString = function() {\r\r
     return "LogWriter " + this._sSource;\r\r
@@ -327,8 +112,9 @@ YAHOO.widget.LogWriter.prototype.toString = function() {
 /**\r\r
  * Logs a message attached to the source of the LogWriter.\r\r
  *\r\r
- * @param {string} sMsg The log message\r\r
- * @param {string} sCategory Category name\r\r
+ * @method log\r\r
+ * @param sMsg {String} The log message.\r\r
+ * @param sCategory {String} Category name.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {\r\r
     YAHOO.widget.Logger.log(sMsg, sCategory, this._source);\r\r
@@ -337,7 +123,8 @@ YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {
 /**\r\r
  * Public accessor to get the source name.\r\r
  *\r\r
- * @return {string} The LogWriter source\r\r
+ * @method getSource\r\r
+ * @return {String} The LogWriter source.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.getSource = function() {\r\r
     return this._sSource;\r\r
@@ -346,7 +133,8 @@ YAHOO.widget.LogWriter.prototype.getSource = function() {
 /**\r\r
  * Public accessor to set the source name.\r\r
  *\r\r
- * @param {string} sSource Source of LogWriter instance\r\r
+ * @method setSource\r\r
+ * @param sSource {String} Source of LogWriter instance.\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {\r\r
     if(!sSource) {\r\r
@@ -357,13 +145,18 @@ YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {
         this._sSource = sSource;\r\r
     }\r\r
 };\r\r
-/***************************************************************************\r\r
- * Private members\r\r
- ***************************************************************************/\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Source of the log writer instance.\r\r
+ * Source of the LogWriter instance.\r\r
  *\r\r
- * @type string\r\r
+ * @property _source\r\r
+ * @type String\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogWriter.prototype._source = null;\r\r
@@ -375,51 +168,51 @@ YAHOO.widget.LogWriter.prototype._source = null;
 /****************************************************************************/\r\r
 \r\r
 /**\r\r
- * Class providing UI to read messages logged to YAHOO.widget.Logger.\r\r
- *\r\r
- * requires YAHOO.util.Dom DOM utility\r\r
- * requires YAHOO.util.Event Event utility\r\r
- * optional YAHOO.util.DragDrop Drag and drop utility\r\r
+ * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.\r\r
  *\r\r
+ * @class LogReader\r\r
  * @constructor\r\r
- * @param {el or ID} containerEl DOM element object or ID of container to wrap reader UI\r\r
- * @param {object} oConfig Optional object literal of configuration params\r\r
+ * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.\r\r
+ * @param elContainer {String} (optional) String ID of an existing DIV.\r\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params.\r\r
  */\r\r
-YAHOO.widget.LogReader = function(containerEl, oConfig) {\r\r
+YAHOO.widget.LogReader = function(elContainer, oConfigs) {\r\r
     var oSelf = this;\r\r
+    this._sName = YAHOO.widget.LogReader._index;\r\r
+    YAHOO.widget.LogReader._index++;\r\r
 \r\r
     // Parse config vars here\r\r
-    if (typeof oConfig == "object") {\r\r
-        for(var param in oConfig) {\r\r
-            this[param] = oConfig[param];\r\r
+    if (typeof oConfigs == "object") {\r\r
+        for(var param in oConfigs) {\r\r
+            this[param] = oConfigs[param];\r\r
         }\r\r
     }\r\r
 \r\r
     // Attach container...\r\r
-    if(containerEl) {\r\r
-        if(typeof containerEl == "string") {\r\r
-            this._containerEl = document.getElementById(containerEl);\r\r
+    if(elContainer) {\r\r
+        if(typeof elContainer == "string") {\r\r
+            this._elContainer = document.getElementById(elContainer);\r\r
         }\r\r
-        else if(containerEl.tagName) {\r\r
-            this._containerEl = containerEl;\r\r
+        else if(elContainer.tagName) {\r\r
+            this._elContainer = elContainer;\r\r
         }\r\r
-        this._containerEl.className = "yui-log";\r\r
+        this._elContainer.className = "yui-log";\r\r
     }\r\r
     // ...or create container from scratch\r\r
-    if(!this._containerEl) {\r\r
-        if(YAHOO.widget.LogReader._defaultContainerEl) {\r\r
-            this._containerEl =  YAHOO.widget.LogReader._defaultContainerEl;\r\r
+    if(!this._elContainer) {\r\r
+        if(YAHOO.widget.LogReader._elDefaultContainer) {\r\r
+            this._elContainer =  YAHOO.widget.LogReader._elDefaultContainer;\r\r
         }\r\r
         else {\r\r
-            this._containerEl = document.body.appendChild(document.createElement("div"));\r\r
-            this._containerEl.id = "yui-log";\r\r
-            this._containerEl.className = "yui-log";\r\r
+            this._elContainer = document.body.appendChild(document.createElement("div"));\r\r
+            this._elContainer.id = "yui-log";\r\r
+            this._elContainer.className = "yui-log";\r\r
 \r\r
-            YAHOO.widget.LogReader._defaultContainerEl = this._containerEl;\r\r
+            YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;\r\r
         }\r\r
 \r\r
         // If implementer has provided container values, trust and set those\r\r
-        var containerStyle = this._containerEl.style;\r\r
+        var containerStyle = this._elContainer.style;\r\r
         if(this.width) {\r\r
             containerStyle.width = this.width;\r\r
         }\r\r
@@ -440,89 +233,100 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
         }\r\r
     }\r\r
 \r\r
-    if(this._containerEl) {\r\r
+    if(this._elContainer) {\r\r
         // Create header\r\r
-        if(!this._hdEl) {\r\r
-            this._hdEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._hdEl.id = "yui-log-hd" + YAHOO.widget.LogReader._index;\r\r
-            this._hdEl.className = "yui-log-hd";\r\r
-\r\r
-            this._collapseEl = this._hdEl.appendChild(document.createElement("div"));\r\r
-            this._collapseEl.className = "yui-log-btns";\r\r
-\r\r
-            this._collapseBtn = document.createElement("input");\r\r
-            this._collapseBtn.type = "button";\r\r
-            this._collapseBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._collapseBtn.className = "yui-log-button";\r\r
-            this._collapseBtn.value = "Collapse";\r\r
-            this._collapseBtn = this._collapseEl.appendChild(this._collapseBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._collapseBtn,'click',oSelf._onClickCollapseBtn,oSelf);\r\r
-\r\r
-            this._title = this._hdEl.appendChild(document.createElement("h4"));\r\r
+        if(!this._elHd) {\r\r
+            this._elHd = this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elHd.id = "yui-log-hd" + this._sName;\r\r
+            this._elHd.className = "yui-log-hd";\r\r
+\r\r
+            this._elCollapse = this._elHd.appendChild(document.createElement("div"));\r\r
+            this._elCollapse.className = "yui-log-btns";\r\r
+\r\r
+            this._btnCollapse = document.createElement("input");\r\r
+            this._btnCollapse.type = "button";\r\r
+            this._btnCollapse.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnCollapse.className = "yui-log-button";\r\r
+            this._btnCollapse.value = "Collapse";\r\r
+            this._btnCollapse = this._elCollapse.appendChild(this._btnCollapse);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);\r\r
+\r\r
+            this._title = this._elHd.appendChild(document.createElement("h4"));\r\r
             this._title.innerHTML = "Logger Console";\r\r
 \r\r
             // If Drag and Drop utility is available...\r\r
             // ...and this container was created from scratch...\r\r
             // ...then make the header draggable\r\r
             if(YAHOO.util.DD &&\r\r
-            (YAHOO.widget.LogReader._defaultContainerEl == this._containerEl)) {\r\r
-                var ylog_dd = new YAHOO.util.DD(this._containerEl.id);\r\r
-                ylog_dd.setHandleElId(this._hdEl.id);\r\r
-                this._hdEl.style.cursor = "move";\r\r
+            (YAHOO.widget.LogReader._elDefaultContainer == this._elContainer)) {\r\r
+                var ylog_dd = new YAHOO.util.DD(this._elContainer.id);\r\r
+                ylog_dd.setHandleElId(this._elHd.id);\r\r
+                this._elHd.style.cursor = "move";\r\r
             }\r\r
         }\r\r
         // Ceate console\r\r
-        if(!this._consoleEl) {\r\r
-            this._consoleEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._consoleEl.className = "yui-log-bd";\r\r
-            \r\r
+        if(!this._elConsole) {\r\r
+            this._elConsole =\r\r
+                this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elConsole.className = "yui-log-bd";\r\r
+\r\r
             // If implementer has provided console, trust and set those\r\r
             if(this.height) {\r\r
-                this._consoleEl.style.height = this.height;\r\r
+                this._elConsole.style.height = this.height;\r\r
             }\r\r
         }\r\r
         // Don't create footer if disabled\r\r
-        if(!this._ftEl && this.footerEnabled) {\r\r
-            this._ftEl = this._containerEl.appendChild(document.createElement("div"));\r\r
-            this._ftEl.className = "yui-log-ft";\r\r
-\r\r
-            this._btnsEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._btnsEl.className = "yui-log-btns";\r\r
-\r\r
-            this._pauseBtn = document.createElement("input");\r\r
-            this._pauseBtn.type = "button";\r\r
-            this._pauseBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._pauseBtn.className = "yui-log-button";\r\r
-            this._pauseBtn.value = "Pause";\r\r
-            this._pauseBtn = this._btnsEl.appendChild(this._pauseBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._pauseBtn,'click',oSelf._onClickPauseBtn,oSelf);\r\r
-\r\r
-            this._clearBtn = document.createElement("input");\r\r
-            this._clearBtn.type = "button";\r\r
-            this._clearBtn.style.fontSize = YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");\r\r
-            this._clearBtn.className = "yui-log-button";\r\r
-            this._clearBtn.value = "Clear";\r\r
-            this._clearBtn = this._btnsEl.appendChild(this._clearBtn);\r\r
-            YAHOO.util.Event.addListener(oSelf._clearBtn,'click',oSelf._onClickClearBtn,oSelf);\r\r
-\r\r
-            this._categoryFiltersEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._categoryFiltersEl.className = "yui-log-categoryfilters";\r\r
-            this._sourceFiltersEl = this._ftEl.appendChild(document.createElement("div"));\r\r
-            this._sourceFiltersEl.className = "yui-log-sourcefilters";\r\r
+        if(!this._elFt && this.footerEnabled) {\r\r
+            this._elFt = this._elContainer.appendChild(document.createElement("div"));\r\r
+            this._elFt.className = "yui-log-ft";\r\r
+\r\r
+            this._elBtns = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elBtns.className = "yui-log-btns";\r\r
+\r\r
+            this._btnPause = document.createElement("input");\r\r
+            this._btnPause.type = "button";\r\r
+            this._btnPause.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnPause.className = "yui-log-button";\r\r
+            this._btnPause.value = "Pause";\r\r
+            this._btnPause = this._elBtns.appendChild(this._btnPause);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);\r\r
+\r\r
+            this._btnClear = document.createElement("input");\r\r
+            this._btnClear.type = "button";\r\r
+            this._btnClear.style.fontSize =\r\r
+                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r\r
+            this._btnClear.className = "yui-log-button";\r\r
+            this._btnClear.value = "Clear";\r\r
+            this._btnClear = this._elBtns.appendChild(this._btnClear);\r\r
+            YAHOO.util.Event.addListener(\r\r
+                oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);\r\r
+\r\r
+            this._elCategoryFilters = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elCategoryFilters.className = "yui-log-categoryfilters";\r\r
+            this._elSourceFilters = this._elFt.appendChild(document.createElement("div"));\r\r
+            this._elSourceFilters.className = "yui-log-sourcefilters";\r\r
         }\r\r
     }\r\r
 \r\r
-    // Initialize buffer\r\r
+    // Initialize internal vars\r\r
     if(!this._buffer) {\r\r
         this._buffer = []; // output buffer\r\r
     }\r\r
+    // Timestamp of last log message to console\r\r
+    this._lastTime = YAHOO.widget.Logger.getStartTime(); \r\r
+    \r\r
+    // Subscribe to Logger custom events\r\r
     YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime(); // timestamp of last log message to console\r\r
+    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r\r
 \r\r
     // Initialize category filters\r\r
     this._categoryFilters = [];\r\r
     var catsLen = YAHOO.widget.Logger.categories.length;\r\r
-    if(this._categoryFiltersEl) {\r\r
+    if(this._elCategoryFilters) {\r\r
         for(var i=0; i < catsLen; i++) {\r\r
             this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);\r\r
         }\r\r
@@ -530,7 +334,7 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
     // Initialize source filters\r\r
     this._sourceFilters = [];\r\r
     var sourcesLen = YAHOO.widget.Logger.sources.length;\r\r
-    if(this._sourceFiltersEl) {\r\r
+    if(this._elSourceFilters) {\r\r
         for(var j=0; j < sourcesLen; j++) {\r\r
             this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);\r\r
         }\r\r
@@ -538,98 +342,147 @@ YAHOO.widget.LogReader = function(containerEl, oConfig) {
     YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);\r\r
     YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);\r\r
 \r\r
-    YAHOO.widget.LogReader._index++;\r\r
     this._filterLogs();\r\r
+    YAHOO.log("LogReader initialized", null, this.toString());\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Public members\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
- * Whether or not the log reader is enabled to output log messages. Default:\r\r
- * true.\r\r
+ * Whether or not the log reader is enabled to output log messages.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property logReaderEnabled\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.logReaderEnabled = true;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS width of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property width\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.width = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS height of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property height\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.height = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS top position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property top\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.top = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS left position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property left\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.left = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS right position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property right\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.right = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS bottom position of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property bottom\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.bottom = null;\r\r
 \r\r
 /**\r\r
  * Public member to access CSS font size of the log reader container.\r\r
  *\r\r
- * @type string\r\r
+ * @property fontSize\r\r
+ * @type String\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.fontSize = null;\r\r
 \r\r
 /**\r\r
- * Whether or not the footer UI is enabled for the log reader. Default: true.\r\r
+ * Whether or not the footer UI is enabled for the log reader.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property footerEnabled\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.footerEnabled = true;\r\r
 \r\r
 /**\r\r
  * Whether or not output is verbose (more readable). Setting to true will make\r\r
- * output more compact (less readable). Default: true.\r\r
+ * output more compact (less readable).\r\r
  *\r\r
- * @type boolean\r\r
+ * @property verboseOutput\r\r
+ * @type Boolean\r\r
+ * @default true\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.verboseOutput = true;\r\r
 \r\r
 /**\r\r
- * Whether or not newest message is printed on top. Default: true.\r\r
+ * Whether or not newest message is printed on top.\r\r
  *\r\r
- * @type boolean\r\r
+ * @property newestOnTop\r\r
+ * @type Boolean\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.newestOnTop = true;\r\r
 \r\r
-/***************************************************************************\r\r
- * Public methods\r\r
- ***************************************************************************/\r\r
+/**\r\r
+ * Maximum number of messages a LogReader console will display.\r\r
+ *\r\r
+ * @property thresholdMax\r\r
+ * @type Number\r\r
+ * @default 500\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.thresholdMax = 500;\r\r
+\r\r
+/**\r\r
+ * When a LogReader console reaches its thresholdMax, it will clear out messages\r\r
+ * and print out the latest thresholdMin number of messages.\r\r
+ *\r\r
+ * @property thresholdMin\r\r
+ * @type Number\r\r
+ * @default 100\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.thresholdMin = 100;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+ /**\r\r
+ * Public accessor to the unique name of the LogReader instance.\r\r
+ *\r\r
+ * @method toString\r\r
+ * @return {String} Unique name of the LogReader instance.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.toString = function() {\r\r
+    return "LogReader instance" + this._sName;\r\r
+};\r\r
 /**\r\r
  * Pauses output of log messages. While paused, log messages are not lost, but\r\r
  * get saved to a buffer and then output upon resume of log reader.\r\r
+ *\r\r
+ * @method pause\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.pause = function() {\r\r
     this._timeout = null;\r\r
@@ -639,6 +492,8 @@ YAHOO.widget.LogReader.prototype.pause = function() {
 /**\r\r
  * Resumes output of log messages, including outputting any log messages that\r\r
  * have been saved to buffer while paused.\r\r
+ *\r\r
+ * @method resume\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.resume = function() {\r\r
     this.logReaderEnabled = true;\r\r
@@ -647,63 +502,175 @@ YAHOO.widget.LogReader.prototype.resume = function() {
 \r\r
 /**\r\r
  * Hides UI of log reader. Logging functionality is not disrupted.\r\r
+ *\r\r
+ * @method hide\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.hide = function() {\r\r
-    this._containerEl.style.display = "none";\r\r
+    this._elContainer.style.display = "none";\r\r
 };\r\r
 \r\r
 /**\r\r
  * Shows UI of log reader. Logging functionality is not disrupted.\r\r
+ *\r\r
+ * @method show\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.show = function() {\r\r
-    this._containerEl.style.display = "block";\r\r
+    this._elContainer.style.display = "block";\r\r
 };\r\r
 \r\r
 /**\r\r
  * Updates title to given string.\r\r
  *\r\r
- * @param {string} sTitle String to display in log reader's title bar.\r\r
+ * @method setTitle\r\r
+ * @param sTitle {String} New title.\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {\r\r
-    var regEx = />/g;\r\r
-    sTitle = sTitle.replace(regEx,"&gt;");\r\r
-    regEx = /</g;\r\r
-    sTitle = sTitle.replace(regEx,"&lt;");\r\r
-    this._title.innerHTML = (sTitle);\r\r
+    this._title.innerHTML = this.html2Text(sTitle);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Gets timestamp of the last log.\r\r
+ *\r\r
+ * @method getLastTime\r\r
+ * @return {Date} Timestamp of the last log.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.getLastTime = function() {\r\r
+    return this._lastTime;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Formats message string to HTML for output to console.\r\r
+ *\r\r
+ * @method formatMsg\r\r
+ * @param oLogMsg {Object} Log message object.\r\r
+ * @return {String} HTML-formatted message for output to console.\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r\r
+    var category = oLogMsg.category;\r\r
+    \r\r
+    // Label for color-coded display\r\r
+    var label = category.substring(0,4).toUpperCase();\r\r
+\r\r
+    // Calculate the elapsed time to be from the last item that passed through the filter,\r\r
+    // not the absolute previous item in the stack\r\r
+\r\r
+    var time = oLogMsg.time;\r\r
+    if (time.toLocaleTimeString) {\r\r
+        var localTime  = time.toLocaleTimeString();\r\r
+    }\r\r
+    else {\r\r
+        localTime = time.toString();\r\r
+    }\r\r
+\r\r
+    var msecs = time.getTime();\r\r
+    var startTime = YAHOO.widget.Logger.getStartTime();\r\r
+    var totalTime = msecs - startTime;\r\r
+    var elapsedTime = msecs - this.getLastTime();\r\r
+\r\r
+    var source = oLogMsg.source;\r\r
+    var sourceDetail = oLogMsg.sourceDetail;\r\r
+    var sourceAndDetail = (sourceDetail) ?\r\r
+        source + " " + sourceDetail : source;\r\r
+        \r\r
+    // Escape HTML entities in the log message itself for output to console\r\r
+    var msg = this.html2Text(oLogMsg.msg);\r\r
+\r\r
+    // Verbose output includes extra line breaks\r\r
+    var output =  (this.verboseOutput) ?\r\r
+        ["<p><span class='", category, "'>", label, "</span> ",\r\r
+        totalTime, "ms (+", elapsedTime, ") ",\r\r
+        localTime, ": ",\r\r
+        "</p><p>",\r\r
+        sourceAndDetail,\r\r
+        ": </p><p>",\r\r
+        msg,\r\r
+        "</p>"] :\r\r
+\r\r
+        ["<p><span class='", category, "'>", label, "</span> ",\r\r
+        totalTime, "ms (+", elapsedTime, ") ",\r\r
+        localTime, ": ",\r\r
+        sourceAndDetail, ": ",\r\r
+        msg,"</p>"];\r\r
+\r\r
+    return output.join("");\r\r
 };\r\r
- /***************************************************************************\r\r
- * Private members\r\r
- ***************************************************************************/\r\r
+\r\r
+/**\r\r
+ * Converts input chars "<", ">", and "&" to HTML entities.\r\r
+ *\r\r
+ * @method html2Text\r\r
+ * @param sHtml {String} String to convert.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {\r\r
+    if(sHtml) {\r\r
+        sHtml += "";\r\r
+        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");\r\r
+    }\r\r
+    return "";\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private member variables\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Internal class member to index multiple log reader instances.\r\r
  *\r\r
- * @type number\r\r
+ * @property _memberName\r\r
+ * @static\r\r
+ * @type Number\r\r
+ * @default 0\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader._index = 0;\r\r
 \r\r
+/**\r\r
+ * Name of LogReader instance.\r\r
+ *\r\r
+ * @property _sName\r\r
+ * @type String\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._sName = null;\r\r
+\r\r
 /**\r\r
  * A class member shared by all log readers if a container needs to be\r\r
  * created during instantiation. Will be null if a container element never needs to\r\r
  * be created on the fly, such as when the implementer passes in their own element.\r\r
  *\r\r
+ * @property _elDefaultContainer\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader._defaultContainerEl = null;\r\r
+YAHOO.widget.LogReader._elDefaultContainer = null;\r\r
 \r\r
 /**\r\r
- * Buffer of log messages for batch output.\r\r
+ * Buffer of log message objects for batch output.\r\r
  *\r\r
- * @type array\r\r
+ * @property _buffer\r\r
+ * @type Object[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._buffer = null;\r\r
 \r\r
+/**\r\r
+ * Number of log messages output to console.\r\r
+ *\r\r
+ * @property _consoleMsgCount\r\r
+ * @type Number\r\r
+ * @default 0\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;\r\r
+\r\r
 /**\r\r
  * Date of last output log message.\r\r
  *\r\r
- * @type date\r\r
+ * @property _lastTime\r\r
+ * @type Date\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._lastTime = null;\r\r
@@ -711,7 +678,8 @@ YAHOO.widget.LogReader.prototype._lastTime = null;
 /**\r\r
  * Batched output timeout ID.\r\r
  *\r\r
- * @type number\r\r
+ * @property _timeout\r\r
+ * @type Number\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._timeout = null;\r\r
@@ -719,7 +687,8 @@ YAHOO.widget.LogReader.prototype._timeout = null;
 /**\r\r
  * Array of filters for log message categories.\r\r
  *\r\r
- * @type array\r\r
+ * @property _categoryFilters\r\r
+ * @type String[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._categoryFilters = null;\r\r
@@ -727,7 +696,8 @@ YAHOO.widget.LogReader.prototype._categoryFilters = null;
 /**\r\r
  * Array of filters for log message sources.\r\r
  *\r\r
- * @type array\r\r
+ * @property _sourceFilters\r\r
+ * @type String[]\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._sourceFilters = null;\r\r
@@ -735,38 +705,43 @@ YAHOO.widget.LogReader.prototype._sourceFilters = null;
 /**\r\r
  * Log reader container element.\r\r
  *\r\r
+ * @property _elContainer\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._containerEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elContainer = null;\r\r
 \r\r
 /**\r\r
  * Log reader header element.\r\r
  *\r\r
+ * @property _elHd\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._hdEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elHd = null;\r\r
 \r\r
 /**\r\r
  * Log reader collapse element.\r\r
  *\r\r
+ * @property _elCollapse\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._collapseEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elCollapse = null;\r\r
 \r\r
 /**\r\r
  * Log reader collapse button element.\r\r
  *\r\r
+ * @property _btnCollapse\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._collapseBtn = null;\r\r
+YAHOO.widget.LogReader.prototype._btnCollapse = null;\r\r
 \r\r
 /**\r\r
  * Log reader title header element.\r\r
  *\r\r
+ * @property _title\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
@@ -775,140 +750,160 @@ YAHOO.widget.LogReader.prototype._title = null;
 /**\r\r
  * Log reader console element.\r\r
  *\r\r
+ * @property _elConsole\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._consoleEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elConsole = null;\r\r
 \r\r
 /**\r\r
  * Log reader footer element.\r\r
  *\r\r
+ * @property _elFt\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._ftEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elFt = null;\r\r
 \r\r
 /**\r\r
  * Log reader buttons container element.\r\r
  *\r\r
+ * @property _elBtns\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._btnsEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elBtns = null;\r\r
 \r\r
 /**\r\r
  * Container element for log reader category filter checkboxes.\r\r
  *\r\r
+ * @property _elCategoryFilters\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._categoryFiltersEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elCategoryFilters = null;\r\r
 \r\r
 /**\r\r
  * Container element for log reader source filter checkboxes.\r\r
  *\r\r
+ * @property _elSourceFilters\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._sourceFiltersEl = null;\r\r
+YAHOO.widget.LogReader.prototype._elSourceFilters = null;\r\r
 \r\r
 /**\r\r
  * Log reader pause button element.\r\r
  *\r\r
+ * @property _btnPause\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._pauseBtn = null;\r\r
+YAHOO.widget.LogReader.prototype._btnPause = null;\r\r
 \r\r
 /**\r\r
- * lear button element.\r\r
+ * Clear button element.\r\r
  *\r\r
+ * @property _btnClear\r\r
  * @type HTMLElement\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._clearBtn = null;\r\r
-/***************************************************************************\r\r
- * Private methods\r\r
- ***************************************************************************/\r\r
+YAHOO.widget.LogReader.prototype._btnClear = null;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Creates the UI for a category filter in the log reader footer element.\r\r
  *\r\r
- * @param {string} category Category name\r\r
+ * @method _createCategoryCheckbox\r\r
+ * @param sCategory {String} Category name.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(category) {\r\r
+YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {\r\r
     var oSelf = this;\r\r
-    \r\r
-    if(this._ftEl) {\r\r
-        var parentEl = this._categoryFiltersEl;\r\r
+\r\r
+    if(this._elFt) {\r\r
+        var elParent = this._elCategoryFilters;\r\r
         var filters = this._categoryFilters;\r\r
 \r\r
-        var filterEl = parentEl.appendChild(document.createElement("span"));\r\r
-        filterEl.className = "yui-log-filtergrp";\r\r
+        var elFilter = elParent.appendChild(document.createElement("span"));\r\r
+        elFilter.className = "yui-log-filtergrp";\r\r
             // Append el at the end so IE 5.5 can set "type" attribute\r\r
             // and THEN set checked property\r\r
-            var categoryChk = document.createElement("input");\r\r
-            categoryChk.id = "yui-log-filter-" + category + YAHOO.widget.LogReader._index;\r\r
-            categoryChk.className = "yui-log-filter-" + category;\r\r
-            categoryChk.type = "checkbox";\r\r
-            categoryChk.category = category;\r\r
-            categoryChk = filterEl.appendChild(categoryChk);\r\r
-            categoryChk.checked = true;\r\r
+            var chkCategory = document.createElement("input");\r\r
+            chkCategory.id = "yui-log-filter-" + sCategory + this._sName;\r\r
+            chkCategory.className = "yui-log-filter-" + sCategory;\r\r
+            chkCategory.type = "checkbox";\r\r
+            chkCategory.category = sCategory;\r\r
+            chkCategory = elFilter.appendChild(chkCategory);\r\r
+            chkCategory.checked = true;\r\r
 \r\r
             // Add this checked filter to the internal array of filters\r\r
-            filters.push(category);\r\r
+            filters.push(sCategory);\r\r
             // Subscribe to the click event\r\r
-            YAHOO.util.Event.addListener(categoryChk,'click',oSelf._onCheckCategory,oSelf);\r\r
+            YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);\r\r
 \r\r
             // Create and class the text label\r\r
-            var categoryChkLbl = filterEl.appendChild(document.createElement("label"));\r\r
-            categoryChkLbl.htmlFor = categoryChk.id;\r\r
-            categoryChkLbl.className = category;\r\r
-            categoryChkLbl.innerHTML = category;\r\r
+            var lblCategory = elFilter.appendChild(document.createElement("label"));\r\r
+            lblCategory.htmlFor = chkCategory.id;\r\r
+            lblCategory.className = sCategory;\r\r
+            lblCategory.innerHTML = sCategory;\r\r
     }\r\r
 };\r\r
 \r\r
-YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(source) {\r\r
+/**\r\r
+ * Creates a checkbox in the log reader footer element to filter by source.\r\r
+ *\r\r
+ * @method _createSourceCheckbox\r\r
+ * @param sSource {String} Source name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {\r\r
     var oSelf = this;\r\r
 \r\r
-    if(this._ftEl) {\r\r
-        var parentEl = this._sourceFiltersEl;\r\r
+    if(this._elFt) {\r\r
+        var elParent = this._elSourceFilters;\r\r
         var filters = this._sourceFilters;\r\r
 \r\r
-        var filterEl = parentEl.appendChild(document.createElement("span"));\r\r
-        filterEl.className = "yui-log-filtergrp";\r\r
+        var elFilter = elParent.appendChild(document.createElement("span"));\r\r
+        elFilter.className = "yui-log-filtergrp";\r\r
 \r\r
         // Append el at the end so IE 5.5 can set "type" attribute\r\r
         // and THEN set checked property\r\r
-        var sourceChk = document.createElement("input");\r\r
-        sourceChk.id = "yui-log-filter" + source + YAHOO.widget.LogReader._index;\r\r
-        sourceChk.className = "yui-log-filter" + source;\r\r
-        sourceChk.type = "checkbox";\r\r
-        sourceChk.source = source;\r\r
-        sourceChk = filterEl.appendChild(sourceChk);\r\r
-        sourceChk.checked = true;\r\r
+        var chkSource = document.createElement("input");\r\r
+        chkSource.id = "yui-log-filter" + sSource + this._sName;\r\r
+        chkSource.className = "yui-log-filter" + sSource;\r\r
+        chkSource.type = "checkbox";\r\r
+        chkSource.source = sSource;\r\r
+        chkSource = elFilter.appendChild(chkSource);\r\r
+        chkSource.checked = true;\r\r
 \r\r
         // Add this checked filter to the internal array of filters\r\r
-        filters.push(source);\r\r
+        filters.push(sSource);\r\r
         // Subscribe to the click event\r\r
-        YAHOO.util.Event.addListener(sourceChk,'click',oSelf._onCheckSource,oSelf);\r\r
+        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);\r\r
 \r\r
         // Create and class the text label\r\r
-        var sourceChkLbl = filterEl.appendChild(document.createElement("label"));\r\r
-        sourceChkLbl.htmlFor = sourceChk.id;\r\r
-        sourceChkLbl.className = source;\r\r
-        sourceChkLbl.innerHTML = source;\r\r
+        var lblSource = elFilter.appendChild(document.createElement("label"));\r\r
+        lblSource.htmlFor = chkSource.id;\r\r
+        lblSource.className = sSource;\r\r
+        lblSource.innerHTML = sSource;\r\r
     }\r\r
 };\r\r
 \r\r
 /**\r\r
  * Reprints all log messages in the stack through filters.\r\r
  *\r\r
+ * @method _filterLogs\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._filterLogs = function() {\r\r
     // Reprint stack with new filters\r\r
-    if (this._consoleEl !== null) {\r\r
+    if (this._elConsole !== null) {\r\r
         this._clearConsole();\r\r
         this._printToConsole(YAHOO.widget.Logger.getStack());\r\r
     }\r\r
@@ -918,39 +913,50 @@ YAHOO.widget.LogReader.prototype._filterLogs = function() {
  * Clears all outputted log messages from the console and resets the time of the\r\r
  * last output log message.\r\r
  *\r\r
+ * @method _clearConsole\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._clearConsole = function() {\r\r
     // Clear the buffer of any pending messages\r\r
     this._timeout = null;\r\r
     this._buffer = [];\r\r
+    this._consoleMsgCount = 0;\r\r
 \r\r
     // Reset the rolling timer\r\r
     this._lastTime = YAHOO.widget.Logger.getStartTime();\r\r
 \r\r
-    var consoleEl = this._consoleEl;\r\r
-    while(consoleEl.hasChildNodes()) {\r\r
-        consoleEl.removeChild(consoleEl.firstChild);\r\r
+    var elConsole = this._elConsole;\r\r
+    while(elConsole.hasChildNodes()) {\r\r
+        elConsole.removeChild(elConsole.firstChild);\r\r
     }\r\r
 };\r\r
 \r\r
 /**\r\r
  * Sends buffer of log messages to output and clears buffer.\r\r
  *\r\r
+ * @method _printBuffer\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._printBuffer = function() {\r\r
     this._timeout = null;\r\r
 \r\r
-    if (this._consoleEl !== null) {\r\r
-        var entries = [];\r\r
-        for (var i=0; i<this._buffer.length; i++) {\r\r
-            entries[i] = this._buffer[i];\r\r
+    if(this._elConsole !== null) {\r\r
+        var thresholdMax = this.thresholdMax;\r\r
+        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;\r\r
+        if(this._consoleMsgCount < thresholdMax) {\r\r
+            var entries = [];\r\r
+            for (var i=0; i<this._buffer.length; i++) {\r\r
+                entries[i] = this._buffer[i];\r\r
+            }\r\r
+            this._buffer = [];\r\r
+            this._printToConsole(entries);\r\r
+        }\r\r
+        else {\r\r
+            this._filterLogs();\r\r
         }\r\r
-        this._buffer = [];\r\r
-        this._printToConsole(entries);\r\r
+        \r\r
         if(!this.newestOnTop) {\r\r
-            this._consoleEl.scrollTop = this._consoleEl.scrollHeight;\r\r
+            this._elConsole.scrollTop = this._elConsole.scrollHeight;\r\r
         }\r\r
     }\r\r
 };\r\r
@@ -959,22 +965,32 @@ YAHOO.widget.LogReader.prototype._printBuffer = function() {
  * Cycles through an array of log messages, and outputs each one to the console\r\r
  * if its category has not been filtered out.\r\r
  *\r\r
- * @param {array} aEntries\r\r
+ * @method _printToConsole\r\r
+ * @param aEntries {Object[]} Array of LogMsg objects to output to console.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {\r\r
+    // Manage the number of messages displayed in the console\r\r
     var entriesLen = aEntries.length;\r\r
+    var thresholdMin = this.thresholdMin;\r\r
+    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {\r\r
+        thresholdMin = 0;\r\r
+    }\r\r
+    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r\r
+    \r\r
+    // Iterate through all log entries \r\r
     var sourceFiltersLen = this._sourceFilters.length;\r\r
     var categoryFiltersLen = this._categoryFilters.length;\r\r
-    // Iterate through all log entries to print the ones that filter through\r\r
-    for(var i=0; i<entriesLen; i++) {\r\r
-        var entry = aEntries[i];\r\r
-        var category = entry.category;\r\r
-        var source = entry.source;\r\r
-        var sourceDetail = entry.sourceDetail;\r\r
+    for(var i=entriesStartIndex; i<entriesLen; i++) {\r\r
+        // Print only the ones that filter through\r\r
         var okToPrint = false;\r\r
         var okToFilterCats = false;\r\r
 \r\r
+        // Get log message details\r\r
+        var entry = aEntries[i];\r\r
+        var source = entry.source;\r\r
+        var category = entry.category;\r\r
+\r\r
         for(var j=0; j<sourceFiltersLen; j++) {\r\r
             if(source == this._sourceFilters[j]) {\r\r
                 okToFilterCats = true;\r\r
@@ -990,58 +1006,40 @@ YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {
             }\r\r
         }\r\r
         if(okToPrint) {\r\r
-            // To format for console, calculate the elapsed time\r\r
-            // to be from the last item that passed through the filter,\r\r
-            // not the absolute previous item in the stack\r\r
-            var label = entry.category.substring(0,4).toUpperCase();\r\r
-\r\r
-            var time = entry.time;\r\r
-            if (time.toLocaleTimeString) {\r\r
-                var localTime  = time.toLocaleTimeString();\r\r
-            }\r\r
-            else {\r\r
-                localTime = time.toString();\r\r
-            }\r\r
-\r\r
-            var msecs = time.getTime();\r\r
-            var startTime = YAHOO.widget.Logger.getStartTime();\r\r
-            var totalTime = msecs - startTime;\r\r
-            var elapsedTime = msecs - this._lastTime;\r\r
-            this._lastTime = msecs;\r\r
-            \r\r
-            var verboseOutput = (this.verboseOutput) ? "<br>" : "";\r\r
-            var sourceAndDetail = (sourceDetail) ?\r\r
-                source + " " + sourceDetail : source;\r\r
-\r\r
-            var output =  "<span class='"+category+"'>"+label+"</span> " +\r\r
-                totalTime + "ms (+" +\r\r
-                elapsedTime + ") " + localTime + ": " +\r\r
-                sourceAndDetail + ": " +\r\r
-                verboseOutput +\r\r
-                entry.msg;\r\r
+            var output = this.formatMsg(entry);\r\r
 \r\r
+            // Verbose output uses <code> tag instead of <pre> tag (for wrapping)\r\r
+            var container = (this.verboseOutput) ? "CODE" : "PRE";\r\r
             var oNewElement = (this.newestOnTop) ?\r\r
-                this._consoleEl.insertBefore(document.createElement("p"),this._consoleEl.firstChild):\r\r
-                this._consoleEl.appendChild(document.createElement("p"));\r\r
+                this._elConsole.insertBefore(\r\r
+                    document.createElement(container),this._elConsole.firstChild):\r\r
+                this._elConsole.appendChild(document.createElement(container));\r\r
+\r\r
             oNewElement.innerHTML = output;\r\r
+            this._consoleMsgCount++;\r\r
+            this._lastTime = entry.time.getTime();\r\r
         }\r\r
     }\r\r
 };\r\r
 \r\r
-/***************************************************************************\r\r
- * Private event handlers\r\r
- ***************************************************************************/\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private event handlers\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
 /**\r\r
  * Handles Logger's categoryCreateEvent.\r\r
  *\r\r
- * @param {string} type The event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCategoryCreate\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onCategoryCreate = function(type, args, oSelf) {\r\r
-    var category = args[0];\r\r
-    if(oSelf._ftEl) {\r\r
+YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {\r\r
+    var category = aArgs[0];\r\r
+    if(oSelf._elFt) {\r\r
         oSelf._createCategoryCheckbox(category);\r\r
     }\r\r
 };\r\r
@@ -1049,14 +1047,15 @@ YAHOO.widget.LogReader.prototype._onCategoryCreate = function(type, args, oSelf)
 /**\r\r
  * Handles Logger's sourceCreateEvent.\r\r
  *\r\r
- * @param {string} type The event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onSourceCreate\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onSourceCreate = function(type, args, oSelf) {\r\r
-    var source = args[0];\r\r
-    if(oSelf._ftEl) {\r\r
+YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {\r\r
+    var source = aArgs[0];\r\r
+    if(oSelf._elFt) {\r\r
         oSelf._createSourceCheckbox(source);\r\r
     }\r\r
 };\r\r
@@ -1064,8 +1063,9 @@ YAHOO.widget.LogReader.prototype._onSourceCreate = function(type, args, oSelf) {
 /**\r\r
  * Handles check events on the category filter checkboxes.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCheckCategory\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {\r\r
@@ -1089,14 +1089,15 @@ YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {
 /**\r\r
  * Handles check events on the category filter checkboxes.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onCheckSource\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The log reader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {\r\r
     var newFilter = this.source;\r\r
     var filtersArray = oSelf._sourceFilters;\r\r
-    \r\r
+\r\r
     if(!this.checked) { // Remove category from filters\r\r
         for(var i=0; i<filtersArray.length; i++) {\r\r
             if(newFilter == filtersArray[i]) {\r\r
@@ -1114,23 +1115,24 @@ YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {
 /**\r\r
  * Handles click events on the collapse button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickCollapseBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {\r\r
-    var btn = oSelf._collapseBtn;\r\r
+    var btn = oSelf._btnCollapse;\r\r
     if(btn.value == "Expand") {\r\r
-        oSelf._consoleEl.style.display = "block";\r\r
-        if(oSelf._ftEl) {\r\r
-            oSelf._ftEl.style.display = "block";\r\r
+        oSelf._elConsole.style.display = "block";\r\r
+        if(oSelf._elFt) {\r\r
+            oSelf._elFt.style.display = "block";\r\r
         }\r\r
         btn.value = "Collapse";\r\r
     }\r\r
     else {\r\r
-        oSelf._consoleEl.style.display = "none";\r\r
-        if(oSelf._ftEl) {\r\r
-            oSelf._ftEl.style.display = "none";\r\r
+        oSelf._elConsole.style.display = "none";\r\r
+        if(oSelf._elFt) {\r\r
+            oSelf._elFt.style.display = "none";\r\r
         }\r\r
         btn.value = "Expand";\r\r
     }\r\r
@@ -1139,12 +1141,13 @@ YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {
 /**\r\r
  * Handles click events on the pause button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickPauseBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {\r\r
-    var btn = oSelf._pauseBtn;\r\r
+    var btn = oSelf._btnPause;\r\r
     if(btn.value == "Resume") {\r\r
         oSelf.resume();\r\r
         btn.value = "Pause";\r\r
@@ -1158,8 +1161,9 @@ YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {
 /**\r\r
  * Handles click events on the clear button.\r\r
  *\r\r
- * @param {event} v The click event\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onClickClearBtn\r\r
+ * @param v {HTMLEvent} The click event.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
 YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {\r\r
@@ -1167,15 +1171,16 @@ YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {
 };\r\r
 \r\r
 /**\r\r
- * Handles Logger's onNewEvent.\r\r
+ * Handles Logger's newLogEvent.\r\r
  *\r\r
- * @param {string} type The click event\r\r
- * @param {array} args Data passed from event firer\r\r
- * @param {object} oSelf The log reader instance\r\r
+ * @method _onNewLog\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
  * @private\r\r
  */\r\r
-YAHOO.widget.LogReader.prototype._onNewLog = function(type, args, oSelf) {\r\r
-    var logEntry = args[0];\r\r
+YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {\r\r
+    var logEntry = aArgs[0];\r\r
     oSelf._buffer.push(logEntry);\r\r
 \r\r
     if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {\r\r
@@ -1183,4 +1188,372 @@ YAHOO.widget.LogReader.prototype._onNewLog = function(type, args, oSelf) {
     }\r\r
 };\r\r
 \r\r
+/**\r\r
+ * Handles Logger's resetEvent.\r\r
+ *\r\r
+ * @method _onReset\r\r
+ * @param sType {String} The event.\r\r
+ * @param aArgs {Object[]} Data passed from event firer.\r\r
+ * @param oSelf {Object} The LogReader instance.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {\r\r
+    oSelf._filterLogs();\r\r
+};\r\r
+ /**\r\r
+ * The Logger widget provides a simple way to read or write log messages in\r\r
+ * JavaScript code. Integration with the YUI Library's debug builds allow\r\r
+ * implementers to access under-the-hood events, errors, and debugging messages.\r\r
+ * Output may be read through a LogReader console and/or output to a browser\r\r
+ * console.\r\r
+ *\r\r
+ * @module logger\r\r
+ * @requires yahoo, event, dom\r\r
+ * @optional dragdrop\r\r
+ * @namespace YAHOO.widget\r\r
+ * @title Logger Widget\r\r
+ */\r\r
+\r\r
+/****************************************************************************/\r\r
+/****************************************************************************/\r\r
+/****************************************************************************/\r\r
+\r\r
+/**\r\r
+ * The singleton Logger class provides core log management functionality. Saves\r\r
+ * logs written through the global YAHOO.log function or written by a LogWriter\r\r
+ * instance. Provides access to logs for reading by a LogReader instance or\r\r
+ * native browser console such as the Firebug extension to Firefox or Safari's\r\r
+ * JavaScript console through integration with the console.log() method.\r\r
+ *\r\r
+ * @class Logger\r\r
+ * @static\r\r
+ */\r\r
+YAHOO.widget.Logger = {\r\r
+    // Initialize members\r\r
+    loggerEnabled: true,\r\r
+    _browserConsoleEnabled: false,\r\r
+    categories: ["info","warn","error","time","window"],\r\r
+    sources: ["global"],\r\r
+    _stack: [], // holds all log msgs\r\r
+    maxStackEntries: 2500,\r\r
+    _startTime: new Date().getTime(), // static start timestamp\r\r
+    _lastTime: null // timestamp of last logged message\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+/**\r\r
+ * Saves a log message to the stack and fires newLogEvent. If the log message is\r\r
+ * assigned to an unknown category, creates a new category. If the log message is\r\r
+ * from an unknown source, creates a new source.  If browser console is enabled,\r\r
+ * outputs the log message to browser console.\r\r
+ *\r\r
+ * @method log\r\r
+ * @param sMsg {String} The log message.\r\r
+ * @param sCategory {String} Category of log message, or null.\r\r
+ * @param sSource {String} Source of LogWriter, or null if global.\r\r
+ */\r\r
+YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r\r
+    if(this.loggerEnabled) {\r\r
+        if(!sCategory) {\r\r
+            sCategory = "info"; // default category\r\r
+        }\r\r
+        else {\r\r
+            sCategory = sCategory.toLocaleLowerCase();\r\r
+            if(this._isNewCategory(sCategory)) {\r\r
+                this._createNewCategory(sCategory);\r\r
+            }\r\r
+        }\r\r
+        var sClass = "global"; // default source\r\r
+        var sDetail = null;\r\r
+        if(sSource) {\r\r
+            var spaceIndex = sSource.indexOf(" ");\r\r
+            if(spaceIndex > 0) {\r\r
+                // Substring until first space\r\r
+                sClass = sSource.substring(0,spaceIndex);\r\r
+                // The rest of the source\r\r
+                sDetail = sSource.substring(spaceIndex,sSource.length);\r\r
+            }\r\r
+            else {\r\r
+                sClass = sSource;\r\r
+            }\r\r
+            if(this._isNewSource(sClass)) {\r\r
+                this._createNewSource(sClass);\r\r
+            }\r\r
+        }\r\r
+\r\r
+        var timestamp = new Date();\r\r
+        var logEntry = new YAHOO.widget.LogMsg({\r\r
+            msg: sMsg,\r\r
+            time: timestamp,\r\r
+            category: sCategory,\r\r
+            source: sClass,\r\r
+            sourceDetail: sDetail\r\r
+        });\r\r
+\r\r
+        var stack = this._stack;\r\r
+        var maxStackEntries = this.maxStackEntries;\r\r
+        if(maxStackEntries && !isNaN(maxStackEntries) &&\r\r
+            (stack.length >= maxStackEntries)) {\r\r
+            stack.shift();\r\r
+        }\r\r
+        stack.push(logEntry);\r\r
+        this.newLogEvent.fire(logEntry);\r\r
+\r\r
+        if(this._browserConsoleEnabled) {\r\r
+            this._printToBrowserConsole(logEntry);\r\r
+        }\r\r
+        return true;\r\r
+    }\r\r
+    else {\r\r
+        return false;\r\r
+    }\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r\r
+ *\r\r
+ * @method reset\r\r
+ */\r\r
+YAHOO.widget.Logger.reset = function() {\r\r
+    this._stack = [];\r\r
+    this._startTime = new Date().getTime();\r\r
+    this.loggerEnabled = true;\r\r
+    this.log("Logger reset");\r\r
+    this.logResetEvent.fire();\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Public accessor to internal stack of log message objects.\r\r
+ *\r\r
+ * @method getStack\r\r
+ * @return {Object[]} Array of log message objects.\r\r
+ */\r\r
+YAHOO.widget.Logger.getStack = function() {\r\r
+    return this._stack;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Public accessor to internal start time.\r\r
+ *\r\r
+ * @method getStartTime\r\r
+ * @return {Date} Internal date of when Logger singleton was initialized.\r\r
+ */\r\r
+YAHOO.widget.Logger.getStartTime = function() {\r\r
+    return this._startTime;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Disables output to the browser's global console.log() function, which is used\r\r
+ * by the Firebug extension to Firefox as well as Safari.\r\r
+ *\r\r
+ * @method disableBrowserConsole\r\r
+ */\r\r
+YAHOO.widget.Logger.disableBrowserConsole = function() {\r\r
+    YAHOO.log("Logger output to the function console.log() has been disabled.");\r\r
+    this._browserConsoleEnabled = false;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Enables output to the browser's global console.log() function, which is used\r\r
+ * by the Firebug extension to Firefox as well as Safari.\r\r
+ *\r\r
+ * @method enableBrowserConsole\r\r
+ */\r\r
+YAHOO.widget.Logger.enableBrowserConsole = function() {\r\r
+    this._browserConsoleEnabled = true;\r\r
+    YAHOO.log("Logger output to the function console.log() has been enabled.");\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Public events\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+ /**\r\r
+ * Fired when a new category has been created.\r\r
+ *\r\r
+ * @event categoryCreateEvent\r\r
+ * @param sCategory {String} Category name.\r\r
+ */\r\r
+YAHOO.widget.Logger.categoryCreateEvent =\r\r
+    new YAHOO.util.CustomEvent("categoryCreate", this, true);\r\r
+\r\r
+ /**\r\r
+ * Fired when a new source has been named.\r\r
+ *\r\r
+ * @event sourceCreateEvent\r\r
+ * @param sSource {String} Source name.\r\r
+ */\r\r
+YAHOO.widget.Logger.sourceCreateEvent =\r\r
+    new YAHOO.util.CustomEvent("sourceCreate", this, true);\r\r
+\r\r
+ /**\r\r
+ * Fired when a new log message has been created.\r\r
+ *\r\r
+ * @event newLogEvent\r\r
+ * @param sMsg {String} Log message.\r\r
+ */\r\r
+YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r\r
+\r\r
+/**\r\r
+ * Fired when the Logger has been reset has been created.\r\r
+ *\r\r
+ * @event logResetEvent\r\r
+ */\r\r
+YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private methods\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Creates a new category of log messages and fires categoryCreateEvent.\r\r
+ *\r\r
+ * @method _createNewCategory\r\r
+ * @param sCategory {String} Category name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._createNewCategory = function(sCategory) {\r\r
+    this.categories.push(sCategory);\r\r
+    this.categoryCreateEvent.fire(sCategory);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Checks to see if a category has already been created.\r\r
+ *\r\r
+ * @method _isNewCategory\r\r
+ * @param sCategory {String} Category name.\r\r
+ * @return {Boolean} Returns true if category is unknown, else returns false.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._isNewCategory = function(sCategory) {\r\r
+    for(var i=0; i < this.categories.length; i++) {\r\r
+        if(sCategory == this.categories[i]) {\r\r
+            return false;\r\r
+        }\r\r
+    }\r\r
+    return true;\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Creates a new source of log messages and fires sourceCreateEvent.\r\r
+ *\r\r
+ * @method _createNewSource\r\r
+ * @param sSource {String} Source name.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._createNewSource = function(sSource) {\r\r
+    this.sources.push(sSource);\r\r
+    this.sourceCreateEvent.fire(sSource);\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Checks to see if a source already exists.\r\r
+ *\r\r
+ * @method _isNewSource\r\r
+ * @param sSource {String} Source name.\r\r
+ * @return {Boolean} Returns true if source is unknown, else returns false.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._isNewSource = function(sSource) {\r\r
+    if(sSource) {\r\r
+        for(var i=0; i < this.sources.length; i++) {\r\r
+            if(sSource == this.sources[i]) {\r\r
+                return false;\r\r
+            }\r\r
+        }\r\r
+        return true;\r\r
+    }\r\r
+};\r\r
+\r\r
+/**\r\r
+ * Outputs a log message to global console.log() function.\r\r
+ *\r\r
+ * @method _printToBrowserConsole\r\r
+ * @param oEntry {Object} Log entry object.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {\r\r
+    if(window.console && console.log) {\r\r
+        var category = oEntry.category;\r\r
+        var label = oEntry.category.substring(0,4).toUpperCase();\r\r
+\r\r
+        var time = oEntry.time;\r\r
+        if (time.toLocaleTimeString) {\r\r
+            var localTime  = time.toLocaleTimeString();\r\r
+        }\r\r
+        else {\r\r
+            localTime = time.toString();\r\r
+        }\r\r
+\r\r
+        var msecs = time.getTime();\r\r
+        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r\r
+            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r\r
+        YAHOO.widget.Logger._lastTime = msecs;\r\r
+\r\r
+        var output =\r\r
+            localTime + " (" +\r\r
+            elapsedTime + "ms): " +\r\r
+            oEntry.source + ": " +\r\r
+            oEntry.msg;\r\r
+\r\r
+        console.log(output);\r\r
+    }\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Private event handlers\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+/**\r\r
+ * Handles logging of messages due to window error events.\r\r
+ *\r\r
+ * @method _onWindowError\r\r
+ * @param sMsg {String} The error message.\r\r
+ * @param sUrl {String} URL of the error.\r\r
+ * @param sLine {String} Line number of the error.\r\r
+ * @private\r\r
+ */\r\r
+YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {\r\r
+    // Logger is not in scope of this event handler\r\r
+    try {\r\r
+        YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");\r\r
+        if(YAHOO.widget.Logger._origOnWindowError) {\r\r
+            YAHOO.widget.Logger._origOnWindowError();\r\r
+        }\r\r
+    }\r\r
+    catch(e) {\r\r
+        return false;\r\r
+    }\r\r
+};\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// Enable handling of native JavaScript errors\r\r
+// NB: Not all browsers support the window.onerror event\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+if(window.onerror) {\r\r
+    // Save any previously defined handler to call\r\r
+    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r\r
+}\r\r
+window.onerror = YAHOO.widget.Logger._onWindowError;\r\r
+\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+//\r\r
+// First log\r\r
+//\r\r
+/////////////////////////////////////////////////////////////////////////////\r\r
+\r\r
+YAHOO.widget.Logger.log("Logger initialized");\r\r
 \r\r
index 846ae9526855b95cb181ca2ee24e5c01d6a14e74..8b82ff556945e8f655b787b7478bcfcd017a7dee 100755 (executable)
@@ -73,10 +73,152 @@ Fixed the following bugs:
 * Users can now control or shift-click on MenuItem links\r
 \r
 \r
-Changes\r
--------\r
+Changes:\r
+--------\r
 * In the Menu stylesheet (menu.css), switched from using "first" class to\r
   "first-of-type" class\r
 \r
 * Changed case of MenuModuleItem class's "subMenuIndicator" property \r
-  to "submenuIndicator"
\ No newline at end of file
+  to "submenuIndicator"\r
+  \r
+\r
+*** version 0.11.3 ***\r
+\r
+Added the following features:\r
+-----------------------------\r
+\r
+* Added a "target" configuration property to the MenuModuleItem object that\r
+  allows the user to specify the target of an item's anchor element.  Items \r
+  that make use of the "target" configuration property will require the user \r
+  to click exactly on the item's anchor element to navigate to the specified \r
+  URL.\r
+\r
+* Items without a "url" property set will automatically hide their parent \r
+  menu instance(s) when clicked.\r
+\r
+\r
+Fixed the following bugs:\r
+-------------------------\r
+\r
+* Items in a submenu should now navigate to their specified URL when clicked.\r
+\r
+* Removed MenuBar's use of "overflow:hidden."  This fixes an issue in Firefox\r
+  1.5 in which submenus of a Menubar instance cannot overlay other absolutely \r
+  positioned elements on the page.\r
+\r
+* Submenus of a Menubar instance will now automatically have their iframe shim\r
+  enabled in IE<7.\r
+\r
+* Statically positioned Menubar and Menu instances will now render with the \r
+  correct position and dimensions in Safari.\r
+\r
+* MenuModuleItem's "focus" method now checks to make sure that an item's \r
+  "display" style property is not "none" before trying to set focus to its\r
+  anchor element.\r
+  \r
+* A ContextMenu instance will now hide all other ContextMenu instances before\r
+  displaying itself.\r
+\r
+* Removed the dead space in front of an item's submenu indicator image in IE.  \r
+  This space was causing an item's submenu to flicker when the user hovered \r
+  over it.\r
+\r
+\r
+Changes:\r
+--------\r
+\r
+* Moved the DOM event handlers for every menu from the root DIV node of each \r
+  instance to the document object.  This change reduces the number of DOM event \r
+  handlers used by Menu to eight, improving the cleanup time required by the \r
+  Event utility.\r
+  \r
+  \r
+*** version 0.12 ***\r
+\r
+Added the following features:\r
+-----------------------------\r
+\r
+* Added the YAHOO.widget.MenuManager singleton class.\r
+\r
+* Added two new methods to YAHOO.widget.Menu:\r
+\r
+    * "addItems" - Adds an array of items to a menu.\r
+\r
+    * "getRoot" - Returns the root menu in a menu hierarchy.\r
+\r
+* Added two new events to YAHOO.widget.Menu:\r
+\r
+    * "itemAddedEvent" - Fires when an item is added to a menu.\r
+\r
+    * "itemRemovedEvent" - Fires when an item is removed from a menu.\r
+\r
+* Added two new properties to YAHOO.widget.Menu:\r
+\r
+    * "itemData" - Array of items to be added to the menu.\r
+\r
+    * "lazyLoad" - Boolean indicating if the menu's "lazy load" feature \r
+      is enabled.\r
+\r
+* Added new configuration properties to YAHOO.widget.Menu:\r
+\r
+    * "hidedelay" - Hides the menu after the specified number of milliseconds.  \r
+\r
+    * "showdelay" - Shows the menu after the specified number of milliseconds.  \r
+\r
+    * "container" - The containing element the menu should be rendered into.  \r
+\r
+    * "clicktohide" - Boolean indicating if the menu will automatically be \r
+      hidden if the user clicks outside of it.\r
+\r
+    * "autosubmenudisplay" - Boolean indicating if submenus are automatically \r
+      made visible when the user mouses over the menu's items.\r
+\r
+* Added a "toString" method to YAHOO.widget.MenuItem, YAHOO.widget.MenuBarItem \r
+  and YAHOO.widget.ContextMenuItem that returns the class name followed by the \r
+  value of the item's "text" configuration property.\r
+\r
+\r
+Fixed the following bugs:\r
+-------------------------\r
+\r
+* Setting a YAHOO.widget.ContextMenu instance's "trigger" configuration \r
+  property will remove all previous triggers before setting up the new ones.\r
+\r
+* "destroy" method of YAHOO.widget.ContextMenu cleans up all DOM event handlers.\r
+\r
+* Clicking on a menu item with a submenu no longer hides/collapses the \r
+  entire menu.\r
+\r
+* Clicking an item's submenu indicator image no longer collapses the \r
+  entire menu.\r
+  \r
+  \r
+Changes:\r
+--------\r
+\r
+* Deprecated the YAHOO.widget.MenuModule and YAHOO.widget.MenuModuleItem \r
+  classes.  The Base classes are now YAHOO.widget.Menu and \r
+  YAHOO.widget.MenuItem.\r
+\r
+* "addItem" and "insertItem" methods of YAHOO.widget.Menu now accept an \r
+  object literal representing YAHOO.widget.MenuItem configuration properties.\r
+\r
+* "clearActiveItem" now takes an argument: flag indicating if the Menu \r
+  instance's active item should be blurred.\r
+\r
+* Switched the default value of the "visible" configuration property for \r
+  YAHOO.widget.Menu to "false."\r
+\r
+* Switched the default value of the "constraintoviewport" configuration \r
+  property for YAHOO.widget.Menu to "true."\r
+\r
+* Overloaded the "submenu" configuration property for YAHOO.widget.MenuItem\r
+  so that it now can accept any of the following:\r
+\r
+    * YAHOO.widget.Menu instance\r
+    * Object literal representation of a menu\r
+    * Element id\r
+    * Element reference\r
+\r
+* "hide" and "show" methods of statically positioned menus now toggle the their\r
+  element's "display" style property between "block" and "none."
\ No newline at end of file
index c73ef77d5a2a0c8daafb8b53b2bf8eb2530ebf0f..66490a347e12ce6662863f4ff573194ccba8348a 100755 (executable)
@@ -1,23 +1,31 @@
 /*\r
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+http://developer.yahoo.com/yui/license.txt\r
+Version: 0.12\r
 */\r
 \r
 \r
+\r
 /* Menu styles */\r
 \r
 div.yuimenu {\r
 \r
-    z-index:1;\r
-    visibility:hidden;\r
     background-color:#f6f7ee;\r
     border:solid 1px #c4c4be;\r
     padding:1px;\r
     \r
 }\r
 \r
+/* Submenus are positioned absolute and hidden by default */\r
+\r
+div.yuimenu div.yuimenu,\r
+div.yuimenubar div.yuimenu {\r
+\r
+    position:absolute;\r
+    visibility:hidden;\r
+\r
+}\r
 \r
 /* MenuBar Styles */\r
 \r
@@ -28,12 +36,12 @@ div.yuimenubar {
 }\r
 \r
 /*\r
-    Application of "zoom:1" triggers "haslayout" in IE so that the module's\r
+    Applying a width triggers "haslayout" in IE so that the module's\r
     body clears its floated elements\r
 */\r
 div.yuimenubar div.bd {\r
 \r
-    zoom:1;\r
+    width:100%;\r
 \r
 }\r
 \r
@@ -90,7 +98,6 @@ div.yuimenubar ul {
     list-style-type:none;\r
     margin:0;\r
     padding:0;\r
-    overflow:hidden;\r
 \r
 }\r
 \r
@@ -263,7 +270,8 @@ div.yuimenu li.yuimenuitem img {
 \r
     height:8px;\r
     width:8px;\r
-    margin:0 -16px 0 10px;\r
+    margin:0 -16px 0 0;\r
+    padding-left:10px;\r
     border:0;\r
 \r
 }\r
@@ -279,10 +287,11 @@ div.yuimenu li.checked img.checked {
     height:8px;\r
     width:8px;\r
     margin:0;\r
+    padding:0;\r
     border:0;\r
     position:absolute;\r
     left:6px;\r
-    _left:-16px; /* Underscore hack b/c this is for IE 5.5 and IE 6 only */\r
+    _left:-16px; /* Underscore hack b/c this is for IE 6 only */\r
     top:.5em;\r
     \r
 }
\ No newline at end of file
index d7e0f1b763ebc997d85fe37fc1e1312b5ebb1195..86776ac76172f3c5cccffcc83445531304643c4c 100755 (executable)
 /*\r
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+http://developer.yahoo.com/yui/license.txt\r
+version: 0.12.0\r
 */\r
 \r
+/**\r
+* @module menu\r
+* @description <p>The Menu Library features a collection of widgets that make\r
+* it easy to add menus to your website or web application.  With the Menu\r
+* Library you can create website fly-out menus, customized context menus, or\r
+* application-style menu bars with just a small amount of scripting.</p>\r
+* <ul>\r
+*    <li>Screen-reader accessibility.</li>\r
+*    <li>Keyboard and mouse navigation.</li>\r
+*    <li>A rich event model that provides access to all of a menu's\r
+*    interesting moments.</li>\r
+*    <li>Support for\r
+*    <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive\r
+*    Enhancement</a>; Menus can be created from simple,\r
+*    semantic markup on the page or purely through JavaScript.</li>\r
+* </ul>\r
+* @title Menu Library\r
+* @namespace YAHOO.widget\r
+* @requires Event, Dom, Container\r
+*/\r
+(function() {\r
+\r
+var Dom = YAHOO.util.Dom;\r
+var Event = YAHOO.util.Event;\r
 \r
 /**\r
-* @class The superclass of all menu containers.\r
-* @constructor\r
-* @extends YAHOO.widget.Overlay\r
-* @base YAHOO.widget.Overlay\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuModule instance. See \r
-* configuration class documentation for more details.\r
+* Singleton that manages a collection of all menus and menu items.  Listens for\r
+* DOM events at the document level and dispatches the events to the\r
+* corresponding menu or menu item.\r
+*\r
+* @namespace YAHOO.widget\r
+* @class MenuManager\r
+* @static\r
 */\r
-YAHOO.widget.MenuModule = function(p_oElement, p_oConfig) {\r
+YAHOO.widget.MenuManager = new function() {\r
 \r
-    YAHOO.widget.MenuModule.superclass.constructor.call(\r
-        this, \r
-        p_oElement, \r
-        p_oConfig\r
-    );\r
+    // Private member variables\r
 \r
-};\r
 \r
-YAHOO.extend(YAHOO.widget.MenuModule, YAHOO.widget.Overlay);\r
+    // Flag indicating if the DOM event handlers have been attached\r
 \r
+    var m_bInitializedEventHandlers = false;\r
 \r
-// Constants\r
 \r
-/**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLDivElement of the MenuModule instance.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuModule.prototype.CSS_CLASS_NAME = "yuimenu";\r
+    // Collection of menus\r
 \r
+    var m_oMenus = {};\r
 \r
-/**\r
-* Constant representing the type of item to instantiate and add when parsing \r
-* the child nodes (either HTMLLIElement, HTMLOptGroupElement or \r
-* HTMLOptionElement) of a menu's DOM.  The default \r
-* is YAHOO.widget.MenuModuleItem.\r
-* @final\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype.ITEM_TYPE = null;\r
 \r
+    //  Collection of menu items\r
 \r
-/**\r
-* Constant representing the tagname of the HTMLElement used to title \r
-* a group of items.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuModule.prototype.GROUP_TITLE_TAG_NAME = "H6";\r
+    var m_oItems = {};\r
 \r
 \r
-// Private properties\r
+    // Collection of visible menus\r
 \r
-/**\r
-* Array of HTMLElements used to title groups of items.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aGroupTitleElements = null;\r
+    var m_oVisibleMenus = {};\r
 \r
 \r
-/**\r
-* Multi-dimensional array of items.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aItemGroups = null;\r
+    // Logger\r
 \r
+    var m_oLogger = new YAHOO.widget.LogWriter(this.toString());\r
 \r
-/**\r
-* An array of HTMLUListElements, each of which is the parent node of each \r
-* items's HTMLLIElement node.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aListElements = null;\r
 \r
 \r
-/**\r
-* Reference to the Event utility singleton.\r
-* @private\r
-* @type {YAHOO.util.Event}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oEventUtil = YAHOO.util.Event;\r
+    // Private methods\r
 \r
 \r
-/**\r
-* Reference to the Dom utility singleton.\r
-* @private\r
-* @type {YAHOO.util.Dom}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oDom = YAHOO.util.Dom;\r
+    /**\r
+    * Adds an item to the collection of known menu items.\r
+    * @private\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
+    * instance to be added.\r
+    */\r
+    var addItem = function(p_oItem) {\r
 \r
+        var sYUIId = Dom.generateId();\r
 \r
-/**\r
-* Reference to the item the mouse is currently over.\r
-* @private\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oCurrentItem = null;\r
+        if(p_oItem && m_oItems[sYUIId] != p_oItem) {\r
 \r
+            p_oItem.element.setAttribute("yuiid", sYUIId);\r
 \r
-/** \r
-* The current state of a MenuModule instance's "mouseover" event\r
-* @private\r
-* @type {Boolean}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._bFiredMouseOverEvent = false;\r
+            m_oItems[sYUIId] = p_oItem;\r
 \r
+            p_oItem.destroyEvent.subscribe(onItemDestroy, p_oItem);\r
 \r
-/** \r
-* The current state of a MenuModule instance's "mouseout" event\r
-* @private\r
-* @type {Boolean}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._bFiredMouseOutEvent = false;\r
+            m_oLogger.log("Item: " +\r
+                p_oItem.toString() + " successfully registered.");\r
 \r
+        }\r
 \r
-// Public properties\r
+    };\r
 \r
-/**\r
-* Reference to the item that has focus.\r
-* @private\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.activeItem = null;\r
 \r
+    /**\r
+    * Removes an item from the collection of known menu items.\r
+    * @private\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
+    * instance to be removed.\r
+    */\r
+    var removeItem = function(p_oItem) {\r
 \r
-/**\r
-* Returns a MenuModule instance's parent object.\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.parent = null;\r
+        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
 \r
+        if(sYUIId && m_oItems[sYUIId]) {\r
 \r
-/**\r
-* Returns the HTMLElement (either HTMLSelectElement or HTMLDivElement)\r
-* used create the MenuModule instance.\r
-* @type {HTMLSelectElement/HTMLDivElement}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.srcElement = null;\r
+            delete m_oItems[sYUIId];\r
 \r
+            m_oLogger.log("Item: " +\r
+                p_oItem.toString() + " successfully unregistered.");\r
 \r
-// Events\r
+        }\r
 \r
-/**\r
-* Fires when the mouse has entered a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseOverEvent = null;\r
+    };\r
 \r
 \r
-/**\r
-* Fires when the mouse has left a MenuModule instance.  Passes back the DOM \r
-* Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseOutEvent = null;\r
+    /**\r
+    * Finds the root DIV node of a menu or the root LI node of a menu item.\r
+    * @private\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying\r
+    * an HTML element.\r
+    */\r
+    var getMenuRootElement = function(p_oElement) {\r
 \r
+        var oParentNode;\r
 \r
-/**\r
-* Fires when the user mouses down on a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseDownEvent = null;\r
+        if(p_oElement && p_oElement.tagName) {\r
 \r
+            switch(p_oElement.tagName.toUpperCase()) {\r
 \r
-/**\r
-* Fires when the user releases a mouse button while the mouse is over \r
-* a MenuModule instance.  Passes back the DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseUpEvent = null;\r
+                case "DIV":\r
 \r
+                    oParentNode = p_oElement.parentNode;\r
 \r
-/**\r
-* Fires when the user clicks the on a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.clickEvent = null;\r
+                    // Check if the DIV is the inner "body" node of a menu\r
 \r
+                    if(\r
+                        Dom.hasClass(p_oElement, "bd") &&\r
+                        oParentNode &&\r
+                        oParentNode.tagName &&\r
+                        oParentNode.tagName.toUpperCase() == "DIV"\r
+                    ) {\r
 \r
-/**\r
-* Fires when the user presses an alphanumeric key.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyPressEvent = null;\r
+                        return oParentNode;\r
 \r
+                    }\r
+                    else {\r
 \r
-/**\r
-* Fires when the user presses a key.  Passes back the DOM Event \r
-* object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyDownEvent = null;\r
+                        return p_oElement;\r
 \r
+                    }\r
 \r
-/**\r
-* Fires when the user releases a key.  Passes back the DOM Event \r
-* object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyUpEvent = null;\r
+                break;\r
 \r
+                case "LI":\r
 \r
-/**\r
-* The MenuModule class's initialization method. This method is automatically \r
-* called  by the constructor, and sets up all DOM references for \r
-* pre-existing markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuModule instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.init = function(p_oElement, p_oConfig) {\r
+                    return p_oElement;\r
 \r
-    var Dom = this._oDom;\r
-    var Event = this._oEventUtil;\r
+                default:\r
 \r
+                    oParentNode = p_oElement.parentNode;\r
 \r
-    if(!this.ITEM_TYPE) {\r
+                    if(oParentNode) {\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.MenuModuleItem;\r
+                        return getMenuRootElement(oParentNode);\r
 \r
-    }\r
+                    }\r
 \r
+                break;\r
 \r
-    this._aItemGroups = [];\r
-    this._aListElements = [];\r
-    this._aGroupTitleElements = [];\r
+            }\r
 \r
+        }\r
 \r
-    var oElement;\r
+    };\r
 \r
-    if(typeof p_oElement == "string") {\r
 \r
-        oElement = document.getElementById(p_oElement);\r
 \r
-    }\r
-    else if(p_oElement.tagName) {\r
+    // Private event handlers\r
 \r
-        oElement = p_oElement;\r
 \r
-    }\r
+    /**\r
+    * Generic, global event handler for all of a menu's DOM-based\r
+    * events.  This listens for events against the document object.  If the\r
+    * target of a given event is a member of a menu or menu item's DOM, the\r
+    * instance's corresponding Custom Event is fired.\r
+    * @private\r
+    * @param {Event} p_oEvent Object representing the DOM event object passed\r
+    * back by the event utility (YAHOO.util.Event).\r
+    */\r
+    var onDOMEvent = function(p_oEvent) {\r
 \r
+        // Get the target node of the DOM event\r
 \r
-    if(oElement) {\r
+        var oTarget = Event.getTarget(p_oEvent);\r
 \r
-        switch(oElement.tagName) {\r
-    \r
-            case "DIV":\r
 \r
-                this.srcElement = oElement;\r
+        // See if the target of the event was a menu, or a menu item\r
 \r
-                /* \r
-                    Note: we don't pass the user config in here yet \r
-                    because we only want it executed once, at the lowest \r
-                    subclass level.\r
-                */ \r
-            \r
-                YAHOO.widget.MenuModule.superclass.init.call(this, oElement);\r
+        var oElement = getMenuRootElement(oTarget);\r
 \r
-                this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+        var oMenuItem;\r
+        var oMenu;\r
 \r
 \r
-                /*\r
-                    Populate the collection of item groups and item\r
-                    group titles\r
-                */\r
+        if(oElement) {\r
 \r
-                var oNode = this.body.firstChild;\r
-                var i = 0;\r
+            var sTagName = oElement.tagName.toUpperCase();\r
 \r
-                do {\r
+            if(sTagName == "LI") {\r
 \r
-                    switch(oNode.tagName) {\r
+                var sYUIId = oElement.getAttribute("yuiid");\r
 \r
-                        case this.GROUP_TITLE_TAG_NAME:\r
-                        \r
-                            this._aGroupTitleElements[i] = oNode;\r
+                if(sYUIId) {\r
 \r
-                        break;\r
+                    oMenuItem = m_oItems[sYUIId];\r
+                    oMenu = oMenuItem.parent;\r
 \r
-                        case "UL":\r
+                }\r
 \r
-                            this._aListElements[i] = oNode;\r
-                            this._aItemGroups[i] = [];\r
-                            i++;\r
+            }\r
+            else if(sTagName == "DIV") {\r
 \r
-                        break;\r
+                if(oElement.id) {\r
 \r
-                    }\r
+                    oMenu = m_oMenus[oElement.id];\r
 \r
                 }\r
-                while((oNode = oNode.nextSibling));\r
 \r
+            }\r
 \r
-                /*\r
-                    Apply the "first-of-type" class to the first UL to mimic \r
-                    the "first-of-type" CSS3 psuedo class.\r
-                */\r
+        }\r
 \r
-                if(this._aListElements[0]) {\r
+        if(oMenu) {\r
 \r
-                    Dom.addClass(this._aListElements[0], "first-of-type");\r
+            // Map of DOM event names to CustomEvent names\r
 \r
-                }\r
+            var oEventTypes =  {\r
+                    "click": "clickEvent",\r
+                    "mousedown": "mouseDownEvent",\r
+                    "mouseup": "mouseUpEvent",\r
+                    "mouseover": "mouseOverEvent",\r
+                    "mouseout": "mouseOutEvent",\r
+                    "keydown": "keyDownEvent",\r
+                    "keyup": "keyUpEvent",\r
+                    "keypress": "keyPressEvent"\r
+                };\r
 \r
-                this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+            var sCustomEventType = oEventTypes[p_oEvent.type];\r
 \r
-                this.logger.log("Source element: " + this.srcElement.tagName);\r
-    \r
-            break;\r
-    \r
-            case "SELECT":\r
-    \r
-                this.srcElement = oElement;\r
-    \r
-    \r
-                /*\r
-                    The source element is not something that we can use \r
-                    outright, so we need to create a new Overlay\r
-                */\r
-    \r
-                var sId = Dom.generateId();\r
 \r
-                /* \r
-                    Note: we don't pass the user config in here yet \r
-                    because we only want it executed once, at the lowest \r
-                    subclass level.\r
-                */ \r
-            \r
-                YAHOO.widget.MenuModule.superclass.init.call(this, sId); \r
+            // Fire the Custom Even that corresponds the current DOM event\r
 \r
-                this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+            if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {\r
 \r
-                this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+                oMenuItem[sCustomEventType].fire(p_oEvent);\r
 \r
-                this.logger.log("Source element: " + this.srcElement.tagName);\r
+            }\r
+\r
+            oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);\r
 \r
-            break;\r
-    \r
         }\r
+        else if(p_oEvent.type == "mousedown") {\r
 \r
-    }\r
-    else {\r
 \r
-        /* \r
-            Note: we don't pass the user config in here yet \r
-            because we only want it executed once, at the lowest \r
-            subclass level.\r
-        */ \r
-    \r
-        YAHOO.widget.MenuModule.superclass.init.call(this, p_oElement);\r
+            /*\r
+                If the target of the event wasn't a menu, hide all\r
+                dynamically positioned menus\r
+            */\r
 \r
-        this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+            var oActiveItem;\r
 \r
-        this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+            for(var i in m_oMenus) {\r
 \r
-        this.logger.log("No source element found.  " +\r
-            "Created element with id: " + this.id);\r
+                if(m_oMenus.hasOwnProperty(i)) {\r
 \r
-    }\r
+                    oMenu = m_oMenus[i];\r
+\r
+                    if(\r
+                        oMenu.cfg.getProperty("clicktohide") &&\r
+                        oMenu.cfg.getProperty("position") == "dynamic"\r
+                    ) {\r
 \r
+                        oMenu.hide();\r
 \r
-    if(this.element) {\r
+                    }\r
+                    else {\r
 \r
-        var oEl = this.element;\r
-        var CustomEvent = YAHOO.util.CustomEvent;\r
+                        oMenu.clearActiveItem(true);\r
 \r
-        Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
+                    }\r
 \r
-        // Assign DOM event handlers\r
+                }\r
 \r
-        Event.addListener(\r
-                oEl, \r
-                "mouseover", \r
-                this._onElementMouseOver, \r
-                this, \r
-                true\r
-            );\r
+            }\r
+\r
+        }\r
+\r
+    };\r
 \r
-        Event.addListener(oEl, "mouseout", this._onElementMouseOut, this, true);\r
-        Event.addListener(oEl, "mousedown", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "mouseup", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "click", this._onElementClick, this, true);\r
-        Event.addListener(oEl, "keydown", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "keyup", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "keypress", this._onDOMEvent, this, true);\r
 \r
+    /**\r
+    * "destroy" event handler for a menu.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+    * fired the event.\r
+    */\r
+    var onMenuDestroy = function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-        // Create custom events\r
+        this.removeMenu(p_oMenu);\r
 \r
-        this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
-        this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
-        this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
-        this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
-        this.clickEvent = new CustomEvent("clickEvent", this);\r
-        this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
-        this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
-        this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
+    };\r
 \r
 \r
-        // Subscribe to Custom Events\r
+    /**\r
+    * "destroy" event handler for a MenuItem instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    var onItemDestroy = function(p_sType, p_aArgs, p_oItem) {\r
 \r
-        this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
-        this.renderEvent.subscribe(this._onRender, this, true);\r
-        this.showEvent.subscribe(this._onShow, this, true);\r
-        this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
+        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
 \r
+        if(sYUIId) {\r
+\r
+            delete m_oItems[sYUIId];\r
 \r
-        if(p_oConfig) {\r
-    \r
-            this.cfg.applyConfig(p_oConfig, true);\r
-    \r
         }\r
 \r
+    };\r
+\r
 \r
-        this.cfg.queueProperty("visible", false);\r
+    /**\r
+    * Event handler for when the "visible" configuration property\r
+    * of a Menu instance changes.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+    * fired the event.\r
+    */\r
+    var onMenuVisibleConfigChange = function(p_sType, p_aArgs, p_oMenu) {\r
 \r
+        var bVisible = p_aArgs[0];\r
 \r
-        if(this.srcElement) {\r
+        if(bVisible) {\r
 \r
-            this._initSubTree();\r
+            m_oVisibleMenus[p_oMenu.id] = p_oMenu;\r
+\r
+            m_oLogger.log("Menu: " +\r
+                p_oMenu.toString() +\r
+                " registered with the collection of visible menus.");\r
 \r
         }\r
+        else if(m_oVisibleMenus[p_oMenu.id]) {\r
 \r
-    }\r
+            delete m_oVisibleMenus[p_oMenu.id];\r
 \r
+            m_oLogger.log("Menu: " +\r
+                p_oMenu.toString() +\r
+                " unregistered from the collection of visible menus.");\r
 \r
-    this.initEvent.fire(YAHOO.widget.MenuModule);\r
+        }\r
 \r
-};\r
+    };\r
 \r
 \r
-// Private methods\r
+    /**\r
+    * "itemadded" event handler for a Menu instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    */\r
+    var onItemAdded = function(p_sType, p_aArgs) {\r
 \r
-/**\r
-* Iterates the source element's childNodes collection and uses the child \r
-* nodes to instantiate MenuModule and MenuModuleItem instances.\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._initSubTree = function() {\r
+        addItem(p_aArgs[0]);\r
 \r
-    var oNode;\r
+    };\r
 \r
-    this.logger.log("Searching DOM for items to initialize.");\r
 \r
-    switch(this.srcElement.tagName) {\r
+    /**\r
+    * "itemremoved" event handler for a Menu instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    */\r
+    var onItemRemoved = function(p_sType, p_aArgs) {\r
 \r
-        case "DIV":\r
+        removeItem(p_aArgs[0]);\r
 \r
-            if(this._aListElements.length > 0) {\r
+    };\r
 \r
-                this.logger.log("Found " + \r
-                    this._aListElements.length + " item groups to initialize.");\r
 \r
-                var i = this._aListElements.length - 1;\r
 \r
-                do {\r
+    // Privileged methods\r
 \r
-                    oNode = this._aListElements[i].firstChild;\r
-    \r
-                    this.logger.log("Scanning " + \r
-                        this._aListElements[i].childNodes.length + \r
-                        " child nodes for items to initialize.");\r
 \r
-                    do {\r
-    \r
-                        switch(oNode.tagName) {\r
-        \r
-                            case "LI":\r
+    /**\r
+    * @method addMenu\r
+    * @description Adds a menu to the collection of known menus.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
+    * to be added.\r
+    */\r
+    this.addMenu = function(p_oMenu) {\r
 \r
-                                this.logger.log("Initializing " + \r
-                                    oNode.tagName + " node.");\r
+        if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
 \r
-                                this.addItem(new this.ITEM_TYPE(oNode), i);\r
-        \r
-                            break;\r
-        \r
-                        }\r
-            \r
-                    }\r
-                    while((oNode = oNode.nextSibling));\r
-            \r
-                }\r
-                while(i--);\r
+            m_oMenus[p_oMenu.id] = p_oMenu;\r
 \r
-            }\r
 \r
-        break;\r
+            if(!m_bInitializedEventHandlers) {\r
 \r
-        case "SELECT":\r
+                var oDoc = document;\r
 \r
-            this.logger.log("Scanning " +  this.srcElement.childNodes.length + \r
-                " child nodes for items to initialize.");\r
+                Event.addListener(oDoc, "mouseover", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mouseout", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mousedown", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mouseup", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "click", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keydown", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keyup", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keypress", onDOMEvent, this, true);\r
 \r
-            oNode = this.srcElement.firstChild;\r
+                m_bInitializedEventHandlers = true;\r
 \r
-            do {\r
+                m_oLogger.log("DOM event handlers initialized.");\r
 \r
-                switch(oNode.tagName) {\r
+            }\r
 \r
-                    case "OPTGROUP":\r
-                    case "OPTION":\r
+            p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this);\r
 \r
-                        this.logger.log("Initializing " +  \r
-                            oNode.tagName + " node.");\r
+            p_oMenu.cfg.subscribeToConfigEvent(\r
+                "visible",\r
+                onMenuVisibleConfigChange,\r
+                p_oMenu\r
+            );\r
 \r
-                        this.addItem(new this.ITEM_TYPE(oNode));\r
+            p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
+            p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
 \r
-                    break;\r
+            m_oLogger.log("Menu: " +\r
+                p_oMenu.toString() + " successfully registered.");\r
 \r
-                }\r
+        }\r
 \r
-            }\r
-            while((oNode = oNode.nextSibling));\r
+    };\r
 \r
-        break;\r
 \r
-    }\r
+    /**\r
+    * @method removeMenu\r
+    * @description Removes a menu from the collection of known menus.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
+    * to be removed.\r
+    */\r
+    this.removeMenu = function(p_oMenu) {\r
 \r
-};\r
+        if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
 \r
+            delete m_oMenus[p_oMenu.id];\r
 \r
-/**\r
-* Returns the first enabled item in a menu instance.\r
-* @return Returns a MenuModuleItem instance.\r
-* @type YAHOO.widget.MenuModuleItem\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._getFirstEnabledItem = function() {\r
+            m_oLogger.log("Menu: " +\r
+                p_oMenu.toString() + " successfully unregistered.");\r
 \r
-    var nGroups = this._aItemGroups.length;\r
-    var oItem;\r
-    var aItemGroup;\r
+        }\r
 \r
-    for(var i=0; i<nGroups; i++) {\r
+    };\r
 \r
-        aItemGroup = this._aItemGroups[i];\r
-        \r
-        if(aItemGroup) {\r
 \r
-            var nItems = aItemGroup.length;\r
-            \r
-            for(var n=0; n<nItems; n++) {\r
-            \r
+    /**\r
+    * @method hideVisible\r
+    * @description Hides all visible, dynamically positioned menus.\r
+    */\r
+    this.hideVisible = function() {\r
+\r
+        var oMenu;\r
+\r
+        for(var i in m_oVisibleMenus) {\r
+\r
+            if(m_oVisibleMenus.hasOwnProperty(i)) {\r
+\r
+                oMenu = m_oVisibleMenus[i];\r
+\r
+                if(oMenu.cfg.getProperty("position") == "dynamic") {\r
+\r
+                    oMenu.hide();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+    };\r
+\r
+\r
+    /**\r
+    * @method getMenus\r
+    * @description Returns an array of all menus registered with the\r
+    * menu manger.\r
+    * @return {Array}\r
+    */\r
+    this.getMenus = function() {\r
+\r
+        return m_oMenus;\r
+\r
+    };\r
+\r
+\r
+    /**\r
+    * @method getMenu\r
+    * @description Returns a menu with the specified id.\r
+    * @param {String} p_sId String specifying the id of the menu to\r
+    * be retrieved.\r
+    * @return {YAHOO.widget.Menu}\r
+    */\r
+    this.getMenu = function(p_sId) {\r
+\r
+        if(m_oMenus[p_sId]) {\r
+\r
+            return m_oMenus[p_sId];\r
+\r
+        }\r
+\r
+    };\r
+\r
+\r
+    /**\r
+    * @method toString\r
+    * @description Returns a string representing the menu manager.\r
+    * @return {String}\r
+    */\r
+    this.toString = function() {\r
+\r
+        return ("MenuManager");\r
+\r
+    };\r
+\r
+};\r
+\r
+})();\r
+\r
+\r
+(function() {\r
+\r
+var Dom = YAHOO.util.Dom;\r
+var Event = YAHOO.util.Event;\r
+\r
+\r
+/**\r
+* The Menu class creates a container that holds a vertical list representing\r
+* a set of options or commands.  Menu is the base class for all\r
+* menu containers.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source\r
+* for the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
+* Object specifying the <code>&#60;select&#62;</code> element to be used as\r
+* the data source for the menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu. See configuration class documentation for\r
+* more details.\r
+* @namespace YAHOO.widget\r
+* @class Menu\r
+* @constructor\r
+* @extends YAHOO.widget.Overlay\r
+*/\r
+YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
+\r
+    if(p_oConfig) {\r
+\r
+        this.parent = p_oConfig.parent;\r
+\r
+        this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r
+\r
+        this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r
+\r
+    }\r
+\r
+\r
+    YAHOO.widget.Menu.superclass.constructor.call(\r
+        this,\r
+        p_oElement,\r
+        p_oConfig\r
+    );\r
+\r
+};\r
+\r
+YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r
+\r
+\r
+\r
+// Constants\r
+\r
+\r
+/**\r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the\r
+* menu's <code>&#60;div&#62;</code> element.\r
+* @default "yuimenu"\r
+* @final\r
+* @type String\r
+*/\r
+CSS_CLASS_NAME: "yuimenu",\r
+\r
+\r
+/**\r
+* @property ITEM_TYPE\r
+* @description Object representing the type of menu item to instantiate and\r
+* add when parsing the child nodes (either <code>&#60;li&#62;</code> element,\r
+* <code>&#60;optgroup&#62;</code> element or <code>&#60;option&#62;</code>)\r
+* of the menu's source HTML element.\r
+* @default YAHOO.widget.MenuItem\r
+* @final\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+ITEM_TYPE: null,\r
+\r
+\r
+/**\r
+* @property GROUP_TITLE_TAG_NAME\r
+* @description String representing the tagname of the HTML element used to\r
+* title the menu's item groups.\r
+* @default H6\r
+* @final\r
+* @type String\r
+*/\r
+GROUP_TITLE_TAG_NAME: "h6",\r
+\r
+\r
+\r
+// Private properties\r
+\r
+\r
+/**\r
+* @property _nHideDelayId\r
+* @description Number representing the time-out setting used to cancel the\r
+* hiding of a menu.\r
+* @default null\r
+* @private\r
+* @type Number\r
+*/\r
+_nHideDelayId: null,\r
+\r
+\r
+/**\r
+* @property _nShowDelayId\r
+* @description Number representing the time-out setting used to cancel the\r
+* showing of a menu.\r
+* @default null\r
+* @private\r
+* @type Number\r
+*/\r
+_nShowDelayId: null,\r
+\r
+\r
+/**\r
+* @property _hideDelayEventHandlersAssigned\r
+* @description Boolean indicating if the "mouseover" and "mouseout" event\r
+* handlers used for hiding the menu via a call to "window.setTimeout" have\r
+* already been assigned.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_hideDelayEventHandlersAssigned: false,\r
+\r
+\r
+/**\r
+* @property _bHandledMouseOverEvent\r
+* @description Boolean indicating the current state of the menu's\r
+* "mouseover" event.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_bHandledMouseOverEvent: false,\r
+\r
+\r
+/**\r
+* @property _bHandledMouseOutEvent\r
+* @description Boolean indicating the current state of the menu's\r
+* "mouseout" event.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_bHandledMouseOutEvent: false,\r
+\r
+\r
+/**\r
+* @property _aGroupTitleElements\r
+* @description Array of HTML element used to title groups of menu items.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aGroupTitleElements: null,\r
+\r
+\r
+/**\r
+* @property _aItemGroups\r
+* @description Array of menu items.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aItemGroups: null,\r
+\r
+\r
+/**\r
+* @property _aListElements\r
+* @description Array of <code>&#60;ul&#62;</code> elements, each of which is\r
+* the parent node for each item's <code>&#60;li&#62;</code> element.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aListElements: null,\r
+\r
+\r
+\r
+// Public properties\r
+\r
+\r
+/**\r
+* @property lazyLoad\r
+* @description Boolean indicating if the menu's "lazy load" feature is\r
+* enabled.  If set to "true," initialization and rendering of the menu's\r
+* items will be deferred until the first time it is made visible.  This\r
+* property should be set via the constructor using the configuration\r
+* object literal.\r
+* @default false\r
+* @type Boolean\r
+*/\r
+lazyLoad: false,\r
+\r
+\r
+/**\r
+* @property itemData\r
+* @description Array of items to be added to the menu.  The array can contain\r
+* strings representing the text for each item to be created, object literals\r
+* representing the menu item configuration properties, or MenuItem instances.\r
+* This property should be set via the constructor using the configuration\r
+* object literal.\r
+* @default null\r
+* @type Array\r
+*/\r
+itemData: null,\r
+\r
+\r
+/**\r
+* @property activeItem\r
+* @description Object reference to the item in the menu that has focus.\r
+* @default null\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+activeItem: null,\r
+\r
+\r
+/**\r
+* @property parent\r
+* @description Object reference to the menu's parent menu or menu item.\r
+* This property can be set via the constructor using the configuration\r
+* object literal.\r
+* @default null\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+parent: null,\r
+\r
+\r
+/**\r
+* @property srcElement\r
+* @description Object reference to the HTML element (either\r
+* <code>&#60;select&#62;</code> or <code>&#60;div&#62;</code>) used to\r
+* create the menu.\r
+* @default null\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r
+* html#ID-22445964">HTMLDivElement</a>\r
+*/\r
+srcElement: null,\r
+\r
+\r
+\r
+// Events\r
+\r
+\r
+/**\r
+* @event mouseOverEvent\r
+* @description Fires when the mouse has entered the menu.  Passes back\r
+* the DOM Event object as an argument.\r
+*/\r
+mouseOverEvent: null,\r
+\r
+\r
+/**\r
+* @event mouseOutEvent\r
+* @description Fires when the mouse has left the menu.  Passes back the DOM\r
+* Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseOutEvent: null,\r
+\r
+\r
+/**\r
+* @event mouseDownEvent\r
+* @description Fires when the user mouses down on the menu.  Passes back the\r
+* DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseDownEvent: null,\r
+\r
+\r
+/**\r
+* @event mouseUpEvent\r
+* @description Fires when the user releases a mouse button while the mouse is\r
+* over the menu.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseUpEvent: null,\r
+\r
+\r
+/**\r
+* @event clickEvent\r
+* @description Fires when the user clicks the on the menu.  Passes back the\r
+* DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+clickEvent: null,\r
+\r
+\r
+/**\r
+* @event keyPressEvent\r
+* @description Fires when the user presses an alphanumeric key when one of the\r
+* menu's items has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyPressEvent: null,\r
+\r
+\r
+/**\r
+* @event keyDownEvent\r
+* @description Fires when the user presses a key when one of the menu's items\r
+* has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyDownEvent: null,\r
+\r
+\r
+/**\r
+* @event keyUpEvent\r
+* @description Fires when the user releases a key when one of the menu's items\r
+* has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyUpEvent: null,\r
+\r
+\r
+/**\r
+* @event itemAddedEvent\r
+* @description Fires when an item is added to the menu.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+itemAddedEvent: null,\r
+\r
+\r
+/**\r
+* @event itemRemovedEvent\r
+* @description Fires when an item is removed to the menu.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+itemRemovedEvent: null,\r
+\r
+\r
+/**\r
+* @method init\r
+* @description The Menu class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references\r
+* for pre-existing markup, and creates required markup if it is not\r
+* already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source\r
+* for the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
+* Object specifying the <code>&#60;select&#62;</code> element to be used as\r
+* the data source for the menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu. See configuration class documentation for\r
+* more details.\r
+*/\r
+init: function(p_oElement, p_oConfig) {\r
+\r
+    this._aItemGroups = [];\r
+    this._aListElements = [];\r
+    this._aGroupTitleElements = [];\r
+\r
+\r
+    if(!this.ITEM_TYPE) {\r
+\r
+        this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
+\r
+    }\r
+\r
+\r
+    var oElement;\r
+\r
+    if(typeof p_oElement == "string") {\r
+\r
+        oElement = document.getElementById(p_oElement);\r
+\r
+    }\r
+    else if(p_oElement.tagName) {\r
+\r
+        oElement = p_oElement;\r
+\r
+    }\r
+\r
+\r
+    if(oElement && oElement.tagName) {\r
+\r
+        switch(oElement.tagName.toUpperCase()) {\r
+\r
+            case "DIV":\r
+\r
+                this.srcElement = oElement;\r
+\r
+                if(!oElement.id) {\r
+\r
+                    oElement.setAttribute("id", Dom.generateId());\r
+\r
+                }\r
+\r
+\r
+                /*\r
+                    Note: we don't pass the user config in here yet\r
+                    because we only want it executed once, at the lowest\r
+                    subclass level.\r
+                */\r
+\r
+                YAHOO.widget.Menu.superclass.init.call(this, oElement);\r
+\r
+                this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+                this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+\r
+                this.logger.log("Source element: " + this.srcElement.tagName);\r
+\r
+            break;\r
+\r
+            case "SELECT":\r
+\r
+                this.srcElement = oElement;\r
+\r
+\r
+                /*\r
+                    The source element is not something that we can use\r
+                    outright, so we need to create a new Overlay\r
+\r
+                    Note: we don't pass the user config in here yet\r
+                    because we only want it executed once, at the lowest\r
+                    subclass level.\r
+                */\r
+\r
+                YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r
+\r
+                this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+                this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+\r
+                this.logger.log("Source element: " + this.srcElement.tagName);\r
+\r
+            break;\r
+\r
+        }\r
+\r
+    }\r
+    else {\r
+\r
+        /*\r
+            Note: we don't pass the user config in here yet\r
+            because we only want it executed once, at the lowest\r
+            subclass level.\r
+        */\r
+\r
+        YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
+\r
+        this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+        this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+\r
+        this.logger.log("No source element found.  " +\r
+            "Created element with id: " + this.id);\r
+\r
+    }\r
+\r
+\r
+    if(this.element) {\r
+\r
+        var oEl = this.element;\r
+\r
+        Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
+\r
+\r
+        // Subscribe to Custom Events\r
+\r
+        this.initEvent.subscribe(this._onInit, this, true);\r
+        this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
+        this.renderEvent.subscribe(this._onRender, this, true);\r
+        this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r
+        this.showEvent.subscribe(this._onShow, this, true);\r
+        this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
+        this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
+        this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
+        this.clickEvent.subscribe(this._onClick, this, true);\r
+        this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
+\r
+\r
+        if(p_oConfig) {\r
+\r
+            this.cfg.applyConfig(p_oConfig, true);\r
+\r
+        }\r
+\r
+\r
+        // Register the Menu instance with the MenuManager\r
+\r
+        YAHOO.widget.MenuManager.addMenu(this);\r
+\r
+\r
+        this.initEvent.fire(YAHOO.widget.Menu);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+\r
+// Private methods\r
+\r
+\r
+/**\r
+* @method _initSubTree\r
+* @description Iterates the childNodes of the source element to find nodes\r
+* used to instantiate menu and menu items.\r
+* @private\r
+*/\r
+_initSubTree: function() {\r
+\r
+    var oNode;\r
+\r
+    if(this.srcElement.tagName == "DIV") {\r
+\r
+        /*\r
+            Populate the collection of item groups and item\r
+            group titles\r
+        */\r
+\r
+        oNode = this.body.firstChild;\r
+\r
+        var nGroup = 0;\r
+        var sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r
+\r
+        do {\r
+\r
+            if(oNode && oNode.tagName) {\r
+\r
+                switch(oNode.tagName.toUpperCase()) {\r
+\r
+                    case sGroupTitleTagName:\r
+\r
+                        this._aGroupTitleElements[nGroup] = oNode;\r
+\r
+                    break;\r
+\r
+                    case "UL":\r
+\r
+                        this._aListElements[nGroup] = oNode;\r
+                        this._aItemGroups[nGroup] = [];\r
+                        nGroup++;\r
+\r
+                    break;\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+        while((oNode = oNode.nextSibling));\r
+\r
+\r
+        /*\r
+            Apply the "first-of-type" class to the first UL to mimic\r
+            the "first-of-type" CSS3 psuedo class.\r
+        */\r
+\r
+        if(this._aListElements[0]) {\r
+\r
+            Dom.addClass(this._aListElements[0], "first-of-type");\r
+\r
+        }\r
+\r
+    }\r
+\r
+\r
+    oNode = null;\r
+\r
+    this.logger.log("Searching DOM for items to initialize.");\r
+\r
+    if(this.srcElement.tagName) {\r
+\r
+        switch(this.srcElement.tagName.toUpperCase()) {\r
+\r
+            case "DIV":\r
+\r
+                if(this._aListElements.length > 0) {\r
+\r
+                    this.logger.log("Found " +\r
+                        this._aListElements.length +\r
+                        " item groups to initialize.");\r
+\r
+                    var i = this._aListElements.length - 1;\r
+\r
+                    do {\r
+\r
+                        oNode = this._aListElements[i].firstChild;\r
+\r
+                        this.logger.log("Scanning " +\r
+                            this._aListElements[i].childNodes.length +\r
+                            " child nodes for items to initialize.");\r
+\r
+                        do {\r
+\r
+                            if(oNode && oNode.tagName) {\r
+\r
+                                switch(oNode.tagName.toUpperCase()) {\r
+\r
+                                    case "LI":\r
+\r
+                                        this.logger.log("Initializing " +\r
+                                            oNode.tagName + " node.");\r
+\r
+                                        this.addItem(\r
+                                                new this.ITEM_TYPE(\r
+                                                    oNode,\r
+                                                    { parent: this }\r
+                                                ),\r
+                                                i\r
+                                            );\r
+\r
+                                    break;\r
+\r
+                                }\r
+\r
+                            }\r
+\r
+                        }\r
+                        while((oNode = oNode.nextSibling));\r
+\r
+                    }\r
+                    while(i--);\r
+\r
+                }\r
+\r
+            break;\r
+\r
+            case "SELECT":\r
+\r
+                this.logger.log("Scanning " +\r
+                    this.srcElement.childNodes.length +\r
+                    " child nodes for items to initialize.");\r
+\r
+                oNode = this.srcElement.firstChild;\r
+\r
+                do {\r
+\r
+                    if(oNode && oNode.tagName) {\r
+\r
+                        switch(oNode.tagName.toUpperCase()) {\r
+\r
+                            case "OPTGROUP":\r
+                            case "OPTION":\r
+\r
+                                this.logger.log("Initializing " +\r
+                                    oNode.tagName + " node.");\r
+\r
+                                this.addItem(\r
+                                        new this.ITEM_TYPE(\r
+                                                oNode,\r
+                                                { parent: this }\r
+                                            )\r
+                                        );\r
+\r
+                            break;\r
+\r
+                        }\r
+\r
+                    }\r
+\r
+                }\r
+                while((oNode = oNode.nextSibling));\r
+\r
+            break;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _getFirstEnabledItem\r
+* @description Returns the first enabled item in the menu.\r
+* @return {YAHOO.widget.MenuItem}\r
+* @private\r
+*/\r
+_getFirstEnabledItem: function() {\r
+\r
+    var nGroups = this._aItemGroups.length;\r
+    var oItem;\r
+    var aItemGroup;\r
+\r
+    for(var i=0; i<nGroups; i++) {\r
+\r
+        aItemGroup = this._aItemGroups[i];\r
+\r
+        if(aItemGroup) {\r
+\r
+            var nItems = aItemGroup.length;\r
+\r
+            for(var n=0; n<nItems; n++) {\r
+\r
                 oItem = aItemGroup[n];\r
-                \r
-                if(!oItem.cfg.getProperty("disabled")) {\r
-                \r
+\r
+                if(\r
+                    !oItem.cfg.getProperty("disabled") &&\r
+                    oItem.element.style.display != "none"\r
+                ) {\r
+\r
                     return oItem;\r
-                \r
+\r
+                }\r
+\r
+                oItem = null;\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _checkPosition\r
+* @description Checks to make sure that the value of the "position" property\r
+* is one of the supported strings. Returns true if the position is supported.\r
+* @private\r
+* @param {Object} p_sPosition String specifying the position of the menu.\r
+* @return {Boolean}\r
+*/\r
+_checkPosition: function(p_sPosition) {\r
+\r
+    if(typeof p_sPosition == "string") {\r
+\r
+        var sPosition = p_sPosition.toLowerCase();\r
+\r
+        return ("dynamic,static".indexOf(sPosition) != -1);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _addItemToGroup\r
+* @description Adds a menu item to a group.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r
+* item belongs.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nItemIndex Optional. Number indicating the index at\r
+* which the menu item should be added.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
+\r
+    var oItem;\r
+\r
+    if(p_oItem instanceof this.ITEM_TYPE) {\r
+\r
+        oItem = p_oItem;\r
+        oItem.parent = this;\r
+\r
+    }\r
+    else if(typeof p_oItem == "string") {\r
+\r
+        oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r
+\r
+    }\r
+    else if(typeof p_oItem == "object" && p_oItem.text) {\r
+\r
+        var sText = p_oItem.text;\r
+\r
+        delete p_oItem["text"];\r
+\r
+        p_oItem.parent = this;\r
+\r
+        oItem = new this.ITEM_TYPE(sText, p_oItem);\r
+\r
+    }\r
+\r
+\r
+    if(oItem) {\r
+\r
+        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+\r
+        var aGroup = this._getItemGroup(nGroupIndex);\r
+\r
+        var oGroupItem;\r
+\r
+\r
+        if(!aGroup) {\r
+\r
+            aGroup = this._createItemGroup(nGroupIndex);\r
+\r
+        }\r
+\r
+\r
+        if(typeof p_nItemIndex == "number") {\r
+\r
+            var bAppend = (p_nItemIndex >= aGroup.length);\r
+\r
+\r
+            if(aGroup[p_nItemIndex]) {\r
+\r
+                aGroup.splice(p_nItemIndex, 0, oItem);\r
+\r
+            }\r
+            else {\r
+\r
+                aGroup[p_nItemIndex] = oItem;\r
+\r
+            }\r
+\r
+\r
+            oGroupItem = aGroup[p_nItemIndex];\r
+\r
+            if(oGroupItem) {\r
+\r
+                if(\r
+                    bAppend &&\r
+                    (\r
+                        !oGroupItem.element.parentNode ||\r
+                        oGroupItem.element.parentNode.nodeType == 11\r
+                    )\r
+                ) {\r
+\r
+                    this._aListElements[nGroupIndex].appendChild(\r
+                        oGroupItem.element\r
+                    );\r
+\r
+                }\r
+                else {\r
+\r
+\r
+                    /**\r
+                    * Returns the next sibling of an item in an array.\r
+                    * @private\r
+                    * @param {p_aArray} Array to search.\r
+                    * @param {p_nStartIndex} Number indicating the index to\r
+                    * start searching the array.\r
+                    * @return {Object}\r
+                    */\r
+                    var getNextItemSibling =\r
+\r
+                        function(p_aArray, p_nStartIndex) {\r
+\r
+                            return (\r
+                                    p_aArray[p_nStartIndex] ||\r
+                                    getNextItemSibling(\r
+                                        p_aArray,\r
+                                        (p_nStartIndex+1)\r
+                                    )\r
+                                );\r
+\r
+                        };\r
+\r
+\r
+                    var oNextItemSibling =\r
+                            getNextItemSibling(aGroup, (p_nItemIndex+1));\r
+\r
+                    if(\r
+                        oNextItemSibling &&\r
+                        (\r
+                            !oGroupItem.element.parentNode ||\r
+                            oGroupItem.element.parentNode.nodeType == 11\r
+                        )\r
+                    ) {\r
+\r
+                        this._aListElements[nGroupIndex].insertBefore(\r
+                                oGroupItem.element,\r
+                                oNextItemSibling.element\r
+                            );\r
+\r
+                    }\r
+\r
+                }\r
+\r
+\r
+                oGroupItem.parent = this;\r
+\r
+                this._subscribeToItemEvents(oGroupItem);\r
+\r
+                this._configureSubmenu(oGroupItem);\r
+\r
+                this._updateItemProperties(nGroupIndex);\r
+\r
+                this.logger.log("Item inserted." +\r
+                    " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r
+                    " Index: " + oGroupItem.index + ", " +\r
+                    " Group Index: " + oGroupItem.groupIndex);\r
+\r
+                this.itemAddedEvent.fire(oGroupItem);\r
+\r
+                return oGroupItem;\r
+\r
+            }\r
+\r
+        }\r
+        else {\r
+\r
+            var nItemIndex = aGroup.length;\r
+\r
+            aGroup[nItemIndex] = oItem;\r
+\r
+            oGroupItem = aGroup[nItemIndex];\r
+\r
+\r
+            if(oGroupItem) {\r
+\r
+                if(\r
+                    !Dom.isAncestor(\r
+                        this._aListElements[nGroupIndex],\r
+                        oGroupItem.element\r
+                    )\r
+                ) {\r
+\r
+                    this._aListElements[nGroupIndex].appendChild(\r
+                        oGroupItem.element\r
+                    );\r
+\r
+                }\r
+\r
+                oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
+                oGroupItem.element.setAttribute("index", nItemIndex);\r
+\r
+                oGroupItem.parent = this;\r
+\r
+                oGroupItem.index = nItemIndex;\r
+                oGroupItem.groupIndex = nGroupIndex;\r
+\r
+                this._subscribeToItemEvents(oGroupItem);\r
+\r
+                this._configureSubmenu(oGroupItem);\r
+\r
+                if(nItemIndex === 0) {\r
+\r
+                    Dom.addClass(oGroupItem.element, "first-of-type");\r
+\r
+                }\r
+\r
+                this.logger.log("Item added." +\r
+                    " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r
+                    " Index: " + oGroupItem.index + ", " +\r
+                    " Group Index: " + oGroupItem.groupIndex);\r
+\r
+\r
+                this.itemAddedEvent.fire(oGroupItem);\r
+\r
+                return oGroupItem;\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _removeItemFromGroupByIndex\r
+* @description Removes a menu item from a group by index.  Returns the menu\r
+* item that was removed.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r
+* item belongs.\r
+* @param {Number} p_nItemIndex Number indicating the index of the menu item\r
+* to be removed.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r
+\r
+    var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+    var aGroup = this._getItemGroup(nGroupIndex);\r
+\r
+    if(aGroup) {\r
+\r
+        var aArray = aGroup.splice(p_nItemIndex, 1);\r
+        var oItem = aArray[0];\r
+\r
+        if(oItem) {\r
+\r
+            // Update the index and className properties of each member\r
+\r
+            this._updateItemProperties(nGroupIndex);\r
+\r
+            if(aGroup.length === 0) {\r
+\r
+                // Remove the UL\r
+\r
+                var oUL = this._aListElements[nGroupIndex];\r
+\r
+                if(this.body && oUL) {\r
+\r
+                    this.body.removeChild(oUL);\r
+\r
+                }\r
+\r
+                // Remove the group from the array of items\r
+\r
+                this._aItemGroups.splice(nGroupIndex, 1);\r
+\r
+\r
+                // Remove the UL from the array of ULs\r
+\r
+                this._aListElements.splice(nGroupIndex, 1);\r
+\r
+\r
+                /*\r
+                     Assign the "first-of-type" class to the new first UL\r
+                     in the collection\r
+                */\r
+\r
+                oUL = this._aListElements[0];\r
+\r
+                if(oUL) {\r
+\r
+                    Dom.addClass(oUL, "first-of-type");\r
+\r
+                }\r
+\r
+            }\r
+\r
+\r
+            this.itemRemovedEvent.fire(oItem);\r
+\r
+\r
+            // Return a reference to the item that was removed\r
+\r
+            return oItem;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _removeItemFromGroupByValue\r
+* @description Removes a menu item from a group by reference.  Returns the\r
+* menu item that was removed.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r
+* menu item belongs.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be removed.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r
+\r
+    var aGroup = this._getItemGroup(p_nGroupIndex);\r
+\r
+    if(aGroup) {\r
+\r
+        var nItems = aGroup.length;\r
+        var nItemIndex = -1;\r
+\r
+        if(nItems > 0) {\r
+\r
+            var i = nItems-1;\r
+\r
+            do {\r
+\r
+                if(aGroup[i] == p_oItem) {\r
+\r
+                    nItemIndex = i;\r
+                    break;\r
+\r
+                }\r
+\r
+            }\r
+            while(i--);\r
+\r
+            if(nItemIndex > -1) {\r
+\r
+                return this._removeItemFromGroupByIndex(\r
+                            p_nGroupIndex,\r
+                            nItemIndex\r
+                        );\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _updateItemProperties\r
+* @description Updates the "index," "groupindex," and "className" properties\r
+* of the menu items in the specified group.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
+*/\r
+_updateItemProperties: function(p_nGroupIndex) {\r
+\r
+    var aGroup = this._getItemGroup(p_nGroupIndex);\r
+    var nItems = aGroup.length;\r
+\r
+    if(nItems > 0) {\r
+\r
+        var i = nItems - 1;\r
+        var oItem;\r
+        var oLI;\r
+\r
+        // Update the index and className properties of each member\r
+\r
+        do {\r
+\r
+            oItem = aGroup[i];\r
+\r
+            if(oItem) {\r
+\r
+                oLI = oItem.element;\r
+\r
+                oItem.index = i;\r
+                oItem.groupIndex = p_nGroupIndex;\r
+\r
+                oLI.setAttribute("groupindex", p_nGroupIndex);\r
+                oLI.setAttribute("index", i);\r
+\r
+                Dom.removeClass(oLI, "first-of-type");\r
+\r
+            }\r
+\r
+        }\r
+        while(i--);\r
+\r
+\r
+        if(oLI) {\r
+\r
+            Dom.addClass(oLI, "first-of-type");\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _createItemGroup\r
+* @description Creates a new menu item group (array) and its associated\r
+* <code>&#60;ul&#62;</code> element. Returns an aray of menu item groups.\r
+* @private\r
+* @param {Number} p_nIndex Number indicating the group to create.\r
+* @return {Array}\r
+*/\r
+_createItemGroup: function(p_nIndex) {\r
+\r
+    if(!this._aItemGroups[p_nIndex]) {\r
+\r
+        this._aItemGroups[p_nIndex] = [];\r
+\r
+        var oUL = document.createElement("ul");\r
+\r
+        this._aListElements[p_nIndex] = oUL;\r
+\r
+        return this._aItemGroups[p_nIndex];\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _getItemGroup\r
+* @description Returns the menu item group at the specified index.\r
+* @private\r
+* @param {Number} p_nIndex Number indicating the index of the menu item group\r
+* to be retrieved.\r
+* @return {Array}\r
+*/\r
+_getItemGroup: function(p_nIndex) {\r
+\r
+    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
+\r
+    return this._aItemGroups[nIndex];\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _configureSubmenu\r
+* @description Subscribes the menu item's submenu to its parent menu's events.\r
+* @private\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance with the submenu to be configured.\r
+*/\r
+_configureSubmenu: function(p_oItem) {\r
+\r
+    var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
+\r
+    if(oSubmenu) {\r
+\r
+        /*\r
+            Listen for configuration changes to the parent menu\r
+            so they they can be applied to the submenu.\r
+        */\r
+\r
+        this.cfg.configChangedEvent.subscribe(\r
+                this._onParentMenuConfigChange,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        this.renderEvent.subscribe(\r
+                this._onParentMenuRender,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.beforeShowEvent.subscribe(\r
+                this._onSubmenuBeforeShow,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.showEvent.subscribe(\r
+                this._onSubmenuShow,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.hideEvent.subscribe(\r
+                this._onSubmenuHide,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _subscribeToItemEvents\r
+* @description Subscribes a menu to a menu item's event.\r
+* @private\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance whose events should be subscribed to.\r
+*/\r
+_subscribeToItemEvents: function(p_oItem) {\r
+\r
+    p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r
+\r
+    p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r
+\r
+    p_oItem.cfg.configChangedEvent.subscribe(\r
+        this._onMenuItemConfigChange,\r
+        p_oItem,\r
+        this\r
+    );\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _getOffsetWidth\r
+* @description Returns the offset width of the menu's\r
+* <code>&#60;div&#62;</code> element.\r
+* @private\r
+*/\r
+_getOffsetWidth: function() {\r
+\r
+    var oClone = this.element.cloneNode(true);\r
+\r
+    Dom.setStyle(oClone, "width", "");\r
+\r
+    document.body.appendChild(oClone);\r
+\r
+    var sWidth = oClone.offsetWidth;\r
+\r
+    document.body.removeChild(oClone);\r
+\r
+    return sWidth;\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _cancelHideDelay\r
+* @description Cancels the call to "hideMenu."\r
+* @private\r
+*/\r
+_cancelHideDelay: function() {\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    if(oRoot._nHideDelayId) {\r
+\r
+        window.clearTimeout(oRoot._nHideDelayId);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _execHideDelay\r
+* @description Hides the menu after the number of milliseconds specified by\r
+* the "hidedelay" configuration property.\r
+* @private\r
+*/\r
+_execHideDelay: function() {\r
+\r
+    this._cancelHideDelay();\r
+\r
+    var oRoot = this.getRoot();\r
+    var me = this;\r
+\r
+    var hideMenu = function() {\r
+\r
+        if(oRoot.activeItem) {\r
+\r
+            oRoot.clearActiveItem();\r
+\r
+        }\r
+\r
+        if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r
+\r
+            me.hide();\r
+\r
+        }\r
+\r
+    };\r
+\r
+\r
+    oRoot._nHideDelayId =\r
+        window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _cancelShowDelay\r
+* @description Cancels the call to the "showMenu."\r
+* @private\r
+*/\r
+_cancelShowDelay: function() {\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    if(oRoot._nShowDelayId) {\r
+\r
+        window.clearTimeout(oRoot._nShowDelayId);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _execShowDelay\r
+* @description Shows the menu after the number of milliseconds specified by\r
+* the "showdelay" configuration property have ellapsed.\r
+* @private\r
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r
+* be made visible.\r
+*/\r
+_execShowDelay: function(p_oMenu) {\r
+\r
+    this._cancelShowDelay();\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    var showMenu = function() {\r
+\r
+        p_oMenu.show();\r
+\r
+    };\r
+\r
+\r
+    oRoot._nShowDelayId =\r
+        window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r
+\r
+},\r
+\r
+\r
+\r
+// Protected methods\r
+\r
+\r
+/**\r
+* @method _onMouseOver\r
+* @description "mouseover" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oTarget = Event.getTarget(oEvent);\r
+\r
+    if(\r
+        !this._bHandledMouseOverEvent &&\r
+        (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
+    ) {\r
+\r
+        // MENU  MOUSEOVER LOGIC HERE\r
+\r
+        this.clearActiveItem();\r
+\r
+        this._bHandledMouseOverEvent = true;\r
+        this._bHandledMouseOutEvent = false;\r
+\r
+    }\r
+\r
+\r
+    if(\r
+        oItem && !oItem.handledMouseOverEvent &&\r
+        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
+    ) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+\r
+        // Select and focus the current menu item\r
+\r
+        oItemCfg.setProperty("selected", true);\r
+        oItem.focus();\r
+\r
+\r
+        if(this.cfg.getProperty("autosubmenudisplay")) {\r
+\r
+            // Show the submenu this menu item\r
+\r
+            var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+            if(oSubmenu) {\r
+\r
+                if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+                    this._execShowDelay(oSubmenu);\r
+\r
+                }\r
+                else {\r
+\r
+                    oSubmenu.show();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+        oItem.handledMouseOverEvent = true;\r
+        oItem.handledMouseOutEvent = false;\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onMouseOut\r
+* @description "mouseout" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oRelatedTarget = Event.getRelatedTarget(oEvent);\r
+    var bMovingToSubmenu = false;\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+\r
+        if(\r
+            oSubmenu &&\r
+            (\r
+                oRelatedTarget == oSubmenu.element ||\r
+                Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
+            )\r
+        ) {\r
+\r
+            bMovingToSubmenu = true;\r
+\r
+        }\r
+\r
+\r
+        if(\r
+            !oItem.handledMouseOutEvent &&\r
+            (\r
+                (\r
+                    oRelatedTarget != oItem.element &&\r
+                    !Dom.isAncestor(oItem.element, oRelatedTarget)\r
+                ) || bMovingToSubmenu\r
+            )\r
+        ) {\r
+\r
+\r
+            if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+                this._cancelShowDelay();\r
+\r
+            }\r
+\r
+\r
+            if(!bMovingToSubmenu) {\r
+\r
+                oItemCfg.setProperty("selected", false);\r
+\r
+            }\r
+\r
+\r
+            if(this.cfg.getProperty("autosubmenudisplay")) {\r
+\r
+                if(oSubmenu) {\r
+\r
+                    if(\r
+                        !(\r
+                            oRelatedTarget == oSubmenu.element ||\r
+                            YAHOO.util.Dom.isAncestor(\r
+                                oSubmenu.element,\r
+                                oRelatedTarget\r
+                            )\r
+                        )\r
+                    ) {\r
+\r
+                        oSubmenu.hide();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+            }\r
+\r
+            oItem.handledMouseOutEvent = true;\r
+            oItem.handledMouseOverEvent = false;\r
+\r
+        }\r
+\r
+    }\r
+\r
+\r
+    if(\r
+        !this._bHandledMouseOutEvent &&\r
+        (\r
+            (\r
+                oRelatedTarget != this.element &&\r
+                !Dom.isAncestor(this.element, oRelatedTarget)\r
+            )\r
+            || bMovingToSubmenu\r
+        )\r
+    ) {\r
+\r
+        this._bHandledMouseOutEvent = true;\r
+        this._bHandledMouseOverEvent = false;\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onClick\r
+* @description "click" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onClick: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oTarget = Event.getTarget(oEvent);\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+\r
+        /*\r
+            ACCESSIBILITY FEATURE FOR SCREEN READERS:\r
+            Expand/collapse the submenu when the user clicks\r
+            on the submenu indicator image.\r
+        */\r
+\r
+        if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
+\r
+            if(oSubmenu.cfg.getProperty("visible")) {\r
+\r
+                oSubmenu.hide();\r
+\r
+            }\r
+            else {\r
+\r
+                this.clearActiveItem();\r
+\r
+                this.activeItem = oItem;\r
+\r
+                oItem.cfg.setProperty("selected", true);\r
+\r
+                oSubmenu.show();\r
+\r
+            }\r
+\r
+        }\r
+        else {\r
+\r
+            var sURL = oItemCfg.getProperty("url");\r
+            var bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
+            var sTarget = oItemCfg.getProperty("target");\r
+            var bHasTarget = (sTarget && sTarget.length > 0);\r
+\r
+            /*\r
+                Prevent the browser from following links\r
+                equal to "#"\r
+            */\r
+\r
+            if(\r
+                oTarget.tagName.toUpperCase() == "A" &&\r
+                bCurrentPageURL && !bHasTarget\r
+            ) {\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            }\r
+\r
+            if(\r
+                oTarget.tagName.toUpperCase() != "A" &&\r
+                !bCurrentPageURL && !bHasTarget\r
+            ) {\r
+\r
+                /*\r
+                    Follow the URL of the item regardless of\r
+                    whether or not the user clicked specifically\r
+                    on the anchor element.\r
+                */\r
+\r
+                document.location = sURL;\r
+\r
+            }\r
+\r
+\r
+            /*\r
+                If the item doesn't navigate to a URL and it doesn't have\r
+                a submenu, then collapse the menu tree.\r
+            */\r
+\r
+            if(bCurrentPageURL && !oSubmenu) {\r
+\r
+                var oRoot = this.getRoot();\r
+\r
+                if(oRoot.cfg.getProperty("position") == "static") {\r
+\r
+                    oRoot.clearActiveItem();\r
+\r
+                }\r
+                else {\r
+\r
+                    oRoot.hide();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onKeyDown\r
+* @description "keydown" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oSubmenu;\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oParentItem = this.parent;\r
+        var oRoot;\r
+        var oNextItem;\r
+\r
+\r
+        switch(oEvent.keyCode) {\r
+\r
+            case 38:    // Up arrow\r
+            case 40:    // Down arrow\r
+\r
+                if(\r
+                    oItem == this.activeItem &&\r
+                    !oItemCfg.getProperty("selected")\r
+                ) {\r
+\r
+                    oItemCfg.setProperty("selected", true);\r
+\r
                 }\r
-    \r
-                oItem = null;\r
-    \r
+                else {\r
+\r
+                    oNextItem = (oEvent.keyCode == 38) ?\r
+                        oItem.getPreviousEnabledSibling() :\r
+                        oItem.getNextEnabledSibling();\r
+\r
+                    if(oNextItem) {\r
+\r
+                        this.clearActiveItem();\r
+\r
+                        oNextItem.cfg.setProperty("selected", true);\r
+                        oNextItem.focus();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+\r
+            case 39:    // Right arrow\r
+\r
+                oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+                if(oSubmenu) {\r
+\r
+                    if(!oItemCfg.getProperty("selected")) {\r
+\r
+                        oItemCfg.setProperty("selected", true);\r
+\r
+                    }\r
+\r
+                    oSubmenu.show();\r
+\r
+                    oSubmenu.setInitialSelection();\r
+\r
+                }\r
+                else {\r
+\r
+                    oRoot = this.getRoot();\r
+\r
+                    if(oRoot instanceof YAHOO.widget.MenuBar) {\r
+\r
+                        oNextItem = oRoot.activeItem.getNextEnabledSibling();\r
+\r
+                        if(oNextItem) {\r
+\r
+                            oRoot.clearActiveItem();\r
+\r
+                            oNextItem.cfg.setProperty("selected", true);\r
+\r
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+\r
+                            if(oSubmenu) {\r
+\r
+                                oSubmenu.show();\r
+\r
+                            }\r
+\r
+                            oNextItem.focus();\r
+\r
+                        }\r
+\r
+                    }\r
+\r
+                }\r
+\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+\r
+            case 37:    // Left arrow\r
+\r
+                if(oParentItem) {\r
+\r
+                    var oParentMenu = oParentItem.parent;\r
+\r
+                    if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r
+\r
+                        oNextItem =\r
+                            oParentMenu.activeItem.getPreviousEnabledSibling();\r
+\r
+                        if(oNextItem) {\r
+\r
+                            oParentMenu.clearActiveItem();\r
+\r
+                            oNextItem.cfg.setProperty("selected", true);\r
+\r
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+\r
+                            if(oSubmenu) {\r
+\r
+                                oSubmenu.show();\r
+\r
+                            }\r
+\r
+                            oNextItem.focus();\r
+\r
+                        }\r
+\r
+                    }\r
+                    else {\r
+\r
+                        this.hide();\r
+\r
+                        oParentItem.focus();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+        }\r
+\r
+\r
+    }\r
+\r
+\r
+    if(oEvent.keyCode == 27) { // Esc key\r
+\r
+        if(this.cfg.getProperty("position") == "dynamic") {\r
+\r
+            this.hide();\r
+\r
+            if(this.parent) {\r
+\r
+                this.parent.focus();\r
+\r
+            }\r
+\r
+        }\r
+        else if(this.activeItem) {\r
+\r
+            oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
+\r
+            if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
+\r
+                oSubmenu.hide();\r
+                this.activeItem.focus();\r
+\r
+            }\r
+            else {\r
+\r
+                this.activeItem.cfg.setProperty("selected", false);\r
+                this.activeItem.blur();\r
+\r
+            }\r
+\r
+        }\r
+\r
+\r
+        Event.preventDefault(oEvent);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+\r
+// Private methods\r
+\r
+\r
+/**\r
+* @method _onInit\r
+* @description "init" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onInit: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(\r
+        (\r
+            (this.parent && !this.lazyLoad) ||\r
+            (!this.parent && this.cfg.getProperty("position") == "static") ||\r
+            (\r
+                !this.parent &&\r
+                !this.lazyLoad &&\r
+                this.cfg.getProperty("position") == "dynamic"\r
+            )\r
+        ) &&\r
+        this.getItemGroups().length === 0\r
+    ) {\r
+\r
+        if(this.srcElement) {\r
+\r
+            this._initSubTree();\r
+\r
+        }\r
+\r
+\r
+        if(this.itemData) {\r
+\r
+            this.addItems(this.itemData);\r
+\r
+        }\r
+\r
+    }\r
+    else if(this.lazyLoad) {\r
+\r
+        this.cfg.fireQueue();\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onBeforeRender\r
+* @description "beforerender" event handler for the menu.  Appends all of the\r
+* <code>&#60;ul&#62;</code>, <code>&#60;li&#62;</code> and their accompanying\r
+* title elements to the body element of the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oConfig = this.cfg;\r
+    var oEl = this.element;\r
+    var nListElements = this._aListElements.length;\r
+\r
+\r
+    if(nListElements > 0) {\r
+\r
+        var i = 0;\r
+        var bFirstList = true;\r
+        var oUL;\r
+        var oGroupTitle;\r
+\r
+\r
+        do {\r
+\r
+            oUL = this._aListElements[i];\r
+\r
+            if(oUL) {\r
+\r
+                if(bFirstList) {\r
+\r
+                    Dom.addClass(oUL, "first-of-type");\r
+                    bFirstList = false;\r
+\r
+                }\r
+\r
+\r
+                if(!Dom.isAncestor(oEl, oUL)) {\r
+\r
+                    this.appendToBody(oUL);\r
+\r
+                }\r
+\r
+\r
+                oGroupTitle = this._aGroupTitleElements[i];\r
+\r
+                if(oGroupTitle) {\r
+\r
+                    if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
+\r
+                        oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
+\r
+                    }\r
+\r
+\r
+                    Dom.addClass(oUL, "hastitle");\r
+\r
+                }\r
+\r
+            }\r
+\r
+            i++;\r
+\r
+        }\r
+        while(i < nListElements);\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onRender\r
+* @description "render" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onRender: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
+\r
+        var sWidth =\r
+            this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r
+            this.element.offsetWidth : this._getOffsetWidth();\r
+\r
+        this.cfg.setProperty("width", (sWidth + "px"));\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onBeforeShow\r
+* @description "beforeshow" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(this.lazyLoad && this.getItemGroups().length === 0) {\r
+\r
+        if(this.srcElement) {\r
+\r
+            this._initSubTree();\r
+\r
+        }\r
+\r
+\r
+        if(this.itemData) {\r
+\r
+            if(\r
+                this.parent && this.parent.parent &&\r
+                this.parent.parent.srcElement &&\r
+                this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
+            ) {\r
+\r
+                var nOptions = this.itemData.length;\r
+\r
+                for(var n=0; n<nOptions; n++) {\r
+\r
+                    if(this.itemData[n].tagName) {\r
+\r
+                        this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r
+\r
+                    }\r
+\r
+                }\r
+\r
+            }\r
+            else {\r
+\r
+                this.addItems(this.itemData);\r
+\r
             }\r
-        \r
+\r
+        }\r
+\r
+\r
+        if(this.srcElement) {\r
+\r
+            this.render();\r
+\r
         }\r
-    \r
-    }\r
-    \r
-};\r
+        else {\r
 \r
+            if(this.parent) {\r
 \r
-/**\r
-* Determines if the value is one of the supported positions.\r
-* @private\r
-* @param {Object} p_sPosition The object to be evaluated.\r
-* @return Returns true if the position is supported.\r
-* @type Boolean\r
-*/\r
-YAHOO.widget.MenuModule.prototype._checkPosition = function(p_sPosition) {\r
+                this.render(this.parent.element);\r
 \r
-    if(typeof p_sPosition == "string") {\r
+            }\r
+            else {\r
 \r
-        var sPosition = p_sPosition.toLowerCase();\r
+                this.render(this.cfg.getProperty("container"));\r
 \r
-        return ("dynamic,static".indexOf(sPosition) != -1);\r
+            }\r
+\r
+        }\r
 \r
     }\r
 \r
-};\r
+},\r
 \r
 \r
 /**\r
-* Adds an item to a group.\r
+* @method _onShow\r
+* @description "show" event handler for the menu.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be added.\r
-* @param {Number} p_nItemIndex Optional. Index at which the item \r
-* should be added.\r
-* @return The item that was added.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
+* the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._addItemToGroup = \r
+_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
+    this.setInitialFocus();\r
 \r
-        var Dom = this._oDom;\r
-        var oItem;\r
+    var oParent = this.parent;\r
 \r
-        if(p_oItem instanceof this.ITEM_TYPE) {\r
+    if(oParent) {\r
 \r
-            oItem = p_oItem;     \r
 \r
-        }\r
-        else if(typeof p_oItem == "string") {\r
+        var oParentMenu = oParent.parent;\r
+\r
+        var aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");\r
+        var aAlignment = this.cfg.getProperty("submenualignment");\r
+\r
+        if(\r
+            (aParentAlignment[0] != aAlignment[0]) &&\r
+            (aParentAlignment[1] != aAlignment[1])\r
+        ) {\r
+\r
+            this.cfg.setProperty(\r
+                "submenualignment",\r
+                [ aParentAlignment[0], aParentAlignment[1] ]\r
+            );\r
 \r
-            oItem = new this.ITEM_TYPE(p_oItem);\r
-        \r
         }\r
 \r
 \r
-        if(oItem) {\r
-        \r
-            var nGroupIndex = typeof p_nGroupIndex == "number" ? \r
-                    p_nGroupIndex : 0;\r
-            \r
-            var aGroup = this._getItemGroup(nGroupIndex);\r
-            \r
-            var oGroupItem;\r
-    \r
-\r
-            if(!aGroup) {\r
-    \r
-                aGroup = this._createItemGroup(nGroupIndex);\r
-    \r
-            }\r
+        if(\r
+            !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r
+            oParentMenu.cfg.getProperty("position") == "static"\r
+        ) {\r
 \r
+            oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
 \r
-            if(typeof p_nItemIndex == "number") {\r
-    \r
-                var bAppend = (p_nItemIndex >= aGroup.length);            \r
-    \r
 \r
-                if(aGroup[p_nItemIndex]) {\r
-        \r
-                    aGroup.splice(p_nItemIndex, 0, oItem);\r
-        \r
-                }\r
-                else {\r
-        \r
-                    aGroup[p_nItemIndex] = oItem;\r
-        \r
-                }\r
-    \r
-    \r
-                oGroupItem = aGroup[p_nItemIndex];\r
-    \r
-                if(oGroupItem) {\r
-    \r
-                    if(bAppend && !oGroupItem.element.parentNode) {\r
-            \r
-                        this._aListElements[nGroupIndex].appendChild(\r
-                            oGroupItem.element\r
-                        );\r
-        \r
-                    }\r
-                    else {\r
-      \r
-        \r
-                        /**\r
-                        * Returns the next sibling of an item in an array \r
-                        * @param {p_aArray} An array\r
-                        * @param {p_nStartIndex} The index to start searching\r
-                        * the array \r
-                        * @ignore\r
-                        * @return Returns an item in an array\r
-                        * @type Object \r
-                        */\r
-                        function getNextItemSibling(p_aArray, p_nStartIndex) {\r
-                \r
-                            return (\r
-                                    p_aArray[p_nStartIndex] || \r
-                                    getNextItemSibling(\r
-                                        p_aArray, \r
-                                        (p_nStartIndex+1)\r
-                                    )\r
-                                );\r
-                \r
-                        }\r
-        \r
-        \r
-                        var oNextItemSibling = \r
-                                getNextItemSibling(aGroup, (p_nItemIndex+1));\r
-        \r
-                        if(oNextItemSibling && !oGroupItem.element.parentNode) {\r
-                \r
-                            this._aListElements[nGroupIndex].insertBefore(\r
-                                    oGroupItem.element, \r
-                                    oNextItemSibling.element\r
-                                );\r
-            \r
-                        }\r
-        \r
-                    }\r
-        \r
-    \r
-                    oGroupItem.parent = this;\r
-            \r
-                    this._subscribeToItemEvents(oGroupItem);\r
-        \r
-                    this._configureItemSubmenuModule(oGroupItem);\r
-                    \r
-                    this._updateItemProperties(nGroupIndex);\r
-            \r
-                    this.logger.log("Item inserted." + \r
-                        " Text: " + oGroupItem.cfg.getProperty("text") + ", " + \r
-                        " Index: " + oGroupItem.index + ", " + \r
-                        " Group Index: " + oGroupItem.groupIndex);\r
-\r
-                    return oGroupItem;\r
-        \r
-                }\r
-    \r
-            }\r
-            else {\r
-        \r
-                var nItemIndex = aGroup.length;\r
-        \r
-                aGroup[nItemIndex] = oItem;\r
-        \r
-        \r
-                oGroupItem = aGroup[nItemIndex];\r
-        \r
-                if(oGroupItem) {\r
-        \r
+            /**\r
+            * "click" event handler for the document\r
+            * @private\r
+            * @param {Event} p_oEvent Object reference for the DOM event object\r
+            * passed back by the event utility (YAHOO.util.Event).\r
+            */\r
+            var disableAutoSubmenuDisplay = function(p_oEvent) {\r
+\r
+                if(\r
+                    p_oEvent.type == "mousedown" ||\r
+                    (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r
+                ) {\r
+\r
+                    /*\r
+                        Set the "autosubmenudisplay" to "false" if the user\r
+                        clicks outside the menu bar.\r
+                    */\r
+\r
+                    var oTarget = Event.getTarget(p_oEvent);\r
+\r
                     if(\r
-                        !Dom.isAncestor(\r
-                            this._aListElements[nGroupIndex], \r
-                            oGroupItem.element\r
-                        )\r
+                        oTarget != oParentMenu.element ||\r
+                        !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r
                     ) {\r
-        \r
-                        this._aListElements[nGroupIndex].appendChild(\r
-                            oGroupItem.element\r
+\r
+                        oParentMenu.cfg.setProperty(\r
+                            "autosubmenudisplay",\r
+                            false\r
                         );\r
-        \r
-                    }\r
-        \r
-                    oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
-                    oGroupItem.element.setAttribute("index", nItemIndex);\r
-            \r
-                    oGroupItem.parent = this;\r
-        \r
-                    oGroupItem.index = nItemIndex;\r
-                    oGroupItem.groupIndex = nGroupIndex;\r
-            \r
-                    this._subscribeToItemEvents(oGroupItem);\r
-        \r
-                    this._configureItemSubmenuModule(oGroupItem);\r
-        \r
-                    if(nItemIndex === 0) {\r
-            \r
-                        Dom.addClass(oGroupItem.element, "first-of-type");\r
-            \r
+\r
+                        Event.removeListener(\r
+                                document,\r
+                                "mousedown",\r
+                                disableAutoSubmenuDisplay\r
+                            );\r
+\r
+                        Event.removeListener(\r
+                                document,\r
+                                "keydown",\r
+                                disableAutoSubmenuDisplay\r
+                            );\r
+\r
                     }\r
 \r
-                    this.logger.log("Item added." + \r
-                        " Text: " + oGroupItem.cfg.getProperty("text") + ", " + \r
-                        " Index: " + oGroupItem.index + ", " + \r
-                        " Group Index: " + oGroupItem.groupIndex);\r
-            \r
-                    return oGroupItem;\r
-        \r
                 }\r
-        \r
-            }\r
+\r
+            };\r
+\r
+            Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r
+            Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
 \r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Removes an item from a group by index.\r
+* @method _onBeforeHide\r
+* @description "beforehide" event handler for the menu.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {Number} p_nItemIndex Number indicating the index of the item to  \r
-* be removed.\r
-* @return The item that was removed.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/    \r
-YAHOO.widget.MenuModule.prototype._removeItemFromGroupByIndex = \r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
+* the event.\r
+*/\r
+_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_nGroupIndex, p_nItemIndex) {\r
+    this.clearActiveItem(true);\r
 \r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-        var aGroup = this._getItemGroup(nGroupIndex);\r
-    \r
-        if(aGroup) {\r
-    \r
-            var aArray = aGroup.splice(p_nItemIndex, 1);\r
-            var oItem = aArray[0];\r
-        \r
-            if(oItem) {\r
-        \r
-                // Update the index and className properties of each member        \r
-                \r
-                this._updateItemProperties(nGroupIndex);\r
-        \r
-                if(aGroup.length === 0) {\r
-        \r
-                    // Remove the UL\r
-        \r
-                    var oUL = this._aListElements[nGroupIndex];\r
-        \r
-                    if(this.body && oUL) {\r
-        \r
-                        this.body.removeChild(oUL);\r
-        \r
-                    }\r
-        \r
-                    // Remove the group from the array of items\r
-        \r
-                    this._aItemGroups.splice(nGroupIndex, 1);\r
-        \r
-        \r
-                    // Remove the UL from the array of ULs\r
-        \r
-                    this._aListElements.splice(nGroupIndex, 1);\r
-        \r
-        \r
-                    /*\r
-                         Assign the "first-of-type" class to the new first UL \r
-                         in the collection\r
-                    */\r
-        \r
-                    oUL = this._aListElements[0];\r
-        \r
-                    if(oUL) {\r
-        \r
-                        this._oDom.addClass(oUL, "first-of-type");\r
-        \r
-                    }            \r
-        \r
-                }\r
-        \r
-        \r
-                // Return a reference to the item that was removed\r
-            \r
-                return oItem;\r
-        \r
-            }\r
-    \r
-        }\r
-    \r
-    };\r
+},\r
 \r
 \r
 /**\r
-* Removes a item from a group by reference.\r
+* @method _onParentMenuConfigChange\r
+* @description "configchange" event handler for a submenu.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be removed.\r
-* @return The item that was removed.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/    \r
-YAHOO.widget.MenuModule.prototype._removeItemFromGroupByValue =\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r
 \r
-    function(p_nGroupIndex, p_oItem) {\r
+    var sPropertyName = p_aArgs[0][0];\r
+    var oPropertyValue = p_aArgs[0][1];\r
 \r
-        var aGroup = this._getItemGroup(p_nGroupIndex);\r
+    switch(sPropertyName) {\r
 \r
-        if(aGroup) {\r
+        case "iframe":\r
+        case "constraintoviewport":\r
+        case "hidedelay":\r
+        case "showdelay":\r
+        case "clicktohide":\r
+        case "effect":\r
 \r
-            var nItems = aGroup.length;\r
-            var nItemIndex = -1;\r
-        \r
-            if(nItems > 0) {\r
-        \r
-                var i = nItems-1;\r
-            \r
-                do {\r
-            \r
-                    if(aGroup[i] == p_oItem) {\r
-            \r
-                        nItemIndex = i;\r
-                        break;    \r
-            \r
-                    }\r
-            \r
-                }\r
-                while(i--);\r
-            \r
-                if(nItemIndex > -1) {\r
-            \r
-                    return this._removeItemFromGroupByIndex(\r
-                                p_nGroupIndex, \r
-                                nItemIndex\r
-                            );\r
-            \r
-                }\r
-        \r
-            }\r
-        \r
-        }\r
-    \r
-    };\r
+            p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
+\r
+        break;\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Updates the index, groupindex, and className properties of the items\r
-* in the specified group. \r
+* @method _onParentMenuRender\r
+* @description "render" event handler for a submenu.  Renders a\r
+* submenu in response to the firing of its parent's "render" event.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._updateItemProperties = \r
+_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
 \r
-    function(p_nGroupIndex) {\r
+    /*\r
+        Set the "constraintoviewport" configuration\r
+        property to match the parent Menu\r
+    */\r
+\r
+    var oParentMenu = p_oSubmenu.parent.parent;\r
+\r
+    var oConfig = {\r
+\r
+            constraintoviewport:\r
+                oParentMenu.cfg.getProperty("constraintoviewport"),\r
+\r
+            xy: [0,0],\r
+\r
+            clicktohide:\r
+                oParentMenu.cfg.getProperty("clicktohide"),\r
+\r
+            effect:\r
+                oParentMenu.cfg.getProperty("effect")\r
+\r
+        };\r
+\r
+\r
+    var nShowDelay = oParentMenu.cfg.getProperty("showdelay");\r
+\r
+    if(nShowDelay > 0) {\r
+\r
+        oConfig.showdelay = nShowDelay;\r
+\r
+    }\r
+\r
+\r
+    var nHideDelay = oParentMenu.cfg.getProperty("hidedelay");\r
+\r
+    if(nHideDelay > 0) {\r
+\r
+        oConfig.hidedelay = nHideDelay;\r
+\r
+    }\r
+\r
+\r
+    /*\r
+        Only sync the "iframe" configuration property if the parent\r
+        menu's "position" configuration is the same.\r
+    */\r
+\r
+    if(\r
+        this.cfg.getProperty("position") ==\r
+        oParentMenu.cfg.getProperty("position")\r
+    ) {\r
+\r
+        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r
+\r
+    }\r
+\r
+\r
+    p_oSubmenu.cfg.applyConfig(oConfig);\r
+\r
+\r
+    if(!this.lazyLoad) {\r
+\r
+        if(Dom.inDocument(this.element)) {\r
+\r
+            this.render();\r
 \r
-        var aGroup = this._getItemGroup(p_nGroupIndex);\r
-        var nItems = aGroup.length;\r
-    \r
-        if(nItems > 0) {\r
-    \r
-            var Dom = this._oDom;\r
-            var i = nItems - 1;\r
-            var oItem;\r
-            var oLI;\r
-    \r
-            // Update the index and className properties of each member        \r
-        \r
-            do {\r
-    \r
-                oItem = aGroup[i];\r
-    \r
-                if(oItem) {\r
-        \r
-                    oLI = oItem.element;\r
-    \r
-                    oItem.index = i;\r
-                    oItem.groupIndex = p_nGroupIndex;\r
-    \r
-                    oLI.setAttribute("groupindex", p_nGroupIndex);\r
-                    oLI.setAttribute("index", i);\r
-    \r
-                    Dom.removeClass(oLI, "first-of-type");\r
-    \r
-                }\r
-        \r
-            }\r
-            while(i--);\r
-    \r
-    \r
-            if(oLI) {\r
-    \r
-                Dom.addClass(oLI, "first-of-type");\r
-    \r
-            }\r
-    \r
         }\r
-    \r
-    };\r
+        else {\r
+\r
+            this.render(this.parent.element);\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Creates a new item group (array) and it's associated HTMLUlElement node \r
+* @method _onSubmenuBeforeShow\r
+* @description "beforeshow" event handler for a submenu.\r
 * @private\r
-* @param {Number} p_nIndex Number indicating the group to create.\r
-* @return An item group.\r
-* @type Array\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._createItemGroup = function(p_nIndex) {\r
+_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
 \r
-    if(!this._aItemGroups[p_nIndex]) {\r
+    var oParent = this.parent;\r
+    var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
 \r
-        this._aItemGroups[p_nIndex] = [];\r
+    this.cfg.setProperty(\r
+        "context",\r
+        [oParent.element, aAlignment[0], aAlignment[1]]\r
+    );\r
 \r
-        var oUL = document.createElement("ul");\r
+    oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
 \r
-        this._aListElements[p_nIndex] = oUL;\r
+},\r
+\r
+\r
+/**\r
+* @method _onSubmenuShow\r
+* @description "show" event handler for a submenu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
+\r
+    var oParent = this.parent;\r
+\r
+    oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onSubmenuHide\r
+* @description "hide" Custom Event handler for a submenu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r
+\r
+    var oParent = this.parent;\r
+\r
+    oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onMenuItemFocus\r
+* @description "focus" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+* that fired the event.\r
+*/\r
+_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+    this.activeItem = p_oItem;\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onMenuItemBlur\r
+* @description "blur" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event\r
+* that was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+*/\r
+_onMenuItemBlur: function(p_sType, p_aArgs) {\r
+\r
+    this.activeItem = null;\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method _onMenuItemConfigChange\r
+* @description "configchange" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+* that fired the event.\r
+*/\r
+_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+    var sProperty = p_aArgs[0][0];\r
+\r
+    switch(sProperty) {\r
+\r
+        case "submenu":\r
+\r
+            var oSubmenu = p_aArgs[0][1];\r
+\r
+            if(oSubmenu) {\r
+\r
+                this._configureSubmenu(p_oItem);\r
+\r
+            }\r
+\r
+        break;\r
+\r
+        case "text":\r
+        case "helptext":\r
+\r
+            /*\r
+                A change to an item's "text" or "helptext"\r
+                configuration properties requires the width of the parent\r
+                menu to be recalculated.\r
+            */\r
+\r
+            if(this.element.style.width) {\r
+\r
+                var sWidth = this._getOffsetWidth() + "px";\r
+\r
+                Dom.setStyle(this.element, "width", sWidth);\r
+\r
+            }\r
+\r
+        break;\r
+\r
+    }\r
+\r
+},\r
+\r
+\r
+\r
+// Public event handlers for configuration properties\r
+\r
+\r
+/**\r
+* @method enforceConstraints\r
+* @description The default event handler executed when the moveEvent is fired,\r
+* if the "constraintoviewport" configuration property is set to true.\r
+* @param {String} type The name of the event that was fired.\r
+* @param {Array} args Collection of arguments sent when the\r
+* event was fired.\r
+* @param {Array} obj Array containing the current Menu instance\r
+* and the item that fired the event.\r
+*/\r
+enforceConstraints: function(type, args, obj) {\r
+\r
+    var oConfig = this.cfg;\r
+\r
+    var pos = args[0];\r
 \r
-        return this._aItemGroups[p_nIndex];\r
+    var x = pos[0];\r
+    var y = pos[1];\r
 \r
-    }\r
+    var bod = document.getElementsByTagName('body')[0];\r
+    var htm = document.getElementsByTagName('html')[0];\r
 \r
-};\r
+    var bodyOverflow = Dom.getStyle(bod, "overflow");\r
+    var htmOverflow = Dom.getStyle(htm, "overflow");\r
 \r
+    var offsetHeight = this.element.offsetHeight;\r
+    var offsetWidth = this.element.offsetWidth;\r
 \r
-/**\r
-* Returns the item group at the specified index.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the index of the item group to\r
-* be retrieved.\r
-* @return An array of items.\r
-* @type Array\r
-*/\r
-YAHOO.widget.MenuModule.prototype._getItemGroup = function(p_nIndex) {\r
+    var viewPortWidth = Dom.getClientWidth();\r
+    var viewPortHeight = Dom.getClientHeight();\r
 \r
-    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
+    var scrollX = window.scrollX || document.body.scrollLeft;\r
+    var scrollY = window.scrollY || document.body.scrollTop;\r
 \r
-    return this._aItemGroups[nIndex];\r
+    var topConstraint = scrollY + 10;\r
+    var leftConstraint = scrollX + 10;\r
+    var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
+    var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
 \r
-};\r
+    var aContext = oConfig.getProperty("context");\r
+    var oContextElement = aContext ? aContext[0] : null;\r
 \r
 \r
-/**\r
-* Subscribe's a MenuModule instance to it's parent MenuModule instance's events.\r
-* @private\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to listen\r
-* for events on.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._configureItemSubmenuModule = \r
+    if (x < 10) {\r
 \r
-    function(p_oItem) {\r
+        x = leftConstraint;\r
 \r
-        var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            /*\r
-                Listen for configuration changes to the parent MenuModule \r
-                instance so they they can be applied to the submenu.\r
-            */\r
-    \r
-            this.cfg.configChangedEvent.subscribe(\r
-                this._onParentMenuModuleConfigChange, \r
-                oSubmenu, \r
-                true\r
-            );\r
-            \r
-            this.renderEvent.subscribe(\r
-                this._onParentMenuModuleRender,\r
-                oSubmenu, \r
-                true\r
-            );\r
-    \r
-            oSubmenu.beforeShowEvent.subscribe(\r
-                this._onSubmenuBeforeShow, \r
-                oSubmenu, \r
-                true\r
-            );\r
-    \r
-            oSubmenu.showEvent.subscribe(this._onSubmenuShow, oSubmenu, true);\r
-    \r
-            oSubmenu.hideEvent.subscribe(this._onSubmenuHide, oSubmenu, true);\r
-    \r
-        }\r
+    } else if ((x + offsetWidth) > viewPortWidth) {\r
 \r
-};\r
+        if(\r
+            oContextElement &&\r
+            ((x - oContextElement.offsetWidth) > offsetWidth)\r
+        ) {\r
 \r
+            x = (x - (oContextElement.offsetWidth + offsetWidth));\r
 \r
-/**\r
-* Subscribes a MenuModule instance to the specified item's Custom Events.\r
-* @private\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to listen for events on.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._subscribeToItemEvents = function(p_oItem) {\r
+        }\r
+        else {\r
 \r
-    var aArguments = [this, p_oItem];\r
+            x = rightConstraint;\r
 \r
-    p_oItem.focusEvent.subscribe(this._onItemFocus, aArguments);\r
+        }\r
 \r
-    p_oItem.blurEvent.subscribe(this._onItemBlur, aArguments);\r
+    }\r
 \r
-    p_oItem.cfg.configChangedEvent.subscribe(\r
-        this._onItemConfigChange,\r
-        aArguments\r
-    );\r
+    if (y < 10) {\r
 \r
-};\r
+        y = topConstraint;\r
 \r
+    } else if (y > bottomConstraint) {\r
 \r
-/**\r
-* Returns the offset width of a MenuModule instance.\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._getOffsetWidth = function() {\r
+        if(oContextElement && (y > offsetHeight)) {\r
 \r
-    var oClone = this.element.cloneNode(true);\r
+            y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
 \r
-    this._oDom.setStyle(oClone, "width", "");\r
+        }\r
+        else {\r
 \r
-    document.body.appendChild(oClone);\r
+            y = bottomConstraint;\r
 \r
-    var sWidth = oClone.offsetWidth;\r
+        }\r
 \r
-    document.body.removeChild(oClone);\r
+    }\r
 \r
-    return sWidth;\r
+    oConfig.setProperty("x", x, true);\r
+    oConfig.setProperty("y", y, true);\r
 \r
-};\r
+},\r
 \r
 \r
 /**\r
-* Determines if a DOM event was fired on an item and (if so) fires the item's\r
-* associated Custom Event\r
-* @private\r
-* @param {HTMLElement} p_oElement The original target of the event.\r
-* @param {String} p_sEventType The type/name of the Custom Event to fire.\r
-* @param {Event} p_oDOMEvent The DOM event to pass back when firing the \r
-* Custom Event.\r
-* @return An item.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @method configVisible\r
+* @description Event handler for when the "visible" configuration property\r
+* the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._fireItemEvent = \r
+configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_oElement, p_sEventType, p_oDOMEvent) {\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-        var me = this;\r
-    \r
-        /**\r
-        * Returns the specified element's parent HTMLLIElement (&#60;LI&#60;)\r
-        * @param {p_oElement} An HTMLElement node\r
-        * @ignore\r
-        * @return Returns an HTMLElement node\r
-        * @type HTMLElement \r
-        */\r
-        function getItemElement(p_oElement) {\r
-        \r
-            if(p_oElement == me.element) {\r
-    \r
-                return;\r
-            \r
-            }\r
-            else if(p_oElement.tagName == "LI") {\r
-        \r
-                return p_oElement;\r
-        \r
-            }\r
-            else if(p_oElement.parentNode) {\r
-    \r
-                return getItemElement(p_oElement.parentNode);\r
-        \r
+        YAHOO.widget.Menu.superclass.configVisible.call(\r
+            this,\r
+            p_sType,\r
+            p_aArgs,\r
+            p_oMenu\r
+        );\r
+\r
+    }\r
+    else {\r
+\r
+        var bVisible = p_aArgs[0];\r
+       var sDisplay = Dom.getStyle(this.element, "display");\r
+\r
+        if(bVisible) {\r
+\r
+            if(sDisplay != "block") {\r
+                this.beforeShowEvent.fire();\r
+                Dom.setStyle(this.element, "display", "block");\r
+                this.showEvent.fire();\r
             }\r
-        \r
+\r
         }\r
-    \r
-    \r
-        var oElement = getItemElement(p_oElement);\r
-    \r
-        if(oElement) {\r
-    \r
-            /*\r
-                Retrieve the item that corresponds to the \r
-                HTMLLIElement (&#60;LI&#60;) and fire the Custom Event        \r
-            */\r
-    \r
-            var nGroupIndex = parseInt(oElement.getAttribute("groupindex"), 10);\r
-            var nIndex = parseInt(oElement.getAttribute("index"), 10);\r
-            var oItem = this._aItemGroups[nGroupIndex][nIndex];\r
-    \r
-            if(!oItem.cfg.getProperty("disabled")) {\r
-    \r
-                oItem[p_sEventType].fire(p_oDOMEvent);\r
-    \r
-                return oItem;\r
-    \r
-            }\r
-    \r
+        else {\r
+\r
+                       if(sDisplay == "block") {\r
+                               this.beforeHideEvent.fire();\r
+                               Dom.setStyle(this.element, "display", "none");\r
+                               this.hideEvent.fire();\r
+                       }\r
+\r
         }\r
 \r
-    };\r
+    }\r
 \r
+},\r
 \r
-// Private DOM event handlers\r
 \r
 /**\r
-* Generic event handler for the MenuModule's root HTMLDivElement node.  Used \r
-* to handle "mousedown," "mouseup," "keydown," "keyup," and "keypress" events.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event \r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
+* @method configPosition\r
+* @description Event handler for when the "position" configuration property\r
+* of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onDOMEvent = \r
+configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_oEvent, p_oMenuModule) {\r
+    var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
+    var oCfg = this.cfg;\r
 \r
-        var Event = this._oEventUtil;\r
+    Dom.setStyle(this.element, "position", sCSSPosition);\r
 \r
-        // Map of DOM event types to Custom Event types\r
 \r
-        var oEventTypes =  {\r
-                "mousedown": "mouseDownEvent",\r
-                "mouseup": "mouseUpEvent",\r
-                "keydown": "keyDownEvent",\r
-                "keyup": "keyUpEvent",\r
-                "keypress": "keyPressEvent"\r
-            };\r
-    \r
-        var sCustomEventType = oEventTypes[p_oEvent.type];\r
-        \r
-        var oTarget = Event.getTarget(p_oEvent);\r
-    \r
-        /*\r
-            Check if the target was an element that is a part of a \r
-            an item and (if so), fire the associated custom event.\r
-        */\r
-    \r
-        this._fireItemEvent(oTarget, sCustomEventType, p_oEvent);\r
-\r
-    \r
-        // Fire the associated custom event for the MenuModule\r
-    \r
-        this[sCustomEventType].fire(p_oEvent);\r
-    \r
-    \r
+    if(sCSSPosition == "static") {\r
+\r
         /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
+            Remove the iframe for statically positioned menus since it will\r
+            intercept mouse events.\r
         */\r
-            \r
-        Event.stopPropagation(p_oEvent);\r
-\r
-    };\r
 \r
+        oCfg.setProperty("iframe", false);\r
 \r
-/**\r
-* "mouseover" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event\r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onElementMouseOver = \r
 \r
-    function(p_oEvent, p_oMenuModule) {\r
+        // Statically positioned menus are visible by default\r
 \r
-        var Event = this._oEventUtil;\r
-        var oTarget = Event.getTarget(p_oEvent);\r
-    \r
-        if(\r
-            (\r
-                oTarget == this.element || \r
-                this._oDom.isAncestor(this.element, oTarget)\r
-            )  && \r
-            !this._bFiredMouseOverEvent\r
-        ) {\r
-    \r
-            // Fire the "mouseover" Custom Event for the MenuModule instance\r
-    \r
-            this.mouseOverEvent.fire(p_oEvent);\r
-    \r
-            this._bFiredMouseOverEvent = true;\r
-            this._bFiredMouseOutEvent = false;\r
-    \r
-        }\r
-    \r
-    \r
-        /*\r
-            Check if the target was an element that is a part of an item\r
-            and (if so), fire the "mouseover" Custom Event.\r
-        */\r
-    \r
-        if(!this._oCurrentItem) {\r
-    \r
-            this._oCurrentItem = \r
-                this._fireItemEvent(oTarget, "mouseOverEvent", p_oEvent);\r
-    \r
-        }\r
-    \r
-    \r
-        /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
-        */\r
-    \r
-        Event.stopPropagation(p_oEvent);\r
+        Dom.setStyle(this.element, "display", "block");\r
 \r
-    };\r
+        oCfg.setProperty("visible", true);\r
 \r
+    }\r
+    else {\r
 \r
-/**\r
-* "mouseout" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event\r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onElementMouseOut = \r
-\r
-    function(p_oEvent, p_oMenuModule) {\r
-\r
-        var Dom = this._oDom;\r
-        var Event = this._oEventUtil;\r
-        var oRelatedTarget = Event.getRelatedTarget(p_oEvent);\r
-        var bLIMouseOut = true;\r
-        var bMovingToSubmenu = false;\r
-            \r
-    \r
-        // Determine where the mouse is going\r
-    \r
-        if(this._oCurrentItem && oRelatedTarget) {\r
-    \r
-            if(\r
-                oRelatedTarget == this._oCurrentItem.element || \r
-                Dom.isAncestor(this._oCurrentItem.element, oRelatedTarget)\r
-            ) {\r
-    \r
-                bLIMouseOut = false;\r
-    \r
-            }\r
-    \r
-    \r
-            var oSubmenu = this._oCurrentItem.cfg.getProperty("submenu");\r
-    \r
-            if(\r
-                oSubmenu && \r
-                (\r
-                    oRelatedTarget == oSubmenu.element ||\r
-                    Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
-                )\r
-            ) {\r
-    \r
-                bMovingToSubmenu = true;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-    \r
-        if(this._oCurrentItem && (bLIMouseOut || bMovingToSubmenu)) {\r
-    \r
-            // Fire the "mouseout" Custom Event for the item\r
-    \r
-            this._oCurrentItem.mouseOutEvent.fire(p_oEvent);\r
-    \r
-            this._oCurrentItem = null;\r
-    \r
-        }\r
-    \r
-    \r
-        if(\r
-            !this._bFiredMouseOutEvent && \r
-            (\r
-                !Dom.isAncestor(this.element, oRelatedTarget) ||\r
-                bMovingToSubmenu\r
-            )\r
-        ) {\r
-    \r
-            // Fire the "mouseout" Custom Event for the MenuModule instance\r
-    \r
-            this.mouseOutEvent.fire(p_oEvent);\r
-    \r
-            this._bFiredMouseOutEvent = true;\r
-            this._bFiredMouseOverEvent = false;\r
-    \r
-        }\r
-    \r
-    \r
         /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
+            Even though the "visible" property is queued to\r
+            "false" by default, we need to set the "visibility" property to\r
+            "hidden" since Overlay's "configVisible" implementation checks the\r
+            element's "visibility" style property before deciding whether\r
+            or not to show an Overlay instance.\r
         */\r
-    \r
-        Event.stopPropagation(p_oEvent);\r
-\r
-    };\r
 \r
+        Dom.setStyle(this.element, "visibility", "hidden");\r
 \r
-/**\r
-* "click" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
-*/         \r
-YAHOO.widget.MenuModule.prototype._onElementClick = \r
+    }\r
 \r
-    function(p_oEvent, p_oMenuModule) {\r
 \r
-        var Event = this._oEventUtil;\r
-        \r
-        var oTarget = Event.getTarget(p_oEvent);\r
-        \r
-        /*\r
-            Check if the target was a DOM element that is a part of an\r
-            item and (if so), fire the associated "click" \r
-            Custom Event.\r
-        */\r
-        \r
-        var oItem = this._fireItemEvent(oTarget, "clickEvent", p_oEvent);\r
-        \r
-        var bCurrentPageURL; // Indicates if the URL points to the current page\r
-    \r
-    \r
-        if(oItem) {\r
-    \r
-            var sURL = oItem.cfg.getProperty("url");\r
-            var oSubmenu = oItem.cfg.getProperty("submenu");\r
-            \r
-            bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
-    \r
-            /*\r
-                ACCESSIBILITY FEATURE FOR SCREEN READERS: Expand/collapse the\r
-                submenu when the user clicks on the submenu indicator image.\r
-            */        \r
-    \r
-            if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
+    if(sCSSPosition == "absolute") {\r
 \r
-                if(oSubmenu.cfg.getProperty("visible")) {\r
-        \r
-                    oSubmenu.hide();\r
-        \r
-                }\r
-                else {\r
+        var nZIndex = oCfg.getProperty("zindex");\r
 \r
-                    var oActiveItem = this.activeItem;\r
-               \r
+        if(!nZIndex || nZIndex === 0) {\r
 \r
-                    // Hide any other submenus that might be visible\r
-                \r
-                    if(oActiveItem && oActiveItem != this) {\r
-                \r
-                        this.clearActiveItem();\r
-                \r
-                    }\r
+            nZIndex = this.parent ?\r
+                (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r
 \r
-                    this.activeItem = oItem;\r
-        \r
-                    oItem.cfg.setProperty("selected", true);\r
+            oCfg.setProperty("zindex", nZIndex);\r
 \r
-                    oSubmenu.show();\r
-        \r
-                }\r
-        \r
-            }\r
-            else if(oTarget.tagName != "A" && !bCurrentPageURL) {\r
-                \r
-                /*\r
-                    Follow the URL of the item regardless of whether or \r
-                    not the user clicked specifically on the\r
-                    HTMLAnchorElement (&#60;A&#60;) node.\r
-                */\r
-    \r
-                document.location = sURL;\r
-        \r
-            }\r
-        \r
-        }\r
-            \r
-    \r
-        switch(oTarget.tagName) {\r
-        \r
-            case "A":\r
-            \r
-                if(bCurrentPageURL) {\r
-    \r
-                    // Don't follow URLs that are equal to "#"\r
-    \r
-                    Event.preventDefault(p_oEvent);\r
-                \r
-                }\r
-                else {\r
-    \r
-                    /*\r
-                        Break if the anchor's URL is something other than "#" \r
-                        to prevent the call to "stopPropagation" from be \r
-                        executed.  This is required for Safari to be able to \r
-                        follow the URL.\r
-                    */\r
-                \r
-                    break;\r
-                \r
-                }\r
-            \r
-            default:\r
-    \r
-                /*\r
-                    Stop the propagation of the event at each MenuModule \r
-                    instance since Menus can be embedded in eachother.\r
-                */\r
-    \r
-                Event.stopPropagation(p_oEvent);\r
-            \r
-            break;\r
-        \r
         }\r
-    \r
-    \r
-        // Fire the associated "click" Custom Event for the MenuModule instance\r
-    \r
-        this.clickEvent.fire(p_oEvent);\r
-\r
-    };\r
 \r
+    }\r
 \r
-// Private Custom Event handlers\r
+},\r
 \r
 \r
 /**\r
-* "beforerender" Custom Event handler for a MenuModule instance.  Appends all \r
-* of the HTMLUListElement (&#60;UL&#60;s) nodes (and their child \r
-* HTMLLIElement (&#60;LI&#60;)) nodes and their accompanying title nodes to  \r
-* the body of the MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configIframe\r
+* @description Event handler for when the "iframe" configuration property of\r
+* the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onBeforeRender = \r
+configIframe: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-        var Dom = this._oDom;\r
-        var oConfig = this.cfg;\r
-        var oEl = this.element;\r
-        var nListElements = this._aListElements.length;\r
-    \r
-\r
-        if(oConfig.getProperty("position") == "static") {\r
-    \r
-            oConfig.queueProperty("iframe", false);\r
-            oConfig.queueProperty("visible", true);\r
-            \r
-        }\r
-    \r
-    \r
-        if(nListElements > 0) {\r
-    \r
-            var i = 0;\r
-            var bFirstList = true;\r
-            var oUL;\r
-            var oGroupTitle;\r
-    \r
-    \r
-            do {\r
-    \r
-                oUL = this._aListElements[i];\r
-    \r
-                if(oUL) {\r
-    \r
-                    if(bFirstList) {\r
-            \r
-                        Dom.addClass(oUL, "first-of-type");\r
-                        bFirstList = false;\r
-            \r
-                    }\r
-    \r
-    \r
-                    if(!Dom.isAncestor(oEl, oUL)) {\r
-    \r
-                        this.appendToBody(oUL);\r
-    \r
-                    }\r
-    \r
-    \r
-                    oGroupTitle = this._aGroupTitleElements[i];\r
-    \r
-                    if(oGroupTitle) {\r
-    \r
-                        if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
-    \r
-                            oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
-    \r
-                        }\r
-    \r
-    \r
-                        Dom.addClass(oUL, "hastitle");\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                i++;\r
-    \r
-            }\r
-            while(i < nListElements);\r
-    \r
-        }\r
+        YAHOO.widget.Menu.superclass.configIframe.call(\r
+            this,\r
+            p_sType,\r
+            p_aArgs,\r
+            p_oMenu\r
+        );\r
 \r
-    };\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* "render" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configHideDelay\r
+* @description Event handler for when the "hidedelay" configuration property\r
+* of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onRender = \r
+configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    var nHideDelay = p_aArgs[0];\r
+    var oMouseOutEvent = this.mouseOutEvent;\r
+    var oMouseOverEvent = this.mouseOverEvent;\r
+    var oKeyDownEvent = this.keyDownEvent;\r
+\r
+    if(nHideDelay > 0) {\r
+\r
+        /*\r
+            Only assign event handlers once. This way the user change\r
+            the value for the hidedelay as many times as they want.\r
+        */\r
+\r
+        if(!this._hideDelayEventHandlersAssigned) {\r
+\r
+            oMouseOutEvent.subscribe(this._execHideDelay, true);\r
+            oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r
+            oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r
+\r
+            this._hideDelayEventHandlersAssigned = true;\r
 \r
-        if(this.cfg.getProperty("position") == "dynamic") {\r
-    \r
-            var sWidth = this.element.parentNode.tagName == "BODY" ? \r
-                    this.element.offsetWidth : this._getOffsetWidth();\r
-        \r
-            this.cfg.setProperty("width", (sWidth + "px"));\r
-    \r
         }\r
 \r
-    };\r
+    }\r
+    else {\r
+\r
+        oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r
+        oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r
+        oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r
+\r
+        this._hideDelayEventHandlersAssigned = false;\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* "show" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configContainer\r
+* @description Event handler for when the "container" configuration property\r
+of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onShow = \r
+configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
-    \r
-        /*\r
-            Setting focus to an item in the newly visible submenu alerts the \r
-            contents of the submenu to the screen reader.\r
-        */\r
+       var oElement = p_aArgs[0];\r
 \r
-        this.setInitialFocus();\r
-    \r
-    };\r
+       if(typeof oElement == 'string') {\r
+\r
+        this.cfg.setProperty(\r
+                "container",\r
+                document.getElementById(oElement),\r
+                true\r
+            );\r
+\r
+       }\r
+\r
+},\r
+\r
+\r
+\r
+// Public methods\r
 \r
 \r
 /**\r
-* "hide" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* Event handler called when the resize monitor element's "resize" evet is fired.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onBeforeHide = \r
+onDomResize: function(e, obj) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    if(!this._handleResize) {\r
 \r
-        var oActiveItem = this.activeItem;\r
+        this._handleResize = true;\r
+        return;\r
 \r
-        if(oActiveItem) {\r
-    \r
-            oActiveItem.blur();\r
+    }\r
 \r
-            if(oActiveItem.cfg.getProperty("selected")) {\r
-    \r
-                oActiveItem.cfg.setProperty("selected", false);\r
-    \r
-            }\r
-    \r
-            var oSubmenu = oActiveItem.cfg.getProperty("submenu");\r
-    \r
-            if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
-    \r
-                oSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\r
+    var oConfig = this.cfg;\r
 \r
-    };\r
+    if(oConfig.getProperty("position") == "dynamic") {\r
+\r
+        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
+\r
+    }\r
+\r
+    YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
+\r
+},\r
 \r
 \r
 /**\r
-* "configchange" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that subscribed\r
-* to the event.\r
+* @method initEvents\r
+* @description Initializes the custom events for the menu.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onParentMenuModuleConfigChange = \r
-\r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var sPropertyName = p_aArgs[0][0];\r
-        var oPropertyValue = p_aArgs[0][1];\r
-    \r
-        switch(sPropertyName) {\r
-    \r
-            case "iframe":\r
-            case "constraintoviewport":\r
-    \r
-                p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
-                    \r
-            break;        \r
-            \r
-        }\r
-    \r
-    };\r
+initEvents: function() {\r
+\r
+       YAHOO.widget.Menu.superclass.initEvents.call(this);\r
+\r
+    // Create custom events\r
+\r
+    var CustomEvent = YAHOO.util.CustomEvent;\r
+\r
+    this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
+    this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
+    this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
+    this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
+    this.clickEvent = new CustomEvent("clickEvent", this);\r
+    this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
+    this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
+    this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
+    this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r
+    this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r
+\r
+},\r
 \r
 \r
 /**\r
-* "render" Custom Event handler for a MenuModule instance.  Renders a  \r
-* submenu in response to the firing of it's parent's "render" event.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that subscribed\r
-* to the event.\r
+* @method getRoot\r
+* @description Finds the menu's root menu.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onParentMenuModuleRender = \r
+getRoot: function() {\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
+    var oItem = this.parent;\r
 \r
-        /*\r
-            Set the "iframe" and "constraintoviewport" configuration \r
-            properties to match the parent MenuModule\r
-        */ \r
-    \r
-        var oParentMenu = p_oSubmenu.parent.parent;\r
-    \r
-        p_oSubmenu.cfg.applyConfig(\r
-        \r
-            {\r
-                constraintoviewport: \r
-                    oParentMenu.cfg.getProperty("constraintoviewport"),\r
-    \r
-                xy: [0,0],\r
-    \r
-                iframe: oParentMenu.cfg.getProperty("iframe")\r
-    \r
-            }\r
-        \r
-        );\r
-    \r
-    \r
-        if(this._oDom.inDocument(this.element)) {\r
-    \r
-            this.render();\r
-    \r
-        }\r
-        else {\r
-    \r
-            this.render(this.parent.element);\r
-    \r
-        }\r
-    \r
-    };\r
+    if(oItem) {\r
+\r
+        var oParentMenu = oItem.parent;\r
+\r
+        return oParentMenu ? oParentMenu.getRoot() : this;\r
+\r
+    }\r
+    else {\r
+\r
+        return this;\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* "beforeshow" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
+* @method toString\r
+* @description Returns a string representing the menu.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuModule.prototype._onSubmenuBeforeShow = \r
-\r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
-        var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
+toString: function() {\r
 \r
-        this.cfg.setProperty(\r
-            "context", \r
-            [\r
-                oParent.element, \r
-                aAlignment[0], \r
-                aAlignment[1]\r
-            ]\r
-        );\r
+    return ("Menu " + this.id);\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
+},\r
 \r
 \r
 /**\r
-* "show" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
+* @method setItemGroupTitle\r
+* @description Sets the title of a group of menu items.\r
+* @param {String} p_sGroupTitle String specifying the title of the group.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r
+* the title belongs.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onSubmenuShow = \r
+setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
+    if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
+        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+        var oTitle = this._aGroupTitleElements[nGroupIndex];\r
 \r
 \r
-/**\r
-* "hide" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onSubmenuHide = \r
+        if(oTitle) {\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
+            oTitle.innerHTML = p_sGroupTitle;\r
+\r
+        }\r
+        else {\r
+\r
+            oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
 \r
-        if(oParent.parent.cfg.getProperty("visible")) {\r
+            oTitle.innerHTML = p_sGroupTitle;\r
+\r
+            this._aGroupTitleElements[nGroupIndex] = oTitle;\r
 \r
-            oParent.cfg.setProperty("selected", false);\r
-    \r
-            oParent.focus();\r
-        \r
         }\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
 \r
+        var i = this._aGroupTitleElements.length - 1;\r
+        var nFirstIndex;\r
 \r
-/**\r
-* "focus" YAHOO.util.CustomEvent handler for a MenuModule instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemFocus = \r
-\r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-    \r
-        var me = p_aObjects[0];\r
-        var oItem = p_aObjects[1];\r
-    \r
-        me.activeItem = oItem;\r
-    \r
-    };\r
+        do {\r
 \r
+            if(this._aGroupTitleElements[i]) {\r
 \r
-/**\r
-* "blur" YAHOO.util.CustomEvent handler for a MenuModule instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemBlur = \r
+                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r
+\r
+                nFirstIndex = i;\r
+\r
+            }\r
 \r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-    \r
-        var me = p_aObjects[0];\r
-        var oItem = p_aObjects[1];\r
-        var oSubmenu = oItem.cfg.getProperty("submenu");\r
-    \r
-        if(!oSubmenu || (oSubmenu && !oSubmenu.cfg.getProperty("visible"))) {\r
-    \r
-            me.activeItem = null;\r
-    \r
         }\r
-    \r
-    };\r
+        while(i--);\r
 \r
 \r
-/**\r
-* "configchange" YAHOO.util.CustomEvent handler for the MenuModule \r
-* instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemConfigChange = \r
-\r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-\r
-        var me = p_aObjects[0];    \r
-        var sProperty = p_aArgs[0][0];\r
-        var oItem = p_aObjects[1];\r
-    \r
-        switch(sProperty) {\r
-    \r
-            case "submenu":\r
-    \r
-                var oSubmenu = p_aArgs[0][1];\r
-    \r
-                if(oSubmenu) {\r
-    \r
-                    me._configureItemSubmenuModule(oItem);\r
-    \r
-                }\r
-    \r
-            break;\r
-    \r
-            case "text":\r
-            case "helptext":\r
-    \r
-                /*\r
-                    A change to an item's "text" or "helptext"\r
-                    configuration properties requires the width of the parent\r
-                    MenuModule instance to be recalculated.\r
-                */\r
-    \r
-                if(me.element.style.width) {\r
-        \r
-                    var sWidth = me._getOffsetWidth() + "px";\r
-    \r
-                    me._oDom.setStyle(me.element, "width", sWidth);\r
-    \r
-                }\r
-    \r
-            break;\r
-    \r
+        if(nFirstIndex !== null) {\r
+\r
+            Dom.addClass(\r
+                this._aGroupTitleElements[nFirstIndex],\r
+                "first-of-type"\r
+            );\r
+\r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
+\r
 \r
 \r
 /**\r
-* The default event handler executed when the moveEvent is fired, if the \r
-* "constraintoviewport" configuration property is set to true.\r
+* @method addItem\r
+* @description Appends an item to the menu.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r
+* which the item belongs.\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.enforceConstraints = \r
+addItem: function(p_oItem, p_nGroupIndex) {\r
 \r
-    function(type, args, obj) {\r
+    if(p_oItem) {\r
 \r
-        var Dom = this._oDom;\r
-        var oConfig = this.cfg;\r
-    \r
-        var pos = args[0];\r
-            \r
-        var x = pos[0];\r
-        var y = pos[1];\r
-        \r
-        var bod = document.getElementsByTagName('body')[0];\r
-        var htm = document.getElementsByTagName('html')[0];\r
-        \r
-        var bodyOverflow = Dom.getStyle(bod, "overflow");\r
-        var htmOverflow = Dom.getStyle(htm, "overflow");\r
-        \r
-        var offsetHeight = this.element.offsetHeight;\r
-        var offsetWidth = this.element.offsetWidth;\r
-        \r
-        var viewPortWidth = Dom.getClientWidth();\r
-        var viewPortHeight = Dom.getClientHeight();\r
-        \r
-        var scrollX = window.scrollX || document.body.scrollLeft;\r
-        var scrollY = window.scrollY || document.body.scrollTop;\r
-        \r
-        var topConstraint = scrollY + 10;\r
-        var leftConstraint = scrollX + 10;\r
-        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
-        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-        \r
-        var aContext = oConfig.getProperty("context");\r
-        var oContextElement = aContext ? aContext[0] : null;\r
-    \r
-    \r
-        if (x < 10) {\r
-    \r
-            x = leftConstraint;\r
-    \r
-        } else if ((x + offsetWidth) > viewPortWidth) {\r
-    \r
-            if(\r
-                oContextElement && \r
-                ((x - oContextElement.offsetWidth) > offsetWidth)\r
-            ) {\r
-    \r
-                x = (x - (oContextElement.offsetWidth + offsetWidth));\r
-    \r
-            }\r
-            else {\r
-    \r
-                x = rightConstraint;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-        if (y < 10) {\r
-    \r
-            y = topConstraint;\r
-    \r
-        } else if (y > bottomConstraint) {\r
-    \r
-            if(oContextElement && (y > offsetHeight)) {\r
-    \r
-                y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
-    \r
-            }\r
-            else {\r
-    \r
-                y = bottomConstraint;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-        oConfig.setProperty("x", x, true);\r
-        oConfig.setProperty("y", y, true);\r
-    \r
-    };\r
+        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
 \r
+    }\r
+\r
+},\r
 \r
-// Event handlers for configuration properties\r
 \r
 /**\r
-* Event handler for when the "position" configuration property of a\r
-* MenuModule changes.\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance fired\r
-* the event.\r
-* @see YAHOO.widget.Overlay#configIframe\r
+* @method addItems\r
+* @description Adds an array of items to the menu.\r
+* @param {Array} p_aItems Array of items to be added to the menu.  The array\r
+* can contain strings specifying the text for each item to be created, object\r
+* literals specifying each of the menu item configuration properties,\r
+* or MenuItem instances.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
+* which the items belongs.\r
+* @return {Array}\r
 */\r
-YAHOO.widget.MenuModule.prototype.configPosition = \r
+addItems: function(p_aItems, p_nGroupIndex) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    function isArray(p_oValue) {\r
 \r
-        var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
-    \r
-        this._oDom.setStyle(this.element, "position", sCSSPosition);\r
-    \r
-    };\r
+        return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
 \r
+    }\r
 \r
-// Public methods\r
 \r
-YAHOO.widget.MenuModule.prototype.toString = function() {\r
+    if(isArray(p_aItems)) {\r
 \r
-    return ("Menu " + this.id);\r
+        var nItems = p_aItems.length;\r
+        var aItems = [];\r
+        var oItem;\r
 \r
-};\r
 \r
+        for(var i=0; i<nItems; i++) {\r
+\r
+            oItem = p_aItems[i];\r
+\r
+            if(isArray(oItem)) {\r
+\r
+                aItems[aItems.length] = this.addItems(oItem, i);\r
 \r
-/**\r
-* Sets the title of a group of items.\r
-* @param {String} p_sGroupTitle The title of the group.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the title belongs.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.setItemGroupTitle = \r
-\r
-    function(p_sGroupTitle, p_nGroupIndex) {\r
-        \r
-        if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-    \r
-            var Dom = this._oDom;\r
-\r
-            var nGroupIndex = \r
-                    typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-    \r
-            var oTitle = this._aGroupTitleElements[nGroupIndex];\r
-    \r
-    \r
-            if(oTitle) {\r
-    \r
-                oTitle.innerHTML = p_sGroupTitle;\r
-                \r
             }\r
             else {\r
-    \r
-                oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
-                        \r
-                oTitle.innerHTML = p_sGroupTitle;\r
-    \r
-                this._aGroupTitleElements[nGroupIndex] = oTitle;\r
-    \r
-            }\r
-    \r
-    \r
-            var i = this._aGroupTitleElements.length - 1;\r
-            var nFirstIndex;\r
-    \r
-            do {\r
-    \r
-                if(this._aGroupTitleElements[i]) {\r
-    \r
-                    Dom.removeClass(\r
-                        this._aGroupTitleElements[i],\r
-                        "first-of-type"\r
-                    );\r
 \r
-                    nFirstIndex = i;\r
-    \r
-                }\r
-    \r
-            }\r
-            while(i--);\r
-    \r
-    \r
-            if(nFirstIndex !== null) {\r
-    \r
-                Dom.addClass(\r
-                    this._aGroupTitleElements[nFirstIndex], \r
-                    "first-of-type"\r
-                );\r
-    \r
+                aItems[aItems.length] =\r
+                    this._addItemToGroup(p_nGroupIndex, oItem);\r
+\r
             }\r
-    \r
+\r
+        }\r
+\r
+\r
+        if(aItems.length) {\r
+\r
+            return aItems;\r
+\r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Appends the specified item to a MenuModule instance.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be added.\r
+* @method insertItem\r
+* @description Inserts an item into the menu at the specified index.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r
+* the item should be added.\r
 * @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
 * the item belongs.\r
-* @return The item that was added to the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.addItem = function(p_oItem, p_nGroupIndex) {\r
+insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
 \r
     if(p_oItem) {\r
 \r
-        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-        \r
+        return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
+\r
     }\r
 \r
-};\r
+},\r
 \r
 \r
 /**\r
-* Inserts an item into a MenuModule instance at the specified index.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be inserted.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position \r
-* at which the item should be added.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return The item that was inserted into the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @method removeItem\r
+* @description Removes the specified item from the menu.\r
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r
+* instance to be removed from the menu.\r
+* @param {Number} p_oObject Number specifying the index of the item\r
+* to be removed.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
+* which the item belongs.\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.insertItem = \r
-\r
-    function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
-    \r
-        if(p_oItem) {\r
-    \r
-            return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
-    \r
+removeItem: function(p_oObject, p_nGroupIndex) {\r
+\r
+    if(typeof p_oObject != "undefined") {\r
+\r
+        var oItem;\r
+\r
+        if(p_oObject instanceof YAHOO.widget.MenuItem) {\r
+\r
+            oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r
+\r
         }\r
-    \r
-    };\r
+        else if(typeof p_oObject == "number") {\r
 \r
+            oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
 \r
-/**\r
-* Removes the specified item from a MenuModule instance.\r
-* @param {YAHOO.widget.MenuModuleItem/Number} p_oObject The item or index of \r
-* the item to be removed.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return The item that was removed from the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype.removeItem =\r
-\r
-    function(p_oObject, p_nGroupIndex) {\r
-    \r
-        if(typeof p_oObject != "undefined") {\r
-    \r
-            var oItem;\r
-    \r
-            if(p_oObject instanceof YAHOO.widget.MenuModuleItem) {\r
-    \r
-                oItem = \r
-                    this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);           \r
-    \r
-            }\r
-            else if(typeof p_oObject == "number") {\r
-    \r
-                oItem = \r
-                    this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
-    \r
-            }\r
-    \r
-            if(oItem) {\r
-    \r
-                oItem.destroy();\r
-\r
-                this.logger.log("Item removed." + \r
-                    " Text: " + oItem.cfg.getProperty("text") + ", " + \r
-                    " Index: " + oItem.index + ", " + \r
-                    " Group Index: " + oItem.groupIndex);\r
-    \r
-                return oItem;\r
-    \r
-            }\r
-    \r
         }\r
-    \r
-    };\r
+\r
+        if(oItem) {\r
+\r
+            oItem.destroy();\r
+\r
+            this.logger.log("Item removed." +\r
+                " Text: " + oItem.cfg.getProperty("text") + ", " +\r
+                " Index: " + oItem.index + ", " +\r
+                " Group Index: " + oItem.groupIndex);\r
+\r
+            return oItem;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Returns a multi-dimensional array of all of a MenuModule's items.\r
-* @return An array of items.\r
-* @type Array\r
-*/        \r
-YAHOO.widget.MenuModule.prototype.getItemGroups = function() {\r
+* @method getItemGroups\r
+* @description Returns a multi-dimensional array of all of the items in the menu.\r
+* @return {Array}\r
+*/\r
+getItemGroups: function() {\r
 \r
     return this._aItemGroups;\r
 \r
-};\r
+},\r
 \r
 \r
 /**\r
-* Returns the item at the specified index.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position of the \r
+* @method getItem\r
+* @description Returns the item at the specified index.\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r
 * item to be retrieved.\r
 * @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
 * the item belongs.\r
-* @return An item.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.getItem = \r
+getItem: function(p_nItemIndex, p_nGroupIndex) {\r
 \r
-    function(p_nItemIndex, p_nGroupIndex) {\r
-    \r
-        if(typeof p_nItemIndex == "number") {\r
-    \r
-            var aGroup = this._getItemGroup(p_nGroupIndex);\r
-    \r
-            if(aGroup) {\r
-    \r
-                return aGroup[p_nItemIndex];\r
-            \r
-            }\r
-    \r
-        }\r
-    \r
-    };\r
+    if(typeof p_nItemIndex == "number") {\r
 \r
+        var aGroup = this._getItemGroup(p_nGroupIndex);\r
 \r
-/**\r
-* Removes the MenuModule instance's element from the DOM and sets all child \r
-* elements to null.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.destroy = function() {\r
+        if(aGroup) {\r
+\r
+            return aGroup[p_nItemIndex];\r
+\r
+        }\r
 \r
-    // Remove DOM event handlers\r
+    }\r
+\r
+},\r
 \r
-    this._oEventUtil.purgeElement(this.element);\r
 \r
+/**\r
+* @method destroy\r
+* @description Removes the menu's <code>&#60;div&#62;</code> element\r
+* (and accompanying child nodes) from the document.\r
+*/\r
+destroy: function() {\r
 \r
     // Remove Custom Event listeners\r
 \r
@@ -2290,7 +3748,6 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
     this.keyPressEvent.unsubscribeAll();\r
     this.keyDownEvent.unsubscribeAll();\r
     this.keyUpEvent.unsubscribeAll();\r
-    this.beforeMoveEvent.unsubscribeAll();\r
 \r
 \r
     var nItemGroups = this._aItemGroups.length;\r
@@ -2314,23 +3771,23 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
             if(oItemGroup) {\r
 \r
                 nItems = oItemGroup.length;\r
-    \r
+\r
                 if(nItems > 0) {\r
-    \r
+\r
                     n = nItems - 1;\r
-        \r
+\r
                     do {\r
 \r
                         oItem = this._aItemGroups[i][n];\r
 \r
                         if(oItem) {\r
-        \r
+\r
                             oItem.destroy();\r
                         }\r
-        \r
+\r
                     }\r
                     while(n--);\r
-    \r
+\r
                 }\r
 \r
             }\r
@@ -2338,133 +3795,359 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
         }\r
         while(i--);\r
 \r
-    }        \r
+    }\r
 \r
 \r
     // Continue with the superclass implementation of this method\r
 \r
-    YAHOO.widget.MenuModule.superclass.destroy.call(this);\r
-    \r
-    this.logger.log("Destroyed.");\r
-\r
-};\r
+    YAHOO.widget.Menu.superclass.destroy.call(this);\r
 \r
+    this.logger.log("Destroyed.");\r
 \r
+},\r
 \r
 \r
 /**\r
-* Sets focus to a MenuModule instance's first enabled item.\r
+* @method setInitialFocus\r
+* @description Sets focus to the menu's first enabled item.\r
 */\r
-YAHOO.widget.MenuModule.prototype.setInitialFocus = function() {\r
+setInitialFocus: function() {\r
 \r
     var oItem = this._getFirstEnabledItem();\r
-    \r
+\r
     if(oItem) {\r
-    \r
+\r
         oItem.focus();\r
     }\r
-    \r
-};\r
+\r
+},\r
 \r
 \r
 /**\r
-* Sets the "selected" configuration property of a MenuModule instance's first\r
+* @method setInitialSelection\r
+* @description Sets the "selected" configuration property of the menu's first\r
 * enabled item to "true."\r
 */\r
-YAHOO.widget.MenuModule.prototype.setInitialSelection = function() {\r
+setInitialSelection: function() {\r
 \r
     var oItem = this._getFirstEnabledItem();\r
-    \r
+\r
     if(oItem) {\r
-    \r
+\r
         oItem.cfg.setProperty("selected", true);\r
-    }        \r
+    }\r
+\r
+},\r
+\r
+\r
+/**\r
+* @method clearActiveItem\r
+* @description Sets the "selected" configuration property of the menu's active\r
+* item to "false" and hides the item's submenu.\r
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r
+* should be blurred.\r
+*/\r
+clearActiveItem: function(p_bBlur) {\r
+\r
+    if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+        this._cancelShowDelay();\r
+\r
+    }\r
 \r
-};\r
+\r
+    var oActiveItem = this.activeItem;\r
+\r
+    if(oActiveItem) {\r
+\r
+        var oConfig = oActiveItem.cfg;\r
+\r
+        oConfig.setProperty("selected", false);\r
+\r
+        var oSubmenu = oConfig.getProperty("submenu");\r
+\r
+        if(oSubmenu) {\r
+\r
+            oSubmenu.hide();\r
+\r
+        }\r
+\r
+        if(p_bBlur) {\r
+\r
+            oActiveItem.blur();\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 \r
 /**\r
-* Sets the "selected" configuration property of a MenuModule instance's active \r
-* item to "false," blurs the item and hide's the item's submenu.\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the menu's Config object ("cfg").\r
+* @method initDefaultConfig\r
 */\r
-YAHOO.widget.MenuModule.prototype.clearActiveItem = function () {\r
+initDefaultConfig: function() {\r
+\r
+    YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r
+\r
+    var oConfig = this.cfg;\r
+\r
+       // Add configuration properties\r
+\r
+    /*\r
+        Change the default value for the "visible" configuration\r
+        property to "false" by re-adding the property.\r
+    */\r
+\r
+    /**\r
+    * @config visible\r
+    * @description Boolean indicating whether or not the menu is visible.  If\r
+    * the menu's "position" configuration property is set to "dynamic" (the\r
+    * default), this property toggles the menu's <code>&#60;div&#62;</code>\r
+    * element's "visibility" style property between "visible" (true) or\r
+    * "hidden" (false).  If the menu's "position" configuration property is\r
+    * set to "static" this property toggles the menu's\r
+    * <code>&#60;div&#62;</code> element's "display" style property\r
+    * between "block" (true) or "none" (false).\r
+    * @default false\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "visible",\r
+        {\r
+            value:false,\r
+            handler:this.configVisible,\r
+            validator:this.cfg.checkBoolean\r
+         }\r
+     );\r
+\r
+\r
+    /*\r
+        Change the default value for the "constraintoviewport" configuration\r
+        property to "true" by re-adding the property.\r
+    */\r
+\r
+    /**\r
+    * @config constraintoviewport\r
+    * @description Boolean indicating if the menu will try to remain inside\r
+    * the boundaries of the size of viewport.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "constraintoviewport",\r
+        {\r
+            value:true,\r
+            handler:this.configConstrainToViewport,\r
+            validator:this.cfg.checkBoolean,\r
+            supercedes:["iframe","x","y","xy"]\r
+        }\r
+    );\r
+\r
 \r
-    if(this.activeItem) {\r
+    /**\r
+    * @config position\r
+    * @description String indicating how a menu should be positioned on the\r
+    * screen.  Possible values are "static" and "dynamic."  Static menus are\r
+    * visible by default and reside in the normal flow of the document\r
+    * (CSS position: static).  Dynamic menus are hidden by default, reside\r
+    * out of the normal flow of the document (CSS position: absolute), and\r
+    * can overlay other elements on the screen.\r
+    * @default dynamic\r
+    * @type String\r
+    */\r
+    oConfig.addProperty(\r
+        "position",\r
+        {\r
+            value: "dynamic",\r
+            handler: this.configPosition,\r
+            validator: this._checkPosition,\r
+            supercedes: ["visible"]\r
+        }\r
+    );\r
+\r
+\r
+    /**\r
+    * @config submenualignment\r
+    * @description Array defining how submenus should be aligned to their\r
+    * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r
+    * a submenu's top left corner is aligned to its parent menu item's top\r
+    * right corner.\r
+    * @default ["tl","tr"]\r
+    * @type Array\r
+    */\r
+    oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
+\r
+\r
+    /**\r
+    * @config autosubmenudisplay\r
+    * @description Boolean indicating if submenus are automatically made\r
+    * visible when the user mouses over the menu's items.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+       oConfig.addProperty(\r
+          "autosubmenudisplay",\r
+          {\r
+              value: true,\r
+              validator: oConfig.checkBoolean\r
+       }\r
+    );\r
 \r
-        var oConfig = this.activeItem.cfg;\r
 \r
-        oConfig.setProperty("selected", false);\r
+    /**\r
+    * @config showdelay\r
+    * @description Number indicating the time (in milliseconds) that should\r
+    * expire before a submenu is made visible when the user mouses over\r
+    * the menu's items.\r
+    * @default 0\r
+    * @type Number\r
+    */\r
+       oConfig.addProperty(\r
+          "showdelay",\r
+          {\r
+              value: 0,\r
+              validator: oConfig.checkNumber\r
+       }\r
+    );\r
 \r
-        var oSubmenu = oConfig.getProperty("submenu");\r
 \r
-        if(oSubmenu) {\r
+    /**\r
+    * @config hidedelay\r
+    * @description Number indicating the time (in milliseconds) that should\r
+    * expire before the menu is hidden.\r
+    * @default 0\r
+    * @type Number\r
+    */\r
+       oConfig.addProperty(\r
+          "hidedelay",\r
+          {\r
+              value: 0,\r
+              validator: oConfig.checkNumber,\r
+              handler: this.configHideDelay,\r
+              suppressEvent: true\r
+       }\r
+    );\r
 \r
-            oSubmenu.hide();\r
 \r
+    /**\r
+    * @config clicktohide\r
+    * @description Boolean indicating if the menu will automatically be\r
+    * hidden if the user clicks outside of it.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "clicktohide",\r
+        {\r
+            value: true,\r
+            validator: oConfig.checkBoolean\r
         }\r
-\r
-    }\r
-\r
-};\r
+    );\r
 \r
 \r
-/**\r
-* Initializes the class's configurable properties which can be changed using \r
-* the MenuModule's Config object (cfg).\r
-*/\r
-YAHOO.widget.MenuModule.prototype.initDefaultConfig = function() {\r
+       /**\r
+       * @config container\r
+       * @description HTML element reference or string specifying the id\r
+       * attribute of the HTML element that the menu's markup should be rendered into.\r
+       * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+       * level-one-html.html#ID-58190037">HTMLElement</a>|String\r
+       * @default document.body\r
+       */\r
+       this.cfg.addProperty(\r
+          "container",\r
+          { value:document.body, handler:this.configContainer }\r
+   );\r
 \r
-    YAHOO.widget.MenuModule.superclass.initDefaultConfig.call(this);\r
+}\r
 \r
-    var oConfig = this.cfg;\r
+}); // END YAHOO.extend\r
 \r
-       // Add configuration properties\r
+})();\r
 \r
-    oConfig.addProperty(\r
-        "position", \r
-        {\r
-            value: "dynamic", \r
-            handler: this.configPosition, \r
-            validator: this._checkPosition \r
-        } \r
-    );\r
 \r
-    oConfig.refireEvent("position");\r
+/**\r
+* The base class for all menuing containers.\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu module.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu module.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929\r
+* /level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu module.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu module.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu module. See configuration class documentation for\r
+* more details.\r
+* @class MenuModule\r
+* @constructor\r
+* @extends YAHOO.widget.Overlay\r
+* @deprecated As of version 0.12, all MenuModule functionality has been\r
+* implemented directly in YAHOO.widget.Menu, making YAHOO.widget.Menu the base\r
+* class for all menuing containers.\r
+*/\r
+YAHOO.widget.MenuModule = YAHOO.widget.Menu;\r
 \r
-    oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
 \r
-};\r
+(function() {\r
 \r
+var Dom = YAHOO.util.Dom;\r
+var Module = YAHOO.widget.Module;\r
+var Menu = YAHOO.widget.Menu;\r
 \r
 \r
 /**\r
-* @class The MenuModuleItem class allows you to create and modify an item for a\r
-* MenuModule instance.\r
+* Creates an item for a menu.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying\r
+* the <code>&#60;li&#62;</code> element of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object\r
+* specifying the <code>&#60;option&#62;</code> element of the menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu item. See configuration class documentation\r
+* for more details.\r
+* @class MenuItem\r
 * @constructor\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuModuleItem instance. See the configuration \r
-* class documentation for more details.\r
 */\r
-YAHOO.widget.MenuModuleItem = function(p_oObject, p_oConfig) {\r
+YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {\r
 \r
     if(p_oObject) {\r
 \r
+        if(p_oConfig) {\r
+\r
+            this.parent = p_oConfig.parent;\r
+            this.value = p_oConfig.value;\r
+\r
+        }\r
+\r
         this.init(p_oObject, p_oConfig);\r
 \r
     }\r
 \r
 };\r
 \r
-YAHOO.widget.MenuModuleItem.prototype = {\r
+YAHOO.widget.MenuItem.prototype = {\r
 \r
     // Constants\r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator.\r
+    * @property SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * menu item's submenu arrow indicator.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_nrm_1.gif"\r
     * @final\r
     * @type String\r
     */\r
@@ -2472,28 +4155,34 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator when a MenuModuleItem instance is selected.\r
+    * @property SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * submenu arrow indicator when the menu item is selected.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_hov_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: \r
+    SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:\r
         "nt/ic/ut/alt1/menuarorght8_hov_1.gif",\r
 \r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator when a MenuModuleItem instance is disabled.\r
+    * @property DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * submenu arrow indicator when the menu item is disabled.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_dim_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: \r
+    DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:\r
         "nt/ic/ut/alt1/menuarorght8_dim_1.gif",\r
 \r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator.\r
+    * @property COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator.\r
+    * @default "Collapsed.  Click to expand."\r
     * @final\r
     * @type String\r
     */\r
@@ -2501,8 +4190,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator when the submenu is visible.\r
+    * @property EXPANDED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator when the submenu is visible.\r
+    * @default "Expanded.  Click to collapse."\r
     * @final\r
     * @type String\r
     */\r
@@ -2510,8 +4201,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator when a MenuModuleItem instance is disabled.\r
+    * @property DISABLED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator when the menu item is disabled.\r
+    * @default "Disabled."\r
     * @final\r
     * @type String\r
     */\r
@@ -2519,289 +4212,398 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Constant representing the CSS class(es) to be applied to the root \r
-    * HTMLLIElement of the MenuModuleItem.\r
+    * @property CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_nrm_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    CSS_CLASS_NAME: "yuimenuitem",\r
+    CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_nrm_1.gif",\r
 \r
 \r
     /**\r
-    * Constant representing the type of menu to instantiate when creating \r
-    * submenu instances from parsing the child nodes (either HTMLSelectElement \r
-    * or HTMLDivElement) of the item's DOM.  The default \r
-    * is YAHOO.widget.MenuModule.\r
+    * @property SELECTED_CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the selected checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_hov_1.gif"\r
     * @final\r
-    * @type YAHOO.widget.MenuModule\r
+    * @type String\r
     */\r
-    SUBMENU_TYPE: null,\r
+    SELECTED_CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_hov_1.gif",\r
+\r
+\r
+    /**\r
+    * @property DISABLED_CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the disabled checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_dim_1.gif"\r
+    * @final\r
+    * @type String\r
+    */\r
+    DISABLED_CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_dim_1.gif",\r
+\r
+\r
+    /**\r
+    * @property CHECKED_IMAGE_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the checked image.\r
+    * @default "Checked."\r
+    * @final\r
+    * @type String\r
+    */\r
+    CHECKED_IMAGE_ALT_TEXT: "Checked.",\r
+\r
+\r
+    /**\r
+    * @property DISABLED_CHECKED_IMAGE_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the checked image when the item is disabled.\r
+    * @default "Checked. (Item disabled.)"\r
+    * @final\r
+    * @type String\r
+    */\r
+    DISABLED_CHECKED_IMAGE_ALT_TEXT: "Checked. (Item disabled.)",\r
+\r
+\r
+    /**\r
+    * @property CSS_CLASS_NAME\r
+    * @description String representing the CSS class(es) to be applied to the\r
+    * <code>&#60;li&#62;</code> element of the menu item.\r
+    * @default "yuimenuitem"\r
+    * @final\r
+    * @type String\r
+    */\r
+    CSS_CLASS_NAME: "yuimenuitem",\r
 \r
 \r
     /**\r
-    * Constant representing the type of item to instantiate when \r
-    * creating item instances from parsing the child nodes (either \r
-    * HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-    * submenu's DOM.  \r
-    * The default is YAHOO.widget.MenuModuleItem.\r
+    * @property SUBMENU_TYPE\r
+    * @description Object representing the type of menu to instantiate and\r
+    * add when parsing the child nodes of the menu item's source HTML element.\r
     * @final\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @type YAHOO.widget.Menu\r
     */\r
-    SUBMENU_ITEM_TYPE: null,\r
+    SUBMENU_TYPE: null,\r
 \r
 \r
     /**\r
-    * Constant representing the prefix path to use for non-secure images\r
-    * @type string\r
+    * @property IMG_ROOT\r
+    * @description String representing the prefix path to use for\r
+    * non-secure images.\r
+    * @default "http://us.i1.yimg.com/us.yimg.com/i/"\r
+    * @type String\r
     */\r
     IMG_ROOT: "http://us.i1.yimg.com/us.yimg.com/i/",\r
-    \r
+\r
 \r
     /**\r
-    * Constant representing the prefix path to use for securely served images\r
-    * @type string\r
+    * @property IMG_ROOT_SSL\r
+    * @description String representing the prefix path to use for securely\r
+    * served images.\r
+    * @default "https://a248.e.akamai.net/sec.yimg.com/i/"\r
+    * @type String\r
     */\r
     IMG_ROOT_SSL: "https://a248.e.akamai.net/sec.yimg.com/i/",\r
 \r
 \r
+\r
     // Private member variables\r
-    \r
+\r
     /**\r
-    * Reference to the HTMLAnchorElement of the MenuModuleItem's core internal\r
-    * DOM structure.\r
+    * @property _oAnchor\r
+    * @description Object reference to the menu item's\r
+    * <code>&#60;a&#62;</code> element.\r
+    * @default null\r
     * @private\r
-    * @type {HTMLAnchorElement}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-48250443">HTMLAnchorElement</a>\r
     */\r
     _oAnchor: null,\r
-    \r
+\r
 \r
     /**\r
-    * Reference to the text node of the MenuModuleItem's core internal\r
-    * DOM structure.\r
+    * @property _oText\r
+    * @description Object reference to the menu item's text node.\r
+    * @default null\r
     * @private\r
-    * @type {Text}\r
+    * @type TextNode\r
     */\r
     _oText: null,\r
-    \r
-    \r
+\r
+\r
     /**\r
-    * Reference to the HTMLElement (&#60;EM&#60;) used to create the optional\r
-    * help text for a MenuModuleItem instance.\r
+    * @property _oHelpTextEM\r
+    * @description Object reference to the menu item's help text\r
+    * <code>&#60;em&#62;</code> element.\r
+    * @default null\r
     * @private\r
-    * @type {HTMLElement}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-58190037">HTMLElement</a>\r
     */\r
     _oHelpTextEM: null,\r
-    \r
-    \r
+\r
+\r
     /**\r
-    * Reference to the submenu for a MenuModuleItem instance.\r
+    * @property _oSubmenu\r
+    * @description Object reference to the menu item's submenu.\r
+    * @default null\r
     * @private\r
-    * @type {YAHOO.widget.MenuModule}\r
+    * @type YAHOO.widget.Menu\r
     */\r
     _oSubmenu: null,\r
-    \r
-    \r
+\r
+\r
     /**\r
-    * Reference to the Dom utility singleton.\r
+    * @property _checkImage\r
+    * @description Object reference to the menu item's checkmark image.\r
+    * @default null\r
     * @private\r
-    * @type {YAHOO.util.Dom}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-17701901">HTMLImageElement</a>\r
     */\r
-    _oDom: YAHOO.util.Dom,\r
+    _checkImage: null,\r
+\r
 \r
 \r
     // Public properties\r
 \r
        /**\r
-       * The class's constructor function\r
-       * @type YAHOO.widget.MenuModuleItem\r
+    * @property constructor\r
+       * @description Object reference to the menu item's constructor function.\r
+    * @default YAHOO.widget.MenuItem\r
+       * @type YAHOO.widget.MenuItem\r
        */\r
-       constructor: YAHOO.widget.MenuModuleItem,\r
+       constructor: YAHOO.widget.MenuItem,\r
 \r
 \r
        /**\r
-       * The string representing the image root\r
-       * @type string\r
+    * @property imageRoot\r
+       * @description String representing the root path for all of the menu\r
+       * item's images.\r
+       * @type String\r
        */\r
        imageRoot: null,\r
 \r
 \r
        /**\r
-       * Boolean representing whether or not the current browsing context \r
-       * is secure (https)\r
-       * @type boolean\r
+    * @property isSecure\r
+       * @description Boolean representing whether or not the current browsing\r
+       * context is secure (HTTPS).\r
+       * @type Boolean\r
        */\r
-       isSecure: YAHOO.widget.Module.prototype.isSecure,\r
+       isSecure: Module.prototype.isSecure,\r
 \r
 \r
     /**\r
-    * Returns the ordinal position of a MenuModuleItem instance in a group.\r
+    * @property index\r
+    * @description Number indicating the ordinal position of the menu item in\r
+    * its group.\r
+    * @default null\r
     * @type Number\r
     */\r
     index: null,\r
 \r
 \r
     /**\r
-    * Returns the index of the group to which a MenuModuleItem instance belongs.\r
+    * @property groupIndex\r
+    * @description Number indicating the index of the group to which the menu\r
+    * item belongs.\r
+    * @default null\r
     * @type Number\r
     */\r
     groupIndex: null,\r
 \r
 \r
     /**\r
-    * Returns the parent object for a MenuModuleItem instance.\r
-    * @type {YAHOO.widget.MenuModule}\r
+    * @property parent\r
+    * @description Object reference to the menu item's parent menu.\r
+    * @default null\r
+    * @type YAHOO.widget.Menu\r
     */\r
     parent: null,\r
 \r
 \r
     /**\r
-    * Returns the HTMLLIElement for a MenuModuleItem instance.\r
-    * @type {HTMLLIElement}\r
+    * @property element\r
+    * @description Object reference to the menu item's\r
+    * <code>&#60;li&#62;</code> element.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level\r
+    * -one-html.html#ID-74680021">HTMLLIElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>\r
     */\r
     element: null,\r
 \r
 \r
     /**\r
-    * Returns the HTMLElement (either HTMLLIElement, HTMLOptGroupElement or\r
-    * HTMLOptionElement) used create the MenuModuleItem instance.\r
-    * @type {HTMLLIElement/HTMLOptGroupElement/HTMLOptionElement}\r
+    * @property srcElement\r
+    * @description Object reference to the HTML element (either\r
+    * <code>&#60;li&#62;</code>, <code>&#60;optgroup&#62;</code> or\r
+    * <code>&#60;option&#62;</code>) used create the menu item.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.\r
+    * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"\r
+    * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-\r
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3.\r
+    * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247">\r
+    * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-\r
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>\r
     */\r
     srcElement: null,\r
 \r
 \r
     /**\r
-    * Specifies an arbitrary value for a MenuModuleItem instance.\r
-    * @type {Object}\r
+    * @property value\r
+    * @description Object reference to the menu item's value.\r
+    * @default null\r
+    * @type Object\r
     */\r
     value: null,\r
 \r
 \r
     /**\r
-    * Reference to the HTMLImageElement used to create the submenu\r
-    * indicator for a MenuModuleItem instance.\r
-    * @type {HTMLImageElement}\r
+    * @property submenuIndicator\r
+    * @description Object reference to the <code>&#60;img&#62;</code> element\r
+    * used to create the submenu indicator for the menu item.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-17701901">HTMLImageElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-17701901">HTMLImageElement</a>\r
     */\r
     submenuIndicator: null,\r
 \r
 \r
        /**\r
-       * String representing the browser\r
-       * @type string\r
+    * @property browser\r
+       * @description String representing the browser.\r
+       * @type String\r
        */\r
-       browser: YAHOO.widget.Module.prototype.browser,\r
+       browser: Module.prototype.browser,\r
+\r
 \r
 \r
     // Events\r
 \r
+\r
     /**\r
-    * Fires when a MenuModuleItem instances's HTMLLIElement is removed from\r
-    * it's parent HTMLUListElement node.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event destroyEvent\r
+    * @description Fires when the menu item's <code>&#60;li&#62;</code>\r
+    * element is removed from its parent <code>&#60;ul&#62;</code> element.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     destroyEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the mouse has entered a MenuModuleItem instance.  Passes\r
+    * @event mouseOverEvent\r
+    * @description Fires when the mouse has entered the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseOverEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the mouse has left a MenuModuleItem instance.  Passes back  \r
+    * @event mouseOutEvent\r
+    * @description Fires when the mouse has left the menu item.  Passes back\r
     * the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseOutEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user mouses down on a MenuModuleItem instance.  Passes \r
+    * @event mouseDownEvent\r
+    * @description Fires when the user mouses down on the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseDownEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user releases a mouse button while the mouse is \r
-    * over a MenuModuleItem instance.  Passes back the DOM Event object as\r
-    * an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event mouseUpEvent\r
+    * @description Fires when the user releases a mouse button while the mouse\r
+    * is over the menu item.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseUpEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user clicks the on a MenuModuleItem instance.  Passes \r
+    * @event clickEvent\r
+    * @description Fires when the user clicks the on the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     clickEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user presses an alphanumeric key.  Passes back the \r
-    * DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyPressEvent\r
+    * @description Fires when the user presses an alphanumeric key when the\r
+    * menu item has focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyPressEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user presses a key.  Passes back the DOM Event \r
-    * object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyDownEvent\r
+    * @description Fires when the user presses a key when the menu item has\r
+    * focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyDownEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when the user releases a key.  Passes back the DOM Event \r
-    * object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyUpEvent\r
+    * @description Fires when the user releases a key when the menu item has\r
+    * focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyUpEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when a MenuModuleItem instance receives focus.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event focusEvent\r
+    * @description Fires when the menu item receives focus.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     focusEvent: null,\r
 \r
 \r
     /**\r
-    * Fires when a MenuModuleItem instance loses the input focus.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event blurEvent\r
+    * @description Fires when the menu item loses the input focus.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     blurEvent: null,\r
 \r
 \r
     /**\r
-    * The MenuModuleItem class's initialization method. This method is \r
-    * automatically called by the constructor, and sets up all DOM references \r
+    * @method init\r
+    * @description The MenuItem class's initialization method. This method is\r
+    * automatically called by the constructor, and sets up all DOM references\r
     * for pre-existing markup, and creates required markup if it is not\r
     * already present.\r
-    * @param {String or HTMLElement} p_oObject String or HTMLElement \r
-    * (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-    * source HTMLElement node.\r
-    * @param {Object} p_oConfig The configuration object literal containing \r
-    * the configuration for a MenuModuleItem instance. See the configuration \r
-    * class documentation for more details.\r
+    * @param {String} p_oObject String specifying the text of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying\r
+    * the <code>&#60;li&#62;</code> element of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+    * specifying the <code>&#60;optgroup&#62;</code> element of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object\r
+    * specifying the <code>&#60;option&#62;</code> element of the menu item.\r
+    * @param {Object} p_oConfig Optional. Object literal specifying the\r
+    * configuration for the menu item. See configuration class documentation\r
+    * for more details.\r
     */\r
     init: function(p_oObject, p_oConfig) {\r
 \r
@@ -2809,15 +4611,9 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
         if(!this.SUBMENU_TYPE) {\r
-    \r
-            this.SUBMENU_TYPE = YAHOO.widget.MenuModule;\r
-    \r
-        }\r
 \r
-        if(!this.SUBMENU_ITEM_TYPE) {\r
-    \r
-            this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuModuleItem;\r
-    \r
+            this.SUBMENU_TYPE = Menu;\r
+\r
         }\r
 \r
 \r
@@ -2839,7 +4635,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
         }\r
         else if(this._checkDOMNode(p_oObject)) {\r
 \r
-            switch(p_oObject.tagName) {\r
+            switch(p_oObject.tagName.toUpperCase()) {\r
 \r
                 case "OPTION":\r
 \r
@@ -2869,6 +4665,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                     var oAnchor = this._getFirstElement(p_oObject, "A");\r
                     var sURL = "#";\r
+                    var sTarget = null;\r
                     var sText = null;\r
 \r
 \r
@@ -2877,20 +4674,21 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     if(oAnchor) {\r
 \r
                         sURL = oAnchor.getAttribute("href");\r
+                        sTarget = oAnchor.getAttribute("target");\r
 \r
                         if(oAnchor.innerText) {\r
-                \r
+\r
                             sText = oAnchor.innerText;\r
-                \r
+\r
                         }\r
                         else {\r
-                \r
+\r
                             var oRange = oAnchor.ownerDocument.createRange();\r
-                \r
+\r
                             oRange.selectNodeContents(oAnchor);\r
-                \r
-                            sText = oRange.toString();             \r
-                \r
+\r
+                            sText = oRange.toString();\r
+\r
                         }\r
 \r
                     }\r
@@ -2901,11 +4699,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
                         sText = oText.nodeValue;\r
 \r
                         oAnchor = document.createElement("a");\r
-                        \r
+\r
                         oAnchor.setAttribute("href", sURL);\r
 \r
                         p_oObject.replaceChild(oAnchor, oText);\r
-                        \r
+\r
                         oAnchor.appendChild(oText);\r
 \r
                     }\r
@@ -2914,9 +4712,9 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     this.srcElement = p_oObject;\r
                     this.element = p_oObject;\r
                     this._oAnchor = oAnchor;\r
-    \r
 \r
-                    // Check if emphasis has been applied to the MenuModuleItem\r
+\r
+                    // Check if emphasis has been applied to the MenuItem\r
 \r
                     var oEmphasisNode = this._getFirstElement(oAnchor);\r
                     var bEmphasis = false;\r
@@ -2924,11 +4722,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                     if(oEmphasisNode) {\r
 \r
-                        // Set a reference to the text node \r
+                        // Set a reference to the text node\r
 \r
                         this._oText = oEmphasisNode.firstChild;\r
 \r
-                        switch(oEmphasisNode.tagName) {\r
+                        switch(oEmphasisNode.tagName.toUpperCase()) {\r
 \r
                             case "EM":\r
 \r
@@ -2947,7 +4745,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     }\r
                     else {\r
 \r
-                        // Set a reference to the text node \r
+                        // Set a reference to the text node\r
 \r
                         this._oText = oAnchor.firstChild;\r
 \r
@@ -2955,17 +4753,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
                     /*\r
-                        Set these properties silently to sync up the \r
-                        configuration object without making changes to the \r
+                        Set these properties silently to sync up the\r
+                        configuration object without making changes to the\r
                         element's DOM\r
-                    */ \r
+                    */\r
 \r
                     oConfig.setProperty("text", sText, true);\r
                     oConfig.setProperty("url", sURL, true);\r
+                    oConfig.setProperty("target", sTarget, true);\r
                     oConfig.setProperty("emphasis", bEmphasis, true);\r
                     oConfig.setProperty(\r
-                        "strongemphasis", \r
-                        bStrongEmphasis, \r
+                        "strongemphasis",\r
+                        bStrongEmphasis,\r
                         true\r
                     );\r
 \r
@@ -2973,7 +4772,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                 break;\r
 \r
-            }            \r
+            }\r
 \r
         }\r
 \r
@@ -2981,13 +4780,13 @@ YAHOO.widget.MenuModuleItem.prototype = {
         if(this.element) {\r
 \r
 \r
-            this._oDom.addClass(this.element, this.CSS_CLASS_NAME);\r
+            Dom.addClass(this.element, this.CSS_CLASS_NAME);\r
 \r
 \r
             // Create custom events\r
-    \r
+\r
             var CustomEvent = YAHOO.util.CustomEvent;\r
-    \r
+\r
             this.destroyEvent = new CustomEvent("destroyEvent", this);\r
             this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
             this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
@@ -3002,10 +4801,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
             if(p_oConfig) {\r
-    \r
+\r
                 oConfig.applyConfig(p_oConfig);\r
-    \r
-            }        \r
+\r
+            }\r
 \r
             oConfig.fireQueue();\r
 \r
@@ -3014,15 +4813,20 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
 \r
+\r
     // Private methods\r
 \r
     /**\r
-    * Returns an HTMLElement's first HTMLElement node\r
+    * @method _getFirstElement\r
+    * @description Returns an HTML element's first HTML element node.\r
     * @private\r
-    * @param {HTMLElement} p_oElement The element to be evaluated.\r
-    * @param {String} p_sTagName Optional. The tagname of the element.\r
-    * @return Returns an HTMLElement node.\r
-    * @type Boolean\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object\r
+    * reference specifying the element to be evaluated.\r
+    * @param {String} p_sTagName Optional. String specifying the tagname of\r
+    * the element to be retrieved.\r
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>}\r
     */\r
     _getFirstElement: function(p_oElement, p_sTagName) {\r
 \r
@@ -3034,8 +4838,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         }\r
         else if(\r
-            p_oElement.firstChild && \r
-            p_oElement.firstChild.nextSibling && \r
+            p_oElement.firstChild &&\r
+            p_oElement.firstChild.nextSibling &&\r
             p_oElement.firstChild.nextSibling.nodeType == 1\r
         ) {\r
 \r
@@ -3046,7 +4850,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         if(p_sTagName) {\r
 \r
-            return (oElement && oElement.tagName == p_sTagName) ? \r
+            return (oElement && oElement.tagName.toUpperCase() == p_sTagName) ?\r
                 oElement : false;\r
 \r
         }\r
@@ -3057,11 +4861,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Determines if an object is a string\r
+    * @method _checkString\r
+    * @description Determines if an object is a string.\r
     * @private\r
-    * @param {Object} p_oObject The object to be evaluated.\r
-    * @return Returns true if the object is a string.\r
-    * @type Boolean\r
+    * @param {Object} p_oObject Object to be evaluated.\r
+    * @return {Boolean}\r
     */\r
     _checkString: function(p_oObject) {\r
 \r
@@ -3071,11 +4875,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Determines if an object is an HTMLElement.\r
+    * @method _checkDOMNode\r
+    * @description Determines if an object is an HTML element.\r
     * @private\r
-    * @param {Object} p_oObject The object to be evaluated.\r
-    * @return Returns true if the object is an HTMLElement.\r
-    * @type Boolean\r
+    * @param {Object} p_oObject Object to be evaluated.\r
+    * @return {Boolean}\r
     */\r
     _checkDOMNode: function(p_oObject) {\r
 \r
@@ -3085,7 +4889,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Creates the core DOM structure for a MenuModuleItem instance.\r
+    * @method _createRootNodeStructure\r
+    * @description Creates the core DOM structure for the menu item.\r
     * @private\r
     */\r
     _createRootNodeStructure: function () {\r
@@ -3096,69 +4901,87 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         this._oAnchor = document.createElement("a");\r
         this._oAnchor.appendChild(this._oText);\r
-        \r
+\r
         this.cfg.refireEvent("url");\r
 \r
-        this.element.appendChild(this._oAnchor);            \r
+        this.element.appendChild(this._oAnchor);\r
 \r
     },\r
 \r
 \r
     /**\r
-    * Iterates the source element's childNodes collection and uses the  \r
-    * child nodes to instantiate other menus.\r
+    * @method _initSubTree\r
+    * @description Iterates the source element's childNodes collection and uses\r
+    * the child nodes to instantiate other menus.\r
     * @private\r
     */\r
     _initSubTree: function() {\r
 \r
-        var Menu = this.SUBMENU_TYPE;\r
-        var MenuModuleItem = this.SUBMENU_ITEM_TYPE;\r
         var oSrcEl = this.srcElement;\r
         var oConfig = this.cfg;\r
 \r
 \r
         if(oSrcEl.childNodes.length > 0) {\r
 \r
-            var oNode = oSrcEl.firstChild;\r
-            var aOptions = [];\r
+            if(\r
+                this.parent.lazyLoad &&\r
+                this.parent.srcElement &&\r
+                this.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
+            ) {\r
 \r
-            do {\r
+                oConfig.setProperty(\r
+                        "submenu",\r
+                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }\r
+                    );\r
 \r
-                switch(oNode.tagName) {\r
-        \r
-                    case "DIV":\r
-        \r
-                        oConfig.setProperty("submenu", (new Menu(oNode)));\r
-        \r
-                    break;\r
\r
-                    case "OPTION":\r
+            }\r
+            else {\r
 \r
-                        aOptions[aOptions.length] = oNode;\r
+                var oNode = oSrcEl.firstChild;\r
+                var aOptions = [];\r
+\r
+                do {\r
+\r
+                    if(oNode && oNode.tagName) {\r
+\r
+                        switch(oNode.tagName.toUpperCase()) {\r
+\r
+                            case "DIV":\r
+\r
+                                oConfig.setProperty("submenu", oNode);\r
+\r
+                            break;\r
+\r
+                            case "OPTION":\r
+\r
+                                aOptions[aOptions.length] = oNode;\r
+\r
+                            break;\r
+\r
+                        }\r
+\r
+                    }\r
 \r
-                    break;\r
-       \r
                 }\r
-            \r
-            }        \r
-            while((oNode = oNode.nextSibling));\r
+                while((oNode = oNode.nextSibling));\r
 \r
 \r
-            var nOptions = aOptions.length;\r
+                var nOptions = aOptions.length;\r
+\r
+                if(nOptions > 0) {\r
+\r
+                    var oMenu = new this.SUBMENU_TYPE(Dom.generateId());\r
+\r
+                    oConfig.setProperty("submenu", oMenu);\r
+\r
+                    for(var n=0; n<nOptions; n++) {\r
+\r
+                        oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));\r
+\r
+                    }\r
 \r
-            if(nOptions > 0) {\r
-    \r
-                oConfig.setProperty(\r
-                    "submenu", \r
-                    (new Menu(this._oDom.generateId()))\r
-                );\r
-    \r
-                for(var n=0; n<nOptions; n++) {\r
-    \r
-                    this._oSubmenu.addItem((new MenuModuleItem(aOptions[n])));\r
-    \r
                 }\r
-    \r
+\r
             }\r
 \r
         }\r
@@ -3166,15 +4989,44 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
 \r
+    /**\r
+    * @method _preloadImage\r
+    * @description Preloads an image by creating an image element from the\r
+    * specified path and appending the image to the body of the document.\r
+    * @private\r
+    * @param {String} p_sPath String specifying the path to the image.\r
+    */\r
+    _preloadImage: function(p_sPath) {\r
+\r
+        var sPath = this.imageRoot + p_sPath;\r
+\r
+        if(!document.images[sPath]) {\r
+\r
+            var oImage = document.createElement("img");\r
+            oImage.src = sPath;\r
+            oImage.name = sPath;\r
+            oImage.id = sPath;\r
+            oImage.style.display = "none";\r
+\r
+            document.body.appendChild(oImage);\r
+\r
+        }\r
+\r
+    },\r
+\r
+\r
+\r
     // Event handlers for configuration properties\r
 \r
+\r
     /**\r
-    * Event handler for when the "text" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configText\r
+    * @description Event handler for when the "text" configuration property of\r
+    * the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
     */\r
     configText: function(p_sType, p_aArgs, p_oItem) {\r
@@ -3192,18 +5044,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "helptext" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configHelpText\r
+    * @description Event handler for when the "helptext" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var me = this;\r
-        var Dom = this._oDom;\r
         var oHelpText = p_aArgs[0];\r
         var oEl = this.element;\r
         var oConfig = this.cfg;\r
@@ -3212,11 +5064,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
         /**\r
-        * Adds the "hashelptext" class to the necessary nodes and refires the \r
-        * "selected" and "disabled" configuration events\r
-        * @ignore\r
+        * Adds the "hashelptext" class to the necessary nodes and refires the\r
+        * "selected" and "disabled" configuration events.\r
+        * @private\r
         */\r
-        function initHelpText() {\r
+        var initHelpText = function() {\r
 \r
             Dom.addClass(aNodes, "hashelptext");\r
 \r
@@ -3230,23 +5082,23 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                 oConfig.refireEvent("selected");\r
 \r
-            }                \r
+            }\r
 \r
-        }\r
+        };\r
 \r
 \r
         /**\r
-        * Removes the "hashelptext" class and corresponding DOM element (EM)\r
-        * @ignore\r
+        * Removes the "hashelptext" class and corresponding DOM element (EM).\r
+        * @private\r
         */\r
-        function removeHelpText() {\r
+        var removeHelpText = function() {\r
 \r
             Dom.removeClass(aNodes, "hashelptext");\r
 \r
             oEl.removeChild(me._oHelpTextEM);\r
             me._oHelpTextEM = null;\r
 \r
-        }\r
+        };\r
 \r
 \r
         if(this._checkDOMNode(oHelpText)) {\r
@@ -3254,7 +5106,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
             if(this._oHelpTextEM) {\r
 \r
                 this._oHelpTextEM.parentNode.replaceChild(\r
-                    oHelpText, \r
+                    oHelpText,\r
                     this._oHelpTextEM\r
                 );\r
 \r
@@ -3304,14 +5156,15 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "url" configuration property of\r
-    * a MenuModuleItem instance changes.  \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configURL\r
+    * @description Event handler for when the "url" configuration property of\r
+    * the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configURL: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var sURL = p_aArgs[0];\r
@@ -3328,14 +5181,44 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "emphasis" configuration property of\r
-    * a MenuModuleItem instance changes.  \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configTarget\r
+    * @description Event handler for when the "target" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    configTarget: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+        var sTarget = p_aArgs[0];\r
+        var oAnchor = this._oAnchor;\r
+\r
+        if(sTarget && sTarget.length > 0) {\r
+\r
+            oAnchor.setAttribute("target", sTarget);\r
+\r
+        }\r
+        else {\r
+\r
+            oAnchor.removeAttribute("target");\r
+\r
+        }\r
+\r
+    },\r
+\r
+\r
+    /**\r
+    * @method configEmphasis\r
+    * @description Event handler for when the "emphasis" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bEmphasis = p_aArgs[0];\r
@@ -3377,14 +5260,15 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "strongemphasis" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configStrongEmphasis\r
+    * @description Event handler for when the "strongemphasis" configuration\r
+    * property of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bStrongEmphasis = p_aArgs[0];\r
@@ -3424,25 +5308,105 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "disabled" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configChecked\r
+    * @description Event handler for when the "checked" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    configChecked: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+        var bChecked = p_aArgs[0];\r
+        var oEl = this.element;\r
+        var oConfig = this.cfg;\r
+        var oImg;\r
+\r
+\r
+        if(bChecked) {\r
+\r
+            this._preloadImage(this.CHECKED_IMAGE_PATH);\r
+            this._preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);\r
+            this._preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);\r
+\r
+\r
+            oImg = document.createElement("img");\r
+            oImg.src = (this.imageRoot + this.CHECKED_IMAGE_PATH);\r
+            oImg.alt = this.CHECKED_IMAGE_ALT_TEXT;\r
+\r
+            var oSubmenu = this.cfg.getProperty("submenu");\r
+\r
+            if(oSubmenu) {\r
+\r
+                oEl.insertBefore(oImg, oSubmenu.element);\r
+\r
+            }\r
+            else {\r
+\r
+                oEl.appendChild(oImg);\r
+\r
+            }\r
+\r
+\r
+            Dom.addClass([oEl, oImg], "checked");\r
+\r
+            this._checkImage = oImg;\r
+\r
+            if(oConfig.getProperty("disabled")) {\r
+\r
+                oConfig.refireEvent("disabled");\r
+\r
+            }\r
+\r
+            if(oConfig.getProperty("selected")) {\r
+\r
+                oConfig.refireEvent("selected");\r
+\r
+            }\r
+\r
+        }\r
+        else {\r
+\r
+            oImg = this._checkImage;\r
+\r
+            Dom.removeClass([oEl, oImg], "checked");\r
+\r
+            if(oImg) {\r
+\r
+                oEl.removeChild(oImg);\r
+\r
+            }\r
+\r
+            this._checkImage = null;\r
+\r
+        }\r
+\r
+    },\r
+\r
+\r
+\r
+    /**\r
+    * @method configDisabled\r
+    * @description Event handler for when the "disabled" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bDisabled = p_aArgs[0];\r
-        var Dom = this._oDom;\r
         var oAnchor = this._oAnchor;\r
         var aNodes = [this.element, oAnchor];\r
         var oEM = this._oHelpTextEM;\r
         var oConfig = this.cfg;\r
-        var oImg = this.submenuIndicator;\r
-        var sImageSrc;\r
-        var sImageAlt;\r
+        var oImg;\r
+        var sImgSrc;\r
+        var sImgAlt;\r
 \r
 \r
         if(oEM) {\r
@@ -3451,6 +5415,28 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         }\r
 \r
+\r
+        if(this.cfg.getProperty("checked")) {\r
+\r
+            sImgAlt = this.CHECKED_IMAGE_ALT_TEXT;\r
+            sImgSrc = this.CHECKED_IMAGE_PATH;\r
+            oImg = this._checkImage;\r
+\r
+            if(bDisabled) {\r
+\r
+                sImgAlt = this.DISABLED_CHECKED_IMAGE_ALT_TEXT;\r
+                sImgSrc = this.DISABLED_CHECKED_IMAGE_PATH;\r
+\r
+            }\r
+\r
+            oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
+            oImg.alt = sImgAlt;\r
+\r
+        }\r
+\r
+\r
+        oImg = this.submenuIndicator;\r
+\r
         if(bDisabled) {\r
 \r
             if(oConfig.getProperty("selected")) {\r
@@ -3463,8 +5449,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             Dom.addClass(aNodes, "disabled");\r
 \r
-            sImageSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImageAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
+            sImgSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
+            sImgAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
 \r
         }\r
         else {\r
@@ -3473,16 +5459,16 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             Dom.removeClass(aNodes, "disabled");\r
 \r
-            sImageSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImageAlt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+            sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
+            sImgAlt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
 \r
         }\r
 \r
 \r
         if(oImg) {\r
 \r
-            oImg.src = this.imageRoot + sImageSrc;\r
-            oImg.alt = sImageAlt;\r
+            oImg.src = this.imageRoot + sImgSrc;\r
+            oImg.alt = sImgAlt;\r
 \r
         }\r
 \r
@@ -3490,48 +5476,65 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "selected" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configSelected\r
+    * @description Event handler for when the "selected" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configSelected: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         if(!this.cfg.getProperty("disabled")) {\r
 \r
-            var Dom = this._oDom;\r
             var bSelected = p_aArgs[0];\r
             var oEM = this._oHelpTextEM;\r
             var aNodes = [this.element, this._oAnchor];\r
             var oImg = this.submenuIndicator;\r
-            var sImageSrc;\r
+            var sImgSrc;\r
 \r
 \r
             if(oEM) {\r
-    \r
-                aNodes[2] = oEM;  \r
-    \r
+\r
+                aNodes[aNodes.length] = oEM;\r
+\r
+            }\r
+\r
+            if(oImg) {\r
+\r
+                aNodes[aNodes.length] = oImg;\r
+\r
+            }\r
+\r
+\r
+            if(this.cfg.getProperty("checked")) {\r
+\r
+                sImgSrc = this.imageRoot + (bSelected ?\r
+                    this.SELECTED_CHECKED_IMAGE_PATH : this.CHECKED_IMAGE_PATH);\r
+\r
+                this._checkImage.src = document.images[sImgSrc].src;\r
+\r
             }\r
-    \r
+\r
+\r
             if(bSelected) {\r
-    \r
+\r
                 Dom.addClass(aNodes, "selected");\r
-                sImageSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
+                sImgSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
+\r
             }\r
             else {\r
-    \r
+\r
                 Dom.removeClass(aNodes, "selected");\r
-                sImageSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
+                sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
+\r
             }\r
-    \r
+\r
             if(oImg) {\r
-    \r
-                oImg.src = document.images[(this.imageRoot + sImageSrc)].src;\r
+\r
+                oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
 \r
             }\r
 \r
@@ -3541,81 +5544,115 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Event handler for when the "submenu" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configSubmenu\r
+    * @description Event handler for when the "submenu" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
     */\r
     configSubmenu: function(p_sType, p_aArgs, p_oItem) {\r
 \r
-        var Dom = this._oDom;\r
         var oEl = this.element;\r
         var oSubmenu = p_aArgs[0];\r
         var oImg = this.submenuIndicator;\r
         var oConfig = this.cfg;\r
         var aNodes = [this.element, this._oAnchor];\r
+        var oMenu;\r
+        var bLazyLoad = this.parent && this.parent.lazyLoad;\r
 \r
 \r
         if(oSubmenu) {\r
 \r
-            // Set the submenu's parent to this MenuModuleItem instance\r
+            if(oSubmenu instanceof Menu) {\r
 \r
-            oSubmenu.parent = this;\r
+                oMenu = oSubmenu;\r
+                oMenu.parent = this;\r
+                oMenu.lazyLoad = bLazyLoad;\r
 \r
-            this._oSubmenu = oSubmenu;\r
+            }\r
+            else if(\r
+                typeof oSubmenu == "object" &&\r
+                oSubmenu.id &&\r
+                !oSubmenu.nodeType\r
+            ) {\r
 \r
+                var sSubmenuId = oSubmenu.id;\r
+                var oSubmenuConfig = oSubmenu;\r
 \r
-            if(!oImg) { \r
+                delete oSubmenu["id"];\r
 \r
-                var me = this;\r
+                oSubmenuConfig.lazyload = bLazyLoad;\r
+                oSubmenuConfig.parent = this;\r
 \r
-                function preloadImage(p_sPath) {\r
+                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);\r
 \r
-                    var sPath = me.imageRoot + p_sPath;\r
 \r
-                    if(!document.images[sPath]) {\r
+                // Set the value of the property to the Menu instance\r
 \r
-                        var oImg = document.createElement("img");\r
-                        oImg.src = sPath;\r
-                        oImg.name = sPath;\r
-                        oImg.id = sPath;\r
-                        oImg.style.display = "none";\r
-                        \r
-                        document.body.appendChild(oImg);\r
+                this.cfg.setProperty("submenu", oMenu, true);\r
 \r
-                    }\r
-                \r
-                }\r
+            }\r
+            else {\r
+\r
+                oMenu = new this.SUBMENU_TYPE(\r
+                                oSubmenu,\r
+                                { lazyload: bLazyLoad, parent: this }\r
+                            );\r
 \r
-                preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);\r
-                preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);\r
-                preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);\r
 \r
-                oImg = document.createElement("img");\r
-                oImg.src = (this.imageRoot + this.SUBMENU_INDICATOR_IMAGE_PATH);\r
-                oImg.alt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+                // Set the value of the property to the Menu instance\r
 \r
-                oEl.appendChild(oImg);\r
+                this.cfg.setProperty("submenu", oMenu, true);\r
 \r
-                this.submenuIndicator = oImg;\r
+            }\r
 \r
-                Dom.addClass(aNodes, "hassubmenu");\r
 \r
+            if(oMenu) {\r
 \r
-                if(oConfig.getProperty("disabled")) {\r
+                this._oSubmenu = oMenu;\r
 \r
-                    oConfig.refireEvent("disabled");\r
 \r
-                }\r
+                if(!oImg) {\r
+\r
+                    this._preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);\r
+                    this._preloadImage(\r
+                            this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+                        );\r
+\r
+                    this._preloadImage(\r
+                            this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+                        );\r
+\r
+                    oImg = document.createElement("img");\r
+\r
+                    oImg.src =\r
+                        (this.imageRoot + this.SUBMENU_INDICATOR_IMAGE_PATH);\r
+\r
+                    oImg.alt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+                    oEl.appendChild(oImg);\r
+\r
+                    this.submenuIndicator = oImg;\r
+\r
+                    Dom.addClass(aNodes, "hassubmenu");\r
+\r
+\r
+                    if(oConfig.getProperty("disabled")) {\r
 \r
-                if(oConfig.getProperty("selected")) {\r
+                        oConfig.refireEvent("disabled");\r
 \r
-                    oConfig.refireEvent("selected");\r
+                    }\r
+\r
+                    if(oConfig.getProperty("selected")) {\r
+\r
+                        oConfig.refireEvent("selected");\r
+\r
+                    }\r
 \r
-                }                \r
+                }\r
 \r
             }\r
 \r
@@ -3644,7 +5681,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
     // Public methods\r
 \r
        /**\r
-       * Initializes an item's configurable properties.\r
+    * @method initDefaultConfig\r
+       * @description Initializes an item's configurable properties.\r
        */\r
        initDefaultConfig : function() {\r
 \r
@@ -3654,33 +5692,96 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         // Define the config properties\r
 \r
+        /**\r
+        * @config text\r
+        * @description String specifying the text label for the menu item.\r
+        * When building a menu from existing HTML the value of this property\r
+        * will be interpreted from the menu's markup.\r
+        * @default ""\r
+        * @type String\r
+        */\r
         oConfig.addProperty(\r
-            "text", \r
-            { \r
-                value: "", \r
-                handler: this.configText, \r
-                validator: this._checkString, \r
-                suppressEvent: true \r
+            "text",\r
+            {\r
+                value: "",\r
+                handler: this.configText,\r
+                validator: this._checkString,\r
+                suppressEvent: true\r
             }\r
         );\r
-        \r
+\r
+\r
+        /**\r
+        * @config helptext\r
+        * @description String specifying additional instructional text to\r
+        * accompany the text for the nenu item.\r
+        * @default null\r
+        * @type String|<a href="http://www.w3.org/TR/\r
+        * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">\r
+        * HTMLElement</a>\r
+        */\r
         oConfig.addProperty("helptext", { handler: this.configHelpText });\r
-        \r
+\r
+\r
+        /**\r
+        * @config url\r
+        * @description String specifying the URL for the menu item's anchor's\r
+        * "href" attribute.  When building a menu from existing HTML the value\r
+        * of this property will be interpreted from the menu's markup.\r
+        * @default "#"\r
+        * @type String\r
+        */\r
         oConfig.addProperty(\r
-            "url", \r
+            "url",\r
             { value: "#", handler: this.configURL, suppressEvent: true }\r
         );\r
-        \r
+\r
+\r
+        /**\r
+        * @config target\r
+        * @description String specifying the value for the "target" attribute\r
+        * of the menu item's anchor element. <strong>Specifying a target will\r
+        * require the user to click directly on the menu item's anchor node in\r
+        * order to cause the browser to navigate to the specified URL.</strong>\r
+        * When building a menu from existing HTML the value of this property\r
+        * will be interpreted from the menu's markup.\r
+        * @default null\r
+        * @type String\r
+        */\r
+        oConfig.addProperty(\r
+            "target",\r
+            { handler: this.configTarget, suppressEvent: true }\r
+        );\r
+\r
+\r
+        /**\r
+        * @config emphasis\r
+        * @description Boolean indicating if the text of the menu item will be\r
+        * rendered with emphasis.  When building a menu from existing HTML the\r
+        * value of this property will be interpreted from the menu's markup.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
-            "emphasis", \r
-            { \r
-                value: false, \r
-                handler: this.configEmphasis, \r
-                validator: CheckBoolean, \r
-                suppressEvent: true \r
+            "emphasis",\r
+            {\r
+                value: false,\r
+                handler: this.configEmphasis,\r
+                validator: CheckBoolean,\r
+                suppressEvent: true\r
             }\r
         );\r
 \r
+\r
+        /**\r
+        * @config strongemphasis\r
+        * @description Boolean indicating if the text of the menu item will be\r
+        * rendered with strong emphasis.  When building a menu from existing\r
+        * HTML the value of this property will be interpreted from the\r
+        * menu's markup.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "strongemphasis",\r
             {\r
@@ -3691,6 +5792,34 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+\r
+        /**\r
+        * @config checked\r
+        * @description Boolean indicating if the menu item should be rendered\r
+        * with a checkmark.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
+        oConfig.addProperty(\r
+            "checked",\r
+            {\r
+                value: false,\r
+                handler: this.configChecked,\r
+                validator: this.cfg.checkBoolean,\r
+                suppressEvent: true,\r
+                supercedes:["disabled"]\r
+            }\r
+        );\r
+\r
+\r
+        /**\r
+        * @config disabled\r
+        * @description Boolean indicating if the menu item should be disabled.\r
+        * (Disabled menu items are  dimmed and will not respond to user input\r
+        * or fire events.)\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "disabled",\r
             {\r
@@ -3701,6 +5830,14 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+\r
+        /**\r
+        * @config selected\r
+        * @description Boolean indicating if the menu item should\r
+        * be highlighted.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "selected",\r
             {\r
@@ -3711,75 +5848,95 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+\r
+        /**\r
+        * @config submenu\r
+        * @description Object specifying the submenu to be appended to the\r
+        * menu item.  The value can be one of the following: <ul><li>Object\r
+        * specifying a Menu instance.</li><li>Object literal specifying the\r
+        * menu to be created.  Format: <code>{ id: [menu id], itemdata:\r
+        * [<a href="YAHOO.widget.Menu.html#itemData">array of values for\r
+        * items</a>] }</code>.</li><li>String specifying the id attribute\r
+        * of the <code>&#60;div&#62;</code> element of the menu.</li><li>\r
+        * Object specifying the <code>&#60;div&#62;</code> element of the\r
+        * menu.</li></ul>\r
+        * @default null\r
+        * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/\r
+        * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">\r
+        * HTMLElement</a>\r
+        */\r
         oConfig.addProperty("submenu", { handler: this.configSubmenu });\r
 \r
        },\r
 \r
 \r
     /**\r
-    * Finds the next enabled MenuModuleItem instance in a MenuModule instance \r
-    * @return Returns a MenuModuleItem instance.\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @method getNextEnabledSibling\r
+    * @description Finds the menu item's next enabled sibling.\r
+    * @return YAHOO.widget.MenuItem\r
     */\r
     getNextEnabledSibling: function() {\r
 \r
-        if(this.parent instanceof YAHOO.widget.MenuModule) {\r
+        if(this.parent instanceof Menu) {\r
 \r
             var nGroupIndex = this.groupIndex;\r
 \r
             /**\r
-            * Returns the next item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
+            * Finds the next item in an array.\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
             */\r
-            function getNextArrayItem(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] || \r
+            var getNextArrayItem = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ||\r
                     getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
-    \r
+\r
+            };\r
+\r
+\r
             var aItemGroups = this.parent.getItemGroups();\r
             var oNextItem;\r
-    \r
-    \r
+\r
+\r
             if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
-    \r
+\r
                 oNextItem = getNextArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
+                        aItemGroups[nGroupIndex],\r
                         (this.index+1)\r
                     );\r
-    \r
+\r
             }\r
             else {\r
-    \r
+\r
                 var nNextGroupIndex;\r
-    \r
+\r
                 if(nGroupIndex < (aItemGroups.length - 1)) {\r
-    \r
+\r
                     nNextGroupIndex = nGroupIndex + 1;\r
-    \r
+\r
                 }\r
                 else {\r
-    \r
+\r
                     nNextGroupIndex = 0;\r
-    \r
+\r
                 }\r
-    \r
+\r
                 var aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);\r
-    \r
-                // Retrieve the first MenuModuleItem instance in the next group\r
-    \r
+\r
+                // Retrieve the first menu item in the next group\r
+\r
                 oNextItem = getNextArrayItem(aNextGroup, 0);\r
-    \r
+\r
             }\r
-    \r
-            return oNextItem.cfg.getProperty("disabled") ? \r
-                        oNextItem.getNextEnabledSibling() : oNextItem;\r
+\r
+            return (\r
+                oNextItem.cfg.getProperty("disabled") ||\r
+                oNextItem.element.style.display == "none"\r
+            ) ?\r
+            oNextItem.getNextEnabledSibling() : oNextItem;\r
 \r
         }\r
 \r
@@ -3787,91 +5944,93 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Finds the previous enabled MenuModuleItem instance in a \r
-    * MenuModule instance \r
-    * @return Returns a MenuModuleItem instance.\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @method getPreviousEnabledSibling\r
+    * @description Finds the menu item's previous enabled sibling.\r
+    * @return {YAHOO.widget.MenuItem}\r
     */\r
     getPreviousEnabledSibling: function() {\r
 \r
-        if(this.parent instanceof YAHOO.widget.MenuModule) {\r
+        if(this.parent instanceof Menu) {\r
 \r
             var nGroupIndex = this.groupIndex;\r
 \r
             /**\r
-            * Returns the previous item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
+            * Returns the previous item in an array\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
             */\r
-            function getPreviousArrayItem(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] || \r
+            var getPreviousArrayItem = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ||\r
                     getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
-    \r
-            }\r
+\r
+            };\r
 \r
 \r
             /**\r
-            * Get the index of the first item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
-            */    \r
-            function getFirstItemIndex(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] ? \r
-                    p_nStartIndex : \r
+            * Get the index of the first item in an array\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
+            */\r
+            var getFirstItemIndex = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ?\r
+                    p_nStartIndex :\r
                     getFirstItemIndex(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
+\r
+            };\r
+\r
             var aItemGroups = this.parent.getItemGroups();\r
             var oPreviousItem;\r
-    \r
+\r
             if(\r
                 this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
             ) {\r
-    \r
-                oPreviousItem = \r
+\r
+                oPreviousItem =\r
                     getPreviousArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
+                        aItemGroups[nGroupIndex],\r
                         (this.index-1)\r
                     );\r
-    \r
+\r
             }\r
             else {\r
-    \r
+\r
                 var nPreviousGroupIndex;\r
-    \r
+\r
                 if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {\r
-    \r
+\r
                     nPreviousGroupIndex = nGroupIndex - 1;\r
-    \r
+\r
                 }\r
                 else {\r
-    \r
+\r
                     nPreviousGroupIndex = aItemGroups.length - 1;\r
-    \r
+\r
                 }\r
-    \r
-                var aPreviousGroup = \r
+\r
+                var aPreviousGroup =\r
                         getPreviousArrayItem(aItemGroups, nPreviousGroupIndex);\r
-    \r
-                oPreviousItem = \r
+\r
+                oPreviousItem =\r
                     getPreviousArrayItem(\r
-                        aPreviousGroup, \r
+                        aPreviousGroup,\r
                         (aPreviousGroup.length - 1)\r
                     );\r
-    \r
+\r
             }\r
-    \r
-            return oPreviousItem.cfg.getProperty("disabled") ? \r
-                    oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;\r
+\r
+            return (\r
+                oPreviousItem.cfg.getProperty("disabled") ||\r
+                oPreviousItem.element.style.display == "none"\r
+            ) ?\r
+            oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;\r
 \r
         }\r
 \r
@@ -3879,7 +6038,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Causes a MenuModuleItem instance to receive the focus and fires the\r
+    * @method focus\r
+    * @description Causes the menu item to receive the focus and fires the\r
     * focus event.\r
     */\r
     focus: function() {\r
@@ -3889,9 +6049,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
         var oActiveItem = oParent.activeItem;\r
 \r
         if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            oParent.cfg.getProperty("visible")\r
+            !this.cfg.getProperty("disabled") &&\r
+            oParent &&\r
+            oParent.cfg.getProperty("visible") &&\r
+            this.element.style.display != "none"\r
         ) {\r
 \r
             if(oActiveItem) {\r
@@ -3900,17 +6061,13 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             }\r
 \r
-            oAnchor.focus();\r
-\r
-            /*\r
-                Opera 8.5 doesn't always focus the anchor if a MenuModuleItem\r
-                instance has a submenu, this is fixed by calling "focus"\r
-                twice.\r
-            */\r
-            if(oParent && this.browser == "opera" && this._oSubmenu) {\r
+            try {\r
 \r
                 oAnchor.focus();\r
 \r
+            }\r
+            catch(e) {\r
+\r
             }\r
 \r
             this.focusEvent.fire();\r
@@ -3921,16 +6078,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
     /**\r
-    * Causes a MenuModuleItem instance to lose focus and fires the onblur event.\r
-    */    \r
+    * @method blur\r
+    * @description Causes the menu item to lose focus and fires the\r
+    * onblur event.\r
+    */\r
     blur: function() {\r
 \r
         var oParent = this.parent;\r
 \r
         if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            this._oDom.getStyle(oParent.element, "visibility") == "visible"\r
+            !this.cfg.getProperty("disabled") &&\r
+            oParent &&\r
+            Dom.getStyle(oParent.element, "visibility") == "visible"\r
         ) {\r
 \r
             this._oAnchor.blur();\r
@@ -3943,8 +6102,9 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
 \r
        /**\r
-       * Removes a MenuModuleItem instance's HTMLLIElement from it's parent\r
-    * HTMLUListElement node.\r
+    * @method destroy\r
+       * @description Removes the menu item's <code>&#60;li&#62;</code> element\r
+       * from its parent <code>&#60;ul&#62;</code> element.\r
        */\r
     destroy: function() {\r
 \r
@@ -3953,7 +6113,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
         if(oEl) {\r
 \r
             // Remove CustomEvent listeners\r
-    \r
+\r
             this.mouseOverEvent.unsubscribeAll();\r
             this.mouseOutEvent.unsubscribeAll();\r
             this.mouseDownEvent.unsubscribeAll();\r
@@ -3983,1274 +6143,991 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         }\r
 \r
+    },\r
+\r
+\r
+    /**\r
+    * @method toString\r
+    * @description Returns a string representing the menu item.\r
+    * @return {String}\r
+    */\r
+    toString: function() {\r
+\r
+        return ("MenuItem: " + this.cfg.getProperty("text"));\r
+\r
     }\r
 \r
 };\r
 \r
+})();\r
+\r
 \r
 /**\r
-* @class Extends YAHOO.widget.MenuModule to provide a set of default mouse and \r
-* key event behaviors.\r
+* Creates an item for a menu module.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object specifying\r
+* the <code>&#60;optgroup&#62;</code> element of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying the\r
+* <code>&#60;option&#62;</code> element of the menu module item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu module item. See configuration class documentation\r
+* for more details.\r
+* @class MenuModuleItem\r
 * @constructor\r
-* @extends YAHOO.widget.MenuModule\r
-* @base YAHOO.widget.MenuModule\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a Menu instance. See \r
-* configuration class documentation for more details.\r
+* @deprecated As of version 0.12, all MenuModuleItem functionality has been\r
+* implemented directly in YAHOO.widget.MenuItem, making YAHOO.widget.MenuItem\r
+* the base class for all menu items.\r
 */\r
-YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
+YAHOO.widget.MenuModuleItem = YAHOO.widget.MenuItem;\r
 \r
-    YAHOO.widget.Menu.superclass.constructor.call(\r
-            this, \r
+\r
+/**\r
+* Creates a list of options or commands which are made visible in response to\r
+* an HTML element's "contextmenu" event ("mousedown" for Opera).\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying\r
+* the <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu. See configuration class documentation\r
+* for more details.\r
+* @class ContextMenu\r
+* @constructor\r
+* @extends YAHOO.widget.Menu\r
+* @namespace YAHOO.widget\r
+*/\r
+YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {\r
+\r
+    YAHOO.widget.ContextMenu.superclass.constructor.call(\r
+            this,\r
             p_oElement,\r
             p_oConfig\r
         );\r
 \r
 };\r
 \r
-YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.MenuModule);\r
 \r
+YAHOO.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu, {\r
 \r
-/**\r
-* The Menu class's initialization method. This method is automatically \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a Menu instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.Menu.prototype.init = function(p_oElement, p_oConfig) {\r
-\r
-    if(!this.ITEM_TYPE) {\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
 \r
-    }\r
+// Private properties\r
 \r
 \r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
+/**\r
+* @property _oTrigger\r
+* @description Object reference to the current value of the "trigger"\r
+* configuration property.\r
+* @default null\r
+* @private\r
+* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve\r
+* l-one-html.html#ID-58190037">HTMLElement</a>|Array\r
+*/\r
+_oTrigger: null,\r
 \r
-    YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
 \r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+// Public properties\r
 \r
 \r
-    // Add event handlers\r
+/**\r
+* @property contextEventTarget\r
+* @description Object reference for the HTML element that was the target of the\r
+* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of\r
+* the context menu.\r
+* @default null\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-58190037">HTMLElement</a>\r
+*/\r
+contextEventTarget: null,\r
 \r
-    this.showEvent.subscribe(this._onMenuShow, this, true);\r
-    this.mouseOverEvent.subscribe(this._onMenuMouseOver, this, true);\r
-    this.keyDownEvent.subscribe(this._onMenuKeyDown, this, true);\r
 \r
+/**\r
+* @method init\r
+* @description The ContextMenu class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying\r
+* the <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu. See configuration class documentation\r
+* for more details.\r
+*/\r
+init: function(p_oElement, p_oConfig) {\r
 \r
-    if(p_oConfig) {\r
+    if(!this.ITEM_TYPE) {\r
 \r
-        this.cfg.applyConfig(p_oConfig, true);\r
+        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
 \r
     }\r
-    \r
-    this.initEvent.fire(YAHOO.widget.Menu);\r
 \r
-};\r
-\r
-\r
-// Private event handlers\r
-\r
-/**\r
-* "show" Custom Event handler for a menu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event.\r
-*/\r
-YAHOO.widget.Menu.prototype._onMenuShow = \r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
+    // Call the init of the superclass (YAHOO.widget.Menu)\r
 \r
-        var oParent = this.parent;\r
+    YAHOO.widget.ContextMenu.superclass.init.call(this, p_oElement);\r
 \r
-        if(oParent && oParent.parent instanceof YAHOO.widget.Menu) {\r
 \r
-            var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-    \r
-            this.cfg.setProperty(\r
-                "submenualignment", \r
-                [ aAlignment[0], aAlignment[1] ]\r
-            );\r
-        \r
-        }\r
+    this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);\r
 \r
-    };\r
 \r
+    if(p_oConfig) {\r
 \r
-/**\r
-* "mouseover" Custom Event handler for a Menu instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance that fired the event.\r
-*/\r
-YAHOO.widget.Menu.prototype._onMenuMouseOver = \r
+        this.cfg.applyConfig(p_oConfig, true);\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        /*\r
-            If the menu is a submenu, then select the menu's parent\r
-            MenuItem instance\r
-        */\r
-    \r
-        if(this.parent) {\r
-    \r
-            this.parent.cfg.setProperty("selected", true);\r
-    \r
-        }\r
-    \r
-    };\r
+    }\r
 \r
 \r
-/**\r
-* "mouseover" Custom Event handler for a Menu instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance that fired the event.\r
-*/\r
-YAHOO.widget.Menu.prototype._onMenuKeyDown = \r
+    this.initEvent.fire(YAHOO.widget.ContextMenu);\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        if(this.cfg.getProperty("position") == "dynamic") {\r
-    \r
-            var oDOMEvent = p_aArgs[0];\r
-            var oParent = this.parent;\r
-        \r
-            if(oDOMEvent.keyCode == 27) { // Esc key\r
-        \r
-                this.hide();\r
-        \r
-                // Set focus to the parent MenuItem if one exists\r
-        \r
-                if(oParent) {\r
-        \r
-                    oParent.focus();\r
+},\r
 \r
-                    if(oParent.parent instanceof YAHOO.widget.Menu) {\r
 \r
-                        oParent.cfg.setProperty("selected", true);\r
-        \r
-                    }\r
 \r
-                    YAHOO.util.Event.preventDefault(oDOMEvent);\r
-        \r
-                }\r
-            \r
-            }\r
-        \r
-        }\r
-    \r
-    };\r
-    \r
+// Private methods\r
 \r
-// Public event handlers\r
 \r
 /**\r
-* Event handler fired when the resize monitor element is resized.\r
-*/\r
-YAHOO.widget.Menu.prototype.onDomResize = function(e, obj) {\r
-\r
-    if(!this._handleResize) {\r
-    \r
-        this._handleResize = true;\r
-        return;\r
-    \r
-    }\r
-\r
-    this.logger.log("Browser font sized changed.");\r
+* @method _removeEventHandlers\r
+* @description Removes all of the DOM event handlers from the HTML element(s)\r
+* whose "context menu" event ("click" for Opera) trigger the display of\r
+* the context menu.\r
+* @private\r
+*/\r
+_removeEventHandlers: function() {\r
 \r
-    var me = this;\r
-    var oConfig = this.cfg;\r
+    var Event = YAHOO.util.Event;\r
+    var oTrigger = this._oTrigger;\r
+    var bOpera = (this.browser == "opera");\r
 \r
-    if(oConfig.getProperty("position") == "dynamic") {\r
 \r
-        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
-        \r
-        if(this.parent && oConfig.getProperty("visible")) {\r
+    // Remove the event handlers from the trigger(s)\r
 \r
-            function align() {\r
+    Event.removeListener(\r
+        oTrigger,\r
+        (bOpera ? "mousedown" : "contextmenu"),\r
+        this._onTriggerContextMenu\r
+    );\r
 \r
-                me.align();\r
-            \r
-            }\r
+    if(bOpera) {\r
 \r
-            window.setTimeout(align, 0);\r
-            \r
-        }\r
+        Event.removeListener(oTrigger, "click", this._onTriggerClick);\r
 \r
     }\r
 \r
-    YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
+},\r
+\r
+\r
 \r
-};    \r
+// Private event handlers\r
 \r
 \r
 /**\r
-* @class The MenuItem class allows you to create and modify an item for a\r
-* Menu instance.  MenuItem extends YAHOO.widget.MenuModuleItem to provide a \r
-* set of default mouse and key event behaviors.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuModuleItem\r
-* @base YAHOO.widget.MenuModuleItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuItem instance. See the configuration \r
-* class documentation for more details.\r
+* @method _onTriggerClick\r
+* @description "click" event handler for the HTML element(s) identified as the\r
+* "trigger" for the context menu.  Used to cancel default behaviors in Opera.\r
+* @private\r
+* @param {Event} p_oEvent Object representing the DOM event object passed back\r
+* by the event utility (YAHOO.util.Event).\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that is handling the event.\r
 */\r
-YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {\r
+_onTriggerClick: function(p_oEvent, p_oMenu) {\r
 \r
-    YAHOO.widget.MenuItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
-        p_oConfig\r
-    );\r
+    if(p_oEvent.ctrlKey) {\r
 \r
-};\r
+        YAHOO.util.Event.stopEvent(p_oEvent);\r
+\r
+    }\r
 \r
-YAHOO.extend(YAHOO.widget.MenuItem, YAHOO.widget.MenuModuleItem);\r
+},\r
 \r
 \r
 /**\r
-* The MenuItem class's initialization method. This method is automatically\r
-* called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuItem instance. See the configuration \r
-* class documentation for more details.\r
+* @method _onTriggerContextMenu\r
+* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML\r
+* element(s) that trigger the display of the context menu.\r
+* @private\r
+* @param {Event} p_oEvent Object representing the DOM event object passed back\r
+* by the event utility (YAHOO.util.Event).\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that is handling the event.\r
 */\r
-YAHOO.widget.MenuItem.prototype.init = function(p_oObject, p_oConfig) {\r
+_onTriggerContextMenu: function(p_oEvent, p_oMenu) {\r
 \r
-    if(!this.SUBMENU_TYPE) {\r
+    // Hide any other ContextMenu instances that might be visible\r
 \r
-        this.SUBMENU_TYPE = YAHOO.widget.Menu;\r
+    YAHOO.widget.MenuManager.hideVisible();\r
 \r
-    }\r
 \r
-    if(!this.SUBMENU_ITEM_TYPE) {\r
+    var Event = YAHOO.util.Event;\r
+    var oConfig = this.cfg;\r
+\r
+    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
 \r
-        this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuItem;\r
+        return;\r
 \r
     }\r
 \r
+    this.contextEventTarget = Event.getTarget(p_oEvent);\r
 \r
-    /* \r
-        Call the init of the superclass (YAHOO.widget.MenuModuleItem)\r
-        Note: We don't pass the user config in here yet \r
-        because we only want it executed once, at the lowest \r
-        subclass level.\r
-    */ \r
 \r
-    YAHOO.widget.MenuItem.superclass.init.call(this, p_oObject);  \r
+    // Position and display the context menu\r
 \r
+    var nX = Event.getPageX(p_oEvent);\r
+    var nY = Event.getPageY(p_oEvent);\r
 \r
-    // Add event handlers to each "MenuItem" instance\r
 \r
-    this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
-    this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
-    this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
+    oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
+    oConfig.fireQueue();\r
 \r
-    var oConfig = this.cfg;\r
 \r
-    if(p_oConfig) {\r
+    /*\r
+        Prevent the browser's default context menu from appearing and\r
+        stop the propagation of the "contextmenu" event so that\r
+        other ContextMenu instances are not displayed.\r
+    */\r
 \r
-        oConfig.applyConfig(p_oConfig, true);\r
+    Event.stopEvent(p_oEvent);\r
 \r
-    }\r
+},\r
 \r
-    oConfig.fireQueue();\r
 \r
-};\r
 \r
+// Public methods\r
 \r
-// Constants\r
 \r
 /**\r
-* Constant representing the path to the image to be used for the checked state.\r
-* @final\r
-* @type String\r
+* @method toString\r
+* @description Returns a string representing the context menu.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_nrm_1.gif";\r
+toString: function() {\r
 \r
-/**\r
-* Constant representing the path to the image to be used for the selected \r
-* checked state.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.SELECTED_CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_hov_1.gif";\r
+    return ("ContextMenu " + this.id);\r
+\r
+},\r
 \r
-/**\r
-* Constant representing the path to the image to be used for the disabled \r
-* checked state.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_dim_1.gif";\r
 \r
 /**\r
-* Constant representing the alt text for the image to be used for the \r
-* checked image.\r
-* @final\r
-* @type String\r
+* @method initDefaultConfig\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the context menu's Config object ("cfg").\r
 */\r
-YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_ALT_TEXT = "Checked.";\r
+initDefaultConfig: function() {\r
 \r
+    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\r
 \r
-/**\r
-* Constant representing the alt text for the image to be used for the \r
-* checked image when the item is disabled.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_ALT_TEXT = \r
-    "Checked. (Item disabled.)";\r
+    /**\r
+    * @config trigger\r
+    * @description The HTML element(s) whose "contextmenu" event ("mousedown"\r
+    * for Opera) trigger the display of the context menu.  Can be a string\r
+    * representing the id attribute of the HTML element, an object reference\r
+    * for the HTML element, or an array of strings or HTML element references.\r
+    * @default null\r
+    * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>|Array\r
+    */\r
+    this.cfg.addProperty("trigger", { handler: this.configTrigger });\r
 \r
+},\r
 \r
-// Private properties\r
 \r
 /**\r
-* Reference to the HTMLImageElement used to create the checked\r
-* indicator for a MenuItem instance.\r
-* @private\r
-* @type {HTMLImageElement}\r
+* @method destroy\r
+* @description Removes the context menu's <code>&#60;div&#62;</code> element\r
+* (and accompanying child nodes) from the document.\r
 */\r
-YAHOO.widget.MenuItem.prototype._checkImage = null;\r
+destroy: function() {\r
+\r
+    // Remove the DOM event handlers from the current trigger(s)\r
+\r
+    this._removeEventHandlers();\r
+\r
+\r
+    // Continue with the superclass implementation of this method\r
+\r
+    YAHOO.widget.ContextMenu.superclass.destroy.call(this);\r
+\r
+},\r
 \r
 \r
-// Private event handlers\r
+\r
+// Public event handlers for configuration properties\r
 \r
 \r
 /**\r
-* "keydown" Custom Event handler for a MenuItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configTrigger\r
+* @description Event handler for when the value of the "trigger" configuration\r
+* property changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that fired the event.\r
 */\r
-YAHOO.widget.MenuItem.prototype._onKeyDown = \r
+configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
+    var Event = YAHOO.util.Event;\r
+    var oTrigger = p_aArgs[0];\r
 \r
-        var Event = YAHOO.util.Event;\r
-        var oDOMEvent = p_aArgs[0];\r
-        var oParent = this.parent;\r
-        var oConfig = this.cfg;\r
-        var oMenuItem;\r
-    \r
+    if(oTrigger) {\r
 \r
-        switch(oDOMEvent.keyCode) {\r
-    \r
-            case 38:    // Up arrow\r
-            case 40:    // Down arrow\r
-    \r
-                if(\r
-                    this == oParent.activeItem && \r
-                    !oConfig.getProperty("selected")\r
-                ) {\r
-    \r
-                    oConfig.setProperty("selected", true);\r
-    \r
-                }\r
-                else {\r
-    \r
-                    var oNextItem = (oDOMEvent.keyCode == 38) ? \r
-                            this.getPreviousEnabledSibling() : \r
-                            this.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
+        /*\r
+            If there is a current "trigger" - remove the event handlers\r
+            from that element(s) before assigning new ones\r
+        */\r
 \r
-                        oParent.clearActiveItem();\r
+        if(this._oTrigger) {\r
 \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-            \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oDOMEvent);\r
+            this._removeEventHandlers();\r
 \r
-            break;\r
-            \r
-    \r
-            case 39:    // Right arrow\r
+        }\r
+\r
+        this._oTrigger = oTrigger;\r
 \r
-                oParent.clearActiveItem();\r
 \r
-                oConfig.setProperty("selected", true);\r
-                \r
-                this.focus();\r
+        /*\r
+            Listen for the "mousedown" event in Opera b/c it does not\r
+            support the "contextmenu" event\r
+        */\r
 \r
+        var bOpera = (this.browser == "opera");\r
 \r
-                var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
+        Event.addListener(\r
+            oTrigger,\r
+            (bOpera ? "mousedown" : "contextmenu"),\r
+            this._onTriggerContextMenu,\r
+            this,\r
+            true\r
+        );\r
 \r
-                    oSubmenu.show();\r
-                    oSubmenu.setInitialSelection();                    \r
-    \r
-                }\r
-                else if(\r
-                    YAHOO.widget.MenuBarItem && \r
-                    oParent.parent && \r
-                    oParent.parent instanceof YAHOO.widget.MenuBarItem\r
-                ) {\r
 \r
-                    oParent.hide();\r
-    \r
-                    // Set focus to the parent MenuItem if one exists\r
-    \r
-                    oMenuItem = oParent.parent;\r
-    \r
-                    if(oMenuItem) {\r
-    \r
-                        oMenuItem.focus();\r
-                        oMenuItem.cfg.setProperty("selected", true);\r
-    \r
-                    }                    \r
-                \r
-                }\r
-    \r
-                Event.preventDefault(oDOMEvent);\r
+        /*\r
+            Assign a "click" event handler to the trigger element(s) for\r
+            Opera to prevent default browser behaviors.\r
+        */\r
 \r
-            break;\r
-    \r
-    \r
-            case 37:    // Left arrow\r
-    \r
-                // Only hide if this this is a MenuItem of a submenu\r
-    \r
-                if(oParent.parent) {\r
-    \r
-                    oParent.hide();\r
-    \r
-                    // Set focus to the parent MenuItem if one exists\r
-    \r
-                    oMenuItem = oParent.parent;\r
-    \r
-                    if(oMenuItem) {\r
-    \r
-                        oMenuItem.focus();\r
-                        oMenuItem.cfg.setProperty("selected", true);\r
-    \r
-                    }\r
-    \r
-                }\r
+        if(bOpera) {\r
+\r
+            Event.addListener(\r
+                oTrigger,\r
+                "click",\r
+                this._onTriggerClick,\r
+                this,\r
+                true\r
+            );\r
 \r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;        \r
-    \r
         }\r
-    \r
-    };\r
+\r
+    }\r
+    else {\r
+\r
+        this._removeEventHandlers();\r
+\r
+    }\r
+\r
+}\r
+\r
+}); // END YAHOO.extend\r
 \r
 \r
 /**\r
-* "mouseover" Custom Event handler for a MenuItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* Creates an item for a context menu.\r
+*\r
+* @param {String} p_oObject String specifying the text of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the context\r
+* menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the context menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu item. See configuration class\r
+* documentation for more details.\r
+* @class ContextMenuItem\r
+* @constructor\r
+* @extends YAHOO.widget.MenuItem\r
 */\r
-YAHOO.widget.MenuItem.prototype._onMouseOver = \r
+YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
+    YAHOO.widget.ContextMenuItem.superclass.constructor.call(\r
+        this,\r
+        p_oObject,\r
+        p_oConfig\r
+    );\r
 \r
-        var oParent = this.parent;\r
-        var oConfig = this.cfg;\r
-        var oActiveItem = oParent.activeItem;\r
-    \r
-    \r
-        // Hide any other submenus that might be visible\r
-    \r
-        if(oActiveItem && oActiveItem != this) {\r
-    \r
-            oParent.clearActiveItem();\r
-    \r
-        }\r
-    \r
-    \r
-        // Select and focus the current MenuItem instance\r
-    \r
-        oConfig.setProperty("selected", true);\r
-        this.focus();\r
-    \r
-    \r
-        // Show the submenu for this instance\r
-    \r
-        var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            oSubmenu.show();\r
-    \r
-        }\r
-    \r
-    };\r
+};\r
+\r
+YAHOO.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {\r
 \r
 \r
 /**\r
-* "mouseout" Custom Event handler for a MenuItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* @method init\r
+* @description The ContextMenuItem class's initialization method. This method\r
+* is automatically called by the constructor, and sets up all DOM references\r
+* for pre-existing markup, and creates required markup if it is not\r
+* already present.\r
+* @param {String} p_oObject String specifying the text of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the context\r
+* menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the context menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu item. See configuration class\r
+* documentation for more details.\r
 */\r
-YAHOO.widget.MenuItem.prototype._onMouseOut = \r
+init: function(p_oObject, p_oConfig) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
-    \r
-        var oConfig = this.cfg;\r
-        var oSubmenu = oConfig.getProperty("submenu");\r
+    if(!this.SUBMENU_TYPE) {\r
 \r
-        oConfig.setProperty("selected", false);\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            var oDOMEvent = p_aArgs[0];\r
-            var oRelatedTarget = YAHOO.util.Event.getRelatedTarget(oDOMEvent);\r
-    \r
-            if(\r
-                !(\r
-                    oRelatedTarget == oSubmenu.element || \r
-                    YAHOO.util.Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
-                )\r
-            ) {\r
-    \r
-                oSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-    };\r
+        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\r
 \r
+    }\r
 \r
-// Event handlers for configuration properties\r
 \r
-/**\r
-* Event handler for when the "checked" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
-* that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configChecked =\r
+    /*\r
+        Call the init of the superclass (YAHOO.widget.MenuItem)\r
+        Note: We don't pass the user config in here yet\r
+        because we only want it executed once, at the lowest\r
+        subclass level.\r
+    */\r
 \r
-    function(p_sType, p_aArgs, p_oItem) {\r
-    \r
-        var Dom = YAHOO.util.Dom;\r
-        var bChecked = p_aArgs[0];\r
-        var oEl = this.element;\r
-        var oConfig = this.cfg;\r
-        var oImg;\r
-        \r
+    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);\r
 \r
-        if(bChecked) {\r
+    var oConfig = this.cfg;\r
 \r
-            var me = this;\r
+    if(p_oConfig) {\r
 \r
-            function preloadImage(p_sPath) {\r
+        oConfig.applyConfig(p_oConfig, true);\r
 \r
-                var sPath = me.imageRoot + p_sPath;\r
+    }\r
 \r
-                if(!document.images[sPath]) {\r
+    oConfig.fireQueue();\r
 \r
-                    var oImg = document.createElement("img");\r
-                    oImg.src = sPath;\r
-                    oImg.name = sPath;\r
-                    oImg.id = sPath;\r
-                    oImg.style.display = "none";\r
-                    \r
-                    document.body.appendChild(oImg);\r
+},\r
 \r
-                }\r
-            \r
-            }\r
 \r
-            preloadImage(this.CHECKED_IMAGE_PATH);\r
-            preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);\r
-            preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);\r
 \r
+// Public methods\r
 \r
-            oImg = document.createElement("img");\r
-            oImg.src = (this.imageRoot + this.CHECKED_IMAGE_PATH);\r
-            oImg.alt = this.CHECKED_IMAGE_ALT_TEXT;\r
 \r
-            var oSubmenu = this.cfg.getProperty("submenu");\r
+/**\r
+* @method toString\r
+* @description Returns a string representing the context menu item.\r
+* @return {String}\r
+*/\r
+toString: function() {\r
 \r
-            if(oSubmenu) {\r
+    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
 \r
-                oEl.insertBefore(oImg, oSubmenu.element);\r
+}\r
 \r
-            }\r
-            else {\r
+}); // END YAHOO.extend\r
 \r
-                oEl.appendChild(oImg);            \r
 \r
-            }\r
+/**\r
+* Horizontal collection of items, each of which can contain a submenu.\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying\r
+* the <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu bar.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar. See configuration class documentation for\r
+* more details.\r
+* @class Menubar\r
+* @constructor\r
+* @extends YAHOO.widget.Menu\r
+* @namespace YAHOO.widget\r
+*/\r
+YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {\r
 \r
+    YAHOO.widget.MenuBar.superclass.constructor.call(\r
+            this,\r
+            p_oElement,\r
+            p_oConfig\r
+        );\r
 \r
-            Dom.addClass([oEl, oImg], "checked");\r
+};\r
 \r
-            this._checkImage = oImg;\r
+YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.Menu, {\r
 \r
-            if(oConfig.getProperty("disabled")) {\r
+/**\r
+* @method init\r
+* @description The MenuBar class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying\r
+* the <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu bar.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar. See configuration class documentation for\r
+* more details.\r
+*/\r
+init: function(p_oElement, p_oConfig) {\r
 \r
-                oConfig.refireEvent("disabled");\r
+    if(!this.ITEM_TYPE) {\r
 \r
-            }\r
+        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
 \r
-            if(oConfig.getProperty("selected")) {\r
+    }\r
 \r
-                oConfig.refireEvent("selected");\r
 \r
-            }\r
-        \r
-        }\r
-        else {\r
+    // Call the init of the superclass (YAHOO.widget.Menu)\r
 \r
-            oImg = this._checkImage;\r
+    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
 \r
-            Dom.removeClass([oEl, oImg], "checked");\r
 \r
-            if(oImg) {\r
+    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
 \r
-                oEl.removeChild(oImg);\r
 \r
-            }\r
+    if(p_oConfig) {\r
 \r
-            this._checkImage = null;\r
-        \r
-        }\r
+        this.cfg.applyConfig(p_oConfig, true);\r
+\r
+    }\r
+\r
+    this.initEvent.fire(YAHOO.widget.MenuBar);\r
+\r
+},\r
+\r
+\r
+\r
+// Constants\r
 \r
-    };\r
-    \r
 \r
 /**\r
-* Event handler for when the "selected" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the menu\r
+* bar's <code>&#60;div&#62;</code> element.\r
+* @default "yuimenubar"\r
+* @final\r
+* @type String\r
+*/\r
+CSS_CLASS_NAME: "yuimenubar",\r
+\r
+\r
+\r
+// Protected event handlers\r
+\r
+\r
+/**\r
+* @method _onKeyDown\r
+* @description "keydown" Custom Event handler for the menu bar.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar\r
 * that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configSelected = \r
+*/\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
+\r
+    var Event = YAHOO.util.Event;\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oItemCfg = oItem.cfg;\r
+    var oSubmenu;\r
+\r
 \r
-    function(p_sType, p_aArgs, p_oItem) {\r
+    switch(oEvent.keyCode) {\r
 \r
-        YAHOO.widget.MenuItem.superclass.configSelected.call(\r
-                this, p_sType, p_aArgs, p_oItem\r
-            );        \r
-    \r
-        var oConfig = this.cfg;\r
+        case 27:    // Esc key\r
 \r
-        if(!oConfig.getProperty("disabled") && oConfig.getProperty("checked")) {\r
+            if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-            var bSelected = p_aArgs[0];\r
+                this.hide();\r
 \r
-            var sSrc = this.imageRoot + (bSelected ? \r
-                this.SELECTED_CHECKED_IMAGE_PATH : this.CHECKED_IMAGE_PATH);\r
+                if(this.parent) {\r
 \r
-            this._checkImage.src = document.images[sSrc].src;\r
-            \r
-        }            \r
-    \r
-    };\r
+                    this.parent.focus();\r
 \r
+                }\r
 \r
-/**\r
-* Event handler for when the "disabled" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
-* that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configDisabled = \r
-\r
-    function(p_sType, p_aArgs, p_oItem) {\r
-    \r
-        YAHOO.widget.MenuItem.superclass.configDisabled.call(\r
-                this, p_sType, p_aArgs, p_oItem\r
-            );        \r
-    \r
-        if(this.cfg.getProperty("checked")) {\r
-    \r
-            var bDisabled = p_aArgs[0];\r
-            var sAlt = this.CHECKED_IMAGE_ALT_TEXT;\r
-            var sSrc = this.CHECKED_IMAGE_PATH;\r
-            var oImg = this._checkImage;\r
-            \r
-            if(bDisabled) {\r
-    \r
-                sAlt = this.DISABLED_CHECKED_IMAGE_ALT_TEXT;\r
-                sSrc = this.DISABLED_CHECKED_IMAGE_PATH;\r
-            \r
             }\r
+            else if(this.activeItem) {\r
 \r
-            oImg.src = document.images[(this.imageRoot + sSrc)].src;\r
-            oImg.alt = sAlt;\r
-            \r
-        }    \r
-            \r
-    };\r
+                oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
 \r
+                if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
 \r
-// Public methods\r
-    \r
-/**\r
-* Initializes the class's configurable properties which can be changed using \r
-* the MenuModule's Config object (cfg).\r
-*/\r
-YAHOO.widget.MenuItem.prototype.initDefaultConfig = function() {\r
+                    oSubmenu.hide();\r
+                    this.activeItem.focus();\r
 \r
-    YAHOO.widget.MenuItem.superclass.initDefaultConfig.call(this);\r
+                }\r
+                else {\r
 \r
-       // Add configuration properties\r
+                    this.activeItem.cfg.setProperty("selected", false);\r
+                    this.activeItem.blur();\r
 \r
-    this.cfg.addProperty(\r
-        "checked", \r
-        {\r
-            value: false, \r
-            handler: this.configChecked, \r
-            validator: this.cfg.checkBoolean, \r
-            suppressEvent: true \r
-        } \r
-    );\r
+                }\r
 \r
-};\r
+            }\r
 \r
 \r
-/**\r
-* @class Creates a list of options which vary depending on the context in \r
-* which the menu is invoked.\r
-* @constructor\r
-* @extends YAHOO.widget.Menu\r
-* @base YAHOO.widget.Menu\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a ContextMenu instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {\r
+            Event.preventDefault(oEvent);\r
 \r
-    YAHOO.widget.ContextMenu.superclass.constructor.call(\r
-            this, \r
-            p_oElement,\r
-            p_oConfig\r
-        );\r
+        break;\r
 \r
-};\r
+        case 37:    // Left arrow\r
+        case 39:    // Right arrow\r
 \r
-YAHOO.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu);\r
+            if(\r
+                oItem == this.activeItem &&\r
+                !oItemCfg.getProperty("selected")\r
+            ) {\r
 \r
+                oItemCfg.setProperty("selected", true);\r
 \r
-YAHOO.widget.ContextMenu.prototype._oTrigger = null;\r
+            }\r
+            else {\r
 \r
+                var oNextItem = (oEvent.keyCode == 37) ?\r
+                        oItem.getPreviousEnabledSibling() :\r
+                        oItem.getNextEnabledSibling();\r
 \r
-/**\r
-* The ContextMenu class's initialization method. This method is automatically  \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a ContextMenu instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.init = function(p_oElement, p_oConfig) {\r
+                if(oNextItem) {\r
 \r
-    if(!this.ITEM_TYPE) {\r
+                    this.clearActiveItem();\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
+                    oNextItem.cfg.setProperty("selected", true);\r
 \r
-    }\r
 \r
+                    if(this.cfg.getProperty("autosubmenudisplay")) {\r
 \r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
+                        oSubmenu = oNextItem.cfg.getProperty("submenu");\r
 \r
-    YAHOO.widget.ContextMenu.superclass.init.call(this, p_oElement);\r
+                        if(oSubmenu) {\r
 \r
+                            oSubmenu.show();\r
+                            oSubmenu.activeItem.blur();\r
+                            oSubmenu.activeItem = null;\r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);\r
+                        }\r
 \r
+                    }\r
 \r
-    if(p_oConfig) {\r
+                    oNextItem.focus();\r
 \r
-        this.cfg.applyConfig(p_oConfig, true);\r
+                }\r
 \r
-    }\r
-    \r
-    \r
-    this.initEvent.fire(YAHOO.widget.ContextMenu);\r
+            }\r
 \r
+            Event.preventDefault(oEvent);\r
 \r
-};\r
+        break;\r
 \r
+        case 40:    // Down arrow\r
 \r
-// Private event handlers\r
+            if(this.activeItem != oItem) {\r
 \r
-/**\r
-* "mousedown" event handler for the document object.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype._onDocumentMouseDown = \r
+                this.clearActiveItem();\r
 \r
-    function(p_oEvent, p_oMenu) {\r
-    \r
-        var oTarget = YAHOO.util.Event.getTarget(p_oEvent);\r
-        var oTargetEl = this._oTargetElement;\r
-    \r
-        if(\r
-            oTarget != oTargetEl || \r
-            !YAHOO.util.Dom.isAncestor(oTargetEl, oTarget)\r
-        ) {\r
-    \r
-            this.hide();\r
-        \r
-        }\r
-    \r
-    };\r
+                oItemCfg.setProperty("selected", true);\r
+                oItem.focus();\r
 \r
+            }\r
 \r
-/**\r
-* "click" event handler for the HTMLElement node that triggered the event. \r
-* Used to cancel default behaviors in Opera.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype._onTriggerClick = \r
+            oSubmenu = oItemCfg.getProperty("submenu");\r
 \r
-    function(p_oEvent, p_oMenu) {\r
+            if(oSubmenu) {\r
 \r
-        if(p_oEvent.ctrlKey) {\r
-        \r
-            YAHOO.util.Event.stopEvent(p_oEvent);\r
-    \r
-        }\r
-        \r
-    };\r
+                if(oSubmenu.cfg.getProperty("visible")) {\r
 \r
+                    oSubmenu.setInitialSelection();\r
+                    oSubmenu.setInitialFocus();\r
 \r
-/**\r
-* "contextmenu" event handler ("mousedown" for Opera) for the HTMLElement \r
-* node that triggered the event.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype._onTriggerContextMenu = \r
+                }\r
+                else {\r
 \r
-    function(p_oEvent, p_oMenu) {\r
+                    oSubmenu.show();\r
 \r
-        var Event = YAHOO.util.Event;\r
-        var oConfig = this.cfg;\r
+                }\r
 \r
-        if(p_oEvent.type == "mousedown") {\r
-        \r
-            if(!p_oEvent.ctrlKey) {\r
-    \r
-                return;\r
-            \r
             }\r
-        \r
-            Event.stopEvent(p_oEvent);\r
-    \r
-        }\r
-    \r
-    \r
-        this.contextEventTarget = Event.getTarget(p_oEvent);\r
-    \r
-    \r
-        // Position and display the context menu\r
-    \r
-        var nX = Event.getPageX(p_oEvent);\r
-        var nY = Event.getPageY(p_oEvent);\r
-    \r
-    \r
-        oConfig.applyConfig( { x:nX, y:nY, visible:true } );\r
-        oConfig.fireQueue();\r
-    \r
-    \r
-        // Prevent the browser's default context menu from appearing\r
-    \r
-        Event.preventDefault(p_oEvent);\r
-    \r
-    };\r
 \r
+            Event.preventDefault(oEvent);\r
 \r
-// Public properties\r
+        break;\r
 \r
-/**\r
-* Returns the HTMLElement node that was the target of the "contextmenu" \r
-* DOM event.\r
-* @type HTMLElement\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.contextEventTarget = null;\r
+    }\r
 \r
+},\r
 \r
-// Public methods\r
 \r
 /**\r
-* Initializes the class's configurable properties which can be changed using \r
-* a ContextMenu instance's Config object (cfg).\r
+* @method _onClick\r
+* @description "click" event handler for the menu bar.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar\r
+* that fired the event.\r
 */\r
-YAHOO.widget.ContextMenu.prototype.initDefaultConfig = function() {\r
+_onClick: function(p_sType, p_aArgs, p_oMenuBar) {\r
 \r
-    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\r
+    YAHOO.widget.MenuBar.superclass._onClick.call(\r
+        this,\r
+        p_sType,\r
+        p_aArgs,\r
+        p_oMenuBar\r
+    );\r
 \r
 \r
-       // Add a configuration property\r
+    var oItem = p_aArgs[1];\r
 \r
-    this.cfg.addProperty("trigger", { handler: this.configTrigger });\r
+    if(oItem) {\r
 \r
-};\r
+        var Event = YAHOO.util.Event;\r
+        var Dom = YAHOO.util.Dom;\r
 \r
+        var oEvent = p_aArgs[0];\r
+        var oTarget = Event.getTarget(oEvent);\r
 \r
-// Event handlers for configuration properties\r
+        var oActiveItem = this.activeItem;\r
+        var oConfig = this.cfg;\r
 \r
-/**\r
-* Event handler for when the "trigger" configuration property of\r
-* a MenuItem instance. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu that instance fired\r
-* the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.configTrigger = \r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        var Event = YAHOO.util.Event;\r
-        var oTrigger = p_aArgs[0];\r
-    \r
-        if(oTrigger) {\r
-    \r
+        // Hide any other submenus that might be visible\r
 \r
-            /*\r
-                If there is a current "trigger" - remove the event handlers \r
-                from that element(s) before assigning new ones\r
-            */\r
-            if(this._oTrigger) {\r
-            \r
-                Event.purgeElement(this._oTrigger);\r
+        if(oActiveItem && oActiveItem != oItem) {\r
 \r
-            }\r
+            this.clearActiveItem();\r
 \r
+        }\r
 \r
-            this._oTrigger = oTrigger;\r
 \r
+        // Select and focus the current item\r
 \r
-            /*\r
-                Listen for the "mousedown" event in Opera b/c it does not \r
-                support the "contextmenu" event\r
-            */ \r
-      \r
-            var bOpera = (this.browser == "opera");\r
-    \r
-            Event.addListener(\r
-                oTrigger, \r
-                (bOpera ? "mousedown" : "contextmenu"), \r
-                this._onTriggerContextMenu,\r
-                this,\r
-                true\r
-            );\r
-    \r
-    \r
-            /*\r
-                Assign a "click" event handler to the trigger element(s) for\r
-                Opera to prevent default browser behaviors.\r
-            */\r
-    \r
-            if(bOpera) {\r
-            \r
-                Event.addListener(\r
-                    oTrigger, \r
-                    "click", \r
-                    this._onTriggerClick,\r
-                    this,\r
-                    true\r
-                );\r
-    \r
-            }\r
-    \r
-    \r
-            // Assign a "mousedown" event handler to the document\r
-        \r
-            Event.addListener(\r
-                document, \r
-                "mousedown", \r
-                this._onDocumentMouseDown,\r
-                this,\r
-                true\r
-            );        \r
-    \r
-        }\r
-        \r
-    };\r
+        oItem.cfg.setProperty("selected", true);\r
+        oItem.focus();\r
 \r
 \r
-/**\r
-* @class Creates an item for a context menu instance.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuItem\r
-* @base YAHOO.widget.MenuItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a ContextMenuItem instance. See the configuration \r
-* class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {\r
+        // Show the submenu for the item\r
 \r
-    YAHOO.widget.ContextMenuItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
-        p_oConfig\r
-    );\r
+        var oSubmenu = oItem.cfg.getProperty("submenu");\r
 \r
-};\r
 \r
-YAHOO.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem);\r
+        if(oSubmenu && oTarget != oItem.submenuIndicator) {\r
 \r
+            if(oSubmenu.cfg.getProperty("visible")) {\r
 \r
-/**\r
-* The ContextMenuItem class's initialization method. This method is\r
-* automatically called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a ContextMenuItem instance. See the configuration \r
-* class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenuItem.prototype.init = \r
+                oSubmenu.hide();\r
 \r
-    function(p_oObject, p_oConfig) {\r
-    \r
-        if(!this.SUBMENU_TYPE) {\r
-    \r
-            this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\r
-    \r
-        }\r
-    \r
-        if(!this.SUBMENU_ITEM_TYPE) {\r
-    \r
-            this.SUBMENU_ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
-    \r
-        }\r
-    \r
-    \r
-        /* \r
-            Call the init of the superclass (YAHOO.widget.MenuItem)\r
-            Note: We don't pass the user config in here yet \r
-            because we only want it executed once, at the lowest \r
-            subclass level.\r
-        */ \r
-    \r
-        YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);\r
+            }\r
+            else {\r
+\r
+                oSubmenu.show();\r
+\r
+            }\r
 \r
-        var oConfig = this.cfg;\r
-    \r
-        if(p_oConfig) {\r
-    \r
-            oConfig.applyConfig(p_oConfig, true);\r
-    \r
         }\r
-    \r
-        oConfig.fireQueue();\r
-    \r
-    };\r
 \r
+    }\r
 \r
-/**\r
-* @class Horizontal collection of items, each of which can contain a submenu.\r
-* Extends YAHOO.widget.MenuModule to provide a set of default mouse and \r
-* key event behaviors.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuModule\r
-* @base YAHOO.widget.MenuModule\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuBar instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {\r
+},\r
 \r
-    YAHOO.widget.MenuBar.superclass.constructor.call(\r
-            this, \r
-            p_oElement,\r
-            p_oConfig\r
-        );\r
 \r
-};\r
 \r
-YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.MenuModule);\r
+// Public methods\r
 \r
 \r
 /**\r
-* The MenuBar class's initialization method. This method is automatically \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuBar instance. See \r
-* configuration class documentation for more details.\r
+* @method toString\r
+* @description Returns a string representing the menu bar.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuBar.prototype.init = function(p_oElement, p_oConfig) {\r
-\r
-    if(!this.ITEM_TYPE) {\r
+toString: function() {\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
+    return ("MenuBar " + this.id);\r
 \r
-    }\r
+},\r
 \r
 \r
-    // Call the init of the superclass (YAHOO.widget.MenuModule)\r
+/**\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the menu bar's Config object ("cfg").\r
+* @method initDefaultConfig\r
+*/\r
+initDefaultConfig: function() {\r
 \r
-    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
+    YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);\r
 \r
+    var oConfig = this.cfg;\r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
+       // Add configuration properties\r
 \r
-    var oConfig = this.cfg;\r
 \r
     /*\r
         Set the default value for the "position" configuration property\r
-        to "static" \r
+        to "static" by re-adding the property.\r
     */\r
-    if(!p_oConfig || (p_oConfig && !p_oConfig.position)) {\r
 \r
-        oConfig.queueProperty("position", "static");\r
+    /**\r
+    * @config position\r
+    * @description String indicating how a menu bar should be positioned on the\r
+    * screen.  Possible values are "static" and "dynamic."  Static menu bars\r
+    * are visible by default and reside in the normal flow of the document\r
+    * (CSS position: static).  Dynamic menu bars are hidden by default, reside\r
+    * out of the normal flow of the document (CSS position: absolute), and can\r
+    * overlay other elements on the screen.\r
+    * @default static\r
+    * @type String\r
+    */\r
+    oConfig.addProperty(\r
+        "position",\r
+        {\r
+            value: "static",\r
+            handler: this.configPosition,\r
+            validator: this._checkPosition,\r
+            supercedes: ["visible"]\r
+        }\r
+    );\r
 \r
-    }\r
 \r
     /*\r
         Set the default value for the "submenualignment" configuration property\r
-        to "tl" and "bl" \r
+        to ["tl","bl"] by re-adding the property.\r
     */\r
-    if(!p_oConfig || (p_oConfig && !p_oConfig.submenualignment)) {\r
-\r
-        oConfig.queueProperty("submenualignment", ["tl","bl"]);\r
-\r
-    }\r
 \r
+    /**\r
+    * @config submenualignment\r
+    * @description Array defining how submenus should be aligned to their\r
+    * parent menu bar item. The format is: [itemCorner, submenuCorner].\r
+    * @default ["tl","bl"]\r
+    * @type Array\r
+    */\r
+    oConfig.addProperty("submenualignment", { value: ["tl","bl"] } );\r
 \r
-    if(p_oConfig) {\r
-\r
-        oConfig.applyConfig(p_oConfig, true);\r
-\r
-    }\r
-    \r
-    this.initEvent.fire(YAHOO.widget.MenuBar);\r
 \r
-};\r
+    /*\r
+        Change the default value for the "autosubmenudisplay" configuration\r
+        property to "false" by re-adding the property.\r
+    */\r
 \r
+    /**\r
+    * @config autosubmenudisplay\r
+    * @description Boolean indicating if submenus are automatically made\r
+    * visible when the user mouses over the menu bar's items.\r
+    * @default false\r
+    * @type Boolean\r
+    */\r
+       oConfig.addProperty(\r
+          "autosubmenudisplay",\r
+          { value: false, validator: oConfig.checkBoolean }\r
+    );\r
 \r
-// Constants\r
+}\r
 \r
-/**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLDivElement of the MenuBar instance.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuBar.prototype.CSS_CLASS_NAME = "yuimenubar";\r
+}); // END YAHOO.extend\r
 \r
 \r
 /**\r
-* @class The MenuBarItem class allows you to create and modify an item for a\r
-* MenuBar instance.  MenuBarItem extends YAHOO.widget.MenuModuleItem to provide \r
-* a set of default mouse and key event behaviors.\r
+* Creates an item for a menu bar.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the menu bar item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar item. See configuration class documentation\r
+* for more details.\r
+* @class MenuBarItem\r
 * @constructor\r
-* @extends YAHOO.widget.MenuModuleItem\r
-* @base YAHOO.widget.MenuModuleItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuBarItem instance. See the configuration \r
-* class documentation for more details.\r
+* @extends YAHOO.widget.MenuItem\r
 */\r
 YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) {\r
 \r
     YAHOO.widget.MenuBarItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
+        this,\r
+        p_oObject,\r
         p_oConfig\r
     );\r
 \r
 };\r
 \r
-YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuModuleItem);\r
+YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {\r
 \r
 \r
 /**\r
-* The MenuBarItem class's initialization method. This method is automatically\r
-* called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuBarItem instance. See the configuration \r
-* class documentation for more details.\r
+* @method init\r
+* @description The MenuBarItem class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oObject String specifying the text of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the menu bar item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar item. See configuration class documentation\r
+* for more details.\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {\r
+init: function(p_oObject, p_oConfig) {\r
 \r
     if(!this.SUBMENU_TYPE) {\r
 \r
@@ -5258,26 +7135,16 @@ YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {
 \r
     }\r
 \r
-    if(!this.SUBMENU_ITEM_TYPE) {\r
-\r
-        this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuItem;\r
-\r
-    }\r
-\r
 \r
-    /* \r
-        Call the init of the superclass (YAHOO.widget.MenuModuleItem)\r
-        Note: We don't pass the user config in here yet \r
-        because we only want it executed once, at the lowest \r
+    /*\r
+        Call the init of the superclass (YAHOO.widget.MenuItem)\r
+        Note: We don't pass the user config in here yet\r
+        because we only want it executed once, at the lowest\r
         subclass level.\r
-    */ \r
-\r
-    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);  \r
-\r
+    */\r
 \r
-    // Add event handlers to each "MenuBarItem" instance\r
+    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);\r
 \r
-    this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
 \r
     var oConfig = this.cfg;\r
 \r
@@ -5289,126 +7156,69 @@ YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {
 \r
     oConfig.fireQueue();\r
 \r
-};\r
+},\r
+\r
 \r
 \r
 // Constants\r
 \r
 /**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLLIElement of the MenuBarItem.\r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @default "yuimenubaritem"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.CSS_CLASS_NAME = "yuimenubaritem";\r
+CSS_CLASS_NAME: "yuimenubaritem",\r
 \r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator.\r
+* @property SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* menu bar item's submenu arrow indicator.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.SUBMENU_INDICATOR_IMAGE_PATH =\r
-    "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif";\r
+SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",\r
 \r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator when a MenuBarItem instance is selected.\r
+* @property SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* submenu arrow indicator when the menu bar item is selected.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_hov_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH =\r
-    "nt/ic/ut/alt1/menuarodwn8_hov_1.gif";\r
+SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_hov_1.gif",\r
 \r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator when a MenuBarItem instance is disabled.\r
+* @property DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* submenu arrow indicator when the menu bar item is disabled.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_dim_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH = \r
-    "nt/ic/ut/alt1/menuarodwn8_dim_1.gif";\r
-\r
-\r
-// Private event handlers\r
-\r
-/**\r
-* "keydown" Custom Event handler for a MenuBarItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
-*/\r
-YAHOO.widget.MenuBarItem.prototype._onKeyDown =\r
+DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_dim_1.gif",\r
 \r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
 \r
-        var Event = YAHOO.util.Event;\r
-        var oDOMEvent = p_aArgs[0];\r
-        var oConfig = this.cfg;\r
-        var oParent = this.parent;\r
-    \r
-        switch(oDOMEvent.keyCode) {\r
-    \r
-            case 37:    // Left arrow\r
-            case 39:    // Right arrow\r
-    \r
-                if(\r
-                    this == oParent.activeItem && \r
-                    !oConfig.getProperty("selected")\r
-                ) {\r
-    \r
-                    oConfig.setProperty("selected", true);\r
-    \r
-                }\r
-                else {\r
-    \r
-                    var oNextItem = (oDOMEvent.keyCode == 37) ? \r
-                            this.getPreviousEnabledSibling() : \r
-                            this.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
 \r
-                        oParent.clearActiveItem();\r
+// Public methods\r
 \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-            \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
 \r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;\r
-    \r
-            case 40:    // Down arrow\r
+/**\r
+* @method toString\r
+* @description Returns a string representing the menu bar item.\r
+* @return {String}\r
+*/\r
+toString: function() {\r
 \r
-                oParent.clearActiveItem();\r
-                        \r
-                oConfig.setProperty("selected", true);\r
-                \r
-                this.focus();\r
+    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
 \r
-                var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
-        \r
-                    oSubmenu.show();\r
-                    oSubmenu.setInitialSelection();\r
-    \r
-                }\r
+}\r
 \r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;\r
-    \r
-        }\r
-    \r
-    };
\ No newline at end of file
+}); // END YAHOO.extend
\ No newline at end of file
index 4ead33f82e872f4f49dfa7e2dcabf7b0a29ea133..479cfd7fd32863c0fc516b8c3c402027de63ba96 100755 (executable)
@@ -1,9 +1 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
-*/\r
-\r
-\r
-YAHOO.widget.MenuModule=function(_1,_2){YAHOO.widget.MenuModule.superclass.constructor.call(this,_1,_2);};YAHOO.extend(YAHOO.widget.MenuModule,YAHOO.widget.Overlay);YAHOO.widget.MenuModule.prototype.CSS_CLASS_NAME="yuimenu";YAHOO.widget.MenuModule.prototype.ITEM_TYPE=null;YAHOO.widget.MenuModule.prototype.GROUP_TITLE_TAG_NAME="H6";YAHOO.widget.MenuModule.prototype._aGroupTitleElements=null;YAHOO.widget.MenuModule.prototype._aItemGroups=null;YAHOO.widget.MenuModule.prototype._aListElements=null;YAHOO.widget.MenuModule.prototype._oEventUtil=YAHOO.util.Event;YAHOO.widget.MenuModule.prototype._oDom=YAHOO.util.Dom;YAHOO.widget.MenuModule.prototype._oCurrentItem=null;YAHOO.widget.MenuModule.prototype._bFiredMouseOverEvent=false;YAHOO.widget.MenuModule.prototype._bFiredMouseOutEvent=false;YAHOO.widget.MenuModule.prototype.activeItem=null;YAHOO.widget.MenuModule.prototype.parent=null;YAHOO.widget.MenuModule.prototype.srcElement=null;YAHOO.widget.MenuModule.prototype.mouseOverEvent=null;YAHOO.widget.MenuModule.prototype.mouseOutEvent=null;YAHOO.widget.MenuModule.prototype.mouseDownEvent=null;YAHOO.widget.MenuModule.prototype.mouseUpEvent=null;YAHOO.widget.MenuModule.prototype.clickEvent=null;YAHOO.widget.MenuModule.prototype.keyPressEvent=null;YAHOO.widget.MenuModule.prototype.keyDownEvent=null;YAHOO.widget.MenuModule.prototype.keyUpEvent=null;YAHOO.widget.MenuModule.prototype.init=function(_3,_4){var _5=this._oDom;var _6=this._oEventUtil;if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuModuleItem;}this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];var _7;if(typeof _3=="string"){_7=document.getElementById(_3);}else{if(_3.tagName){_7=_3;}}if(_7){switch(_7.tagName){case "DIV":this.srcElement=_7;YAHOO.widget.MenuModule.superclass.init.call(this,_7);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);var _8=this.body.firstChild;var i=0;do{switch(_8.tagName){case this.GROUP_TITLE_TAG_NAME:this._aGroupTitleElements[i]=_8;break;case "UL":this._aListElements[i]=_8;this._aItemGroups[i]=[];i++;break;}}while((_8=_8.nextSibling));if(this._aListElements[0]){_5.addClass(this._aListElements[0],"first-of-type");}break;case "SELECT":this.srcElement=_7;var _a=_5.generateId();YAHOO.widget.MenuModule.superclass.init.call(this,_a);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);break;}}else{YAHOO.widget.MenuModule.superclass.init.call(this,_3);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);}if(this.element){var _b=this.element;var _c=YAHOO.util.CustomEvent;_5.addClass(_b,this.CSS_CLASS_NAME);_6.addListener(_b,"mouseover",this._onElementMouseOver,this,true);_6.addListener(_b,"mouseout",this._onElementMouseOut,this,true);_6.addListener(_b,"mousedown",this._onDOMEvent,this,true);_6.addListener(_b,"mouseup",this._onDOMEvent,this,true);_6.addListener(_b,"click",this._onElementClick,this,true);_6.addListener(_b,"keydown",this._onDOMEvent,this,true);_6.addListener(_b,"keyup",this._onDOMEvent,this,true);_6.addListener(_b,"keypress",this._onDOMEvent,this,true);this.mouseOverEvent=new _c("mouseOverEvent",this);this.mouseOutEvent=new _c("mouseOutEvent",this);this.mouseDownEvent=new _c("mouseDownEvent",this);this.mouseUpEvent=new _c("mouseUpEvent",this);this.clickEvent=new _c("clickEvent",this);this.keyPressEvent=new _c("keyPressEvent",this);this.keyDownEvent=new _c("keyDownEvent",this);this.keyUpEvent=new _c("keyUpEvent",this);this.beforeRenderEvent.subscribe(this._onBeforeRender,this,true);this.renderEvent.subscribe(this._onRender,this,true);this.showEvent.subscribe(this._onShow,this,true);this.beforeHideEvent.subscribe(this._onBeforeHide,this,true);if(_4){this.cfg.applyConfig(_4,true);}this.cfg.queueProperty("visible",false);if(this.srcElement){this._initSubTree();}}this.initEvent.fire(YAHOO.widget.MenuModule);};YAHOO.widget.MenuModule.prototype._initSubTree=function(){var _d;switch(this.srcElement.tagName){case "DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{_d=this._aListElements[i].firstChild;do{switch(_d.tagName){case "LI":this.addItem(new this.ITEM_TYPE(_d),i);break;}}while((_d=_d.nextSibling));}while(i--);}break;case "SELECT":_d=this.srcElement.firstChild;do{switch(_d.tagName){case "OPTGROUP":case "OPTION":this.addItem(new this.ITEM_TYPE(_d));break;}}while((_d=_d.nextSibling));break;}};YAHOO.widget.MenuModule.prototype._getFirstEnabledItem=function(){var _f=this._aItemGroups.length;var _10;var _11;for(var i=0;i<_f;i++){_11=this._aItemGroups[i];if(_11){var _13=_11.length;for(var n=0;n<_13;n++){_10=_11[n];if(!_10.cfg.getProperty("disabled")){return _10;}_10=null;}}}};YAHOO.widget.MenuModule.prototype._checkPosition=function(_15){if(typeof _15=="string"){var _16=_15.toLowerCase();return ("dynamic,static".indexOf(_16)!=-1);}};YAHOO.widget.MenuModule.prototype._addItemToGroup=function(_17,_18,_19){var Dom=this._oDom;var _1b;if(_18 instanceof this.ITEM_TYPE){_1b=_18;}else{if(typeof _18=="string"){_1b=new this.ITEM_TYPE(_18);}}if(_1b){var _1c=typeof _17=="number"?_17:0;var _1d=this._getItemGroup(_1c);var _1e;if(!_1d){_1d=this._createItemGroup(_1c);}if(typeof _19=="number"){var _1f=(_19>=_1d.length);if(_1d[_19]){_1d.splice(_19,0,_1b);}else{_1d[_19]=_1b;}_1e=_1d[_19];if(_1e){if(_1f&&!_1e.element.parentNode){this._aListElements[_1c].appendChild(_1e.element);}else{function getNextItemSibling(_20,_21){return (_20[_21]||getNextItemSibling(_20,(_21+1)));}var _22=getNextItemSibling(_1d,(_19+1));if(_22&&!_1e.element.parentNode){this._aListElements[_1c].insertBefore(_1e.element,_22.element);}}_1e.parent=this;this._subscribeToItemEvents(_1e);this._configureItemSubmenuModule(_1e);this._updateItemProperties(_1c);return _1e;}}else{var _23=_1d.length;_1d[_23]=_1b;_1e=_1d[_23];if(_1e){if(!Dom.isAncestor(this._aListElements[_1c],_1e.element)){this._aListElements[_1c].appendChild(_1e.element);}_1e.element.setAttribute("groupindex",_1c);_1e.element.setAttribute("index",_23);_1e.parent=this;_1e.index=_23;_1e.groupIndex=_1c;this._subscribeToItemEvents(_1e);this._configureItemSubmenuModule(_1e);if(_23===0){Dom.addClass(_1e.element,"first-of-type");}return _1e;}}}};YAHOO.widget.MenuModule.prototype._removeItemFromGroupByIndex=function(_24,_25){var _26=typeof _24=="number"?_24:0;var _27=this._getItemGroup(_26);if(_27){var _28=_27.splice(_25,1);var _29=_28[0];if(_29){this._updateItemProperties(_26);if(_27.length===0){var oUL=this._aListElements[_26];if(this.body&&oUL){this.body.removeChild(oUL);}this._aItemGroups.splice(_26,1);this._aListElements.splice(_26,1);oUL=this._aListElements[0];if(oUL){this._oDom.addClass(oUL,"first-of-type");}}return _29;}}};YAHOO.widget.MenuModule.prototype._removeItemFromGroupByValue=function(_2b,_2c){var _2d=this._getItemGroup(_2b);if(_2d){var _2e=_2d.length;var _2f=-1;if(_2e>0){var i=_2e-1;do{if(_2d[i]==_2c){_2f=i;break;}}while(i--);if(_2f>-1){return this._removeItemFromGroupByIndex(_2b,_2f);}}}};YAHOO.widget.MenuModule.prototype._updateItemProperties=function(_31){var _32=this._getItemGroup(_31);var _33=_32.length;if(_33>0){var Dom=this._oDom;var i=_33-1;var _36;var oLI;do{_36=_32[i];if(_36){oLI=_36.element;_36.index=i;_36.groupIndex=_31;oLI.setAttribute("groupindex",_31);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}};YAHOO.widget.MenuModule.prototype._createItemGroup=function(_38){if(!this._aItemGroups[_38]){this._aItemGroups[_38]=[];var oUL=document.createElement("ul");this._aListElements[_38]=oUL;return this._aItemGroups[_38];}};YAHOO.widget.MenuModule.prototype._getItemGroup=function(_3a){var _3b=((typeof _3a=="number")?_3a:0);return this._aItemGroups[_3b];};YAHOO.widget.MenuModule.prototype._configureItemSubmenuModule=function(_3c){var _3d=_3c.cfg.getProperty("submenu");if(_3d){this.cfg.configChangedEvent.subscribe(this._onParentMenuModuleConfigChange,_3d,true);this.renderEvent.subscribe(this._onParentMenuModuleRender,_3d,true);_3d.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,_3d,true);_3d.showEvent.subscribe(this._onSubmenuShow,_3d,true);_3d.hideEvent.subscribe(this._onSubmenuHide,_3d,true);}};YAHOO.widget.MenuModule.prototype._subscribeToItemEvents=function(_3e){var _3f=[this,_3e];_3e.focusEvent.subscribe(this._onItemFocus,_3f);_3e.blurEvent.subscribe(this._onItemBlur,_3f);_3e.cfg.configChangedEvent.subscribe(this._onItemConfigChange,_3f);};YAHOO.widget.MenuModule.prototype._getOffsetWidth=function(){var _40=this.element.cloneNode(true);this._oDom.setStyle(_40,"width","");document.body.appendChild(_40);var _41=_40.offsetWidth;document.body.removeChild(_40);return _41;};YAHOO.widget.MenuModule.prototype._fireItemEvent=function(_42,_43,_44){var me=this;function getItemElement(_46){if(_46==me.element){return;}else{if(_46.tagName=="LI"){return _46;}else{if(_46.parentNode){return getItemElement(_46.parentNode);}}}}var _47=getItemElement(_42);if(_47){var _48=parseInt(_47.getAttribute("groupindex"),10);var _49=parseInt(_47.getAttribute("index"),10);var _4a=this._aItemGroups[_48][_49];if(!_4a.cfg.getProperty("disabled")){_4a[_43].fire(_44);return _4a;}}};YAHOO.widget.MenuModule.prototype._onDOMEvent=function(_4b,_4c){var _4d=this._oEventUtil;var _4e={"mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"};var _4f=_4e[_4b.type];var _50=_4d.getTarget(_4b);this._fireItemEvent(_50,_4f,_4b);this[_4f].fire(_4b);_4d.stopPropagation(_4b);};YAHOO.widget.MenuModule.prototype._onElementMouseOver=function(_51,_52){var _53=this._oEventUtil;var _54=_53.getTarget(_51);if((_54==this.element||this._oDom.isAncestor(this.element,_54))&&!this._bFiredMouseOverEvent){this.mouseOverEvent.fire(_51);this._bFiredMouseOverEvent=true;this._bFiredMouseOutEvent=false;}if(!this._oCurrentItem){this._oCurrentItem=this._fireItemEvent(_54,"mouseOverEvent",_51);}_53.stopPropagation(_51);};YAHOO.widget.MenuModule.prototype._onElementMouseOut=function(_55,_56){var Dom=this._oDom;var _58=this._oEventUtil;var _59=_58.getRelatedTarget(_55);var _5a=true;var _5b=false;if(this._oCurrentItem&&_59){if(_59==this._oCurrentItem.element||Dom.isAncestor(this._oCurrentItem.element,_59)){_5a=false;}var _5c=this._oCurrentItem.cfg.getProperty("submenu");if(_5c&&(_59==_5c.element||Dom.isAncestor(_5c.element,_59))){_5b=true;}}if(this._oCurrentItem&&(_5a||_5b)){this._oCurrentItem.mouseOutEvent.fire(_55);this._oCurrentItem=null;}if(!this._bFiredMouseOutEvent&&(!Dom.isAncestor(this.element,_59)||_5b)){this.mouseOutEvent.fire(_55);this._bFiredMouseOutEvent=true;this._bFiredMouseOverEvent=false;}_58.stopPropagation(_55);};YAHOO.widget.MenuModule.prototype._onElementClick=function(_5d,_5e){var _5f=this._oEventUtil;var _60=_5f.getTarget(_5d);var _61=this._fireItemEvent(_60,"clickEvent",_5d);var _62;if(_61){var _63=_61.cfg.getProperty("url");var _64=_61.cfg.getProperty("submenu");_62=(_63.substr((_63.length-1),1)=="#");if(_60==_61.submenuIndicator&&_64){if(_64.cfg.getProperty("visible")){_64.hide();}else{var _65=this.activeItem;if(_65&&_65!=this){this.clearActiveItem();}this.activeItem=_61;_61.cfg.setProperty("selected",true);_64.show();}}else{if(_60.tagName!="A"&&!_62){document.location=_63;}}}switch(_60.tagName){case "A":if(_62){_5f.preventDefault(_5d);}else{break;}default:_5f.stopPropagation(_5d);break;}this.clickEvent.fire(_5d);};YAHOO.widget.MenuModule.prototype._onBeforeRender=function(_66,_67,_68){var Dom=this._oDom;var _6a=this.cfg;var oEl=this.element;var _6c=this._aListElements.length;if(_6a.getProperty("position")=="static"){_6a.queueProperty("iframe",false);_6a.queueProperty("visible",true);}if(_6c>0){var i=0;var _6e=true;var oUL;var _70;do{oUL=this._aListElements[i];if(oUL){if(_6e){Dom.addClass(oUL,"first-of-type");_6e=false;}if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}_70=this._aGroupTitleElements[i];if(_70){if(!Dom.isAncestor(oEl,_70)){oUL.parentNode.insertBefore(_70,oUL);}Dom.addClass(oUL,"hastitle");}}i++;}while(i<_6c);}};YAHOO.widget.MenuModule.prototype._onRender=function(_71,_72,_73){if(this.cfg.getProperty("position")=="dynamic"){var _74=this.element.parentNode.tagName=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(_74+"px"));}};YAHOO.widget.MenuModule.prototype._onShow=function(_75,_76,_77){this.setInitialFocus();};YAHOO.widget.MenuModule.prototype._onBeforeHide=function(_78,_79,_7a){var _7b=this.activeItem;if(_7b){_7b.blur();if(_7b.cfg.getProperty("selected")){_7b.cfg.setProperty("selected",false);}var _7c=_7b.cfg.getProperty("submenu");if(_7c&&_7c.cfg.getProperty("visible")){_7c.hide();}}};YAHOO.widget.MenuModule.prototype._onParentMenuModuleConfigChange=function(_7d,_7e,_7f){var _80=_7e[0][0];var _81=_7e[0][1];switch(_80){case "iframe":case "constraintoviewport":_7f.cfg.setProperty(_80,_81);break;}};YAHOO.widget.MenuModule.prototype._onParentMenuModuleRender=function(_82,_83,_84){var _85=_84.parent.parent;_84.cfg.applyConfig({constraintoviewport:_85.cfg.getProperty("constraintoviewport"),xy:[0,0],iframe:_85.cfg.getProperty("iframe")});if(this._oDom.inDocument(this.element)){this.render();}else{this.render(this.parent.element);}};YAHOO.widget.MenuModule.prototype._onSubmenuBeforeShow=function(_86,_87,_88){var _89=this.parent;var _8a=_89.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[_89.element,_8a[0],_8a[1]]);_89.submenuIndicator.alt=_89.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onSubmenuShow=function(_8b,_8c,_8d){var _8e=this.parent;_8e.submenuIndicator.alt=_8e.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onSubmenuHide=function(_8f,_90,_91){var _92=this.parent;if(_92.parent.cfg.getProperty("visible")){_92.cfg.setProperty("selected",false);_92.focus();}_92.submenuIndicator.alt=_92.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onItemFocus=function(_93,_94,_95){var me=_95[0];var _97=_95[1];me.activeItem=_97;};YAHOO.widget.MenuModule.prototype._onItemBlur=function(_98,_99,_9a){var me=_9a[0];var _9c=_9a[1];var _9d=_9c.cfg.getProperty("submenu");if(!_9d||(_9d&&!_9d.cfg.getProperty("visible"))){me.activeItem=null;}};YAHOO.widget.MenuModule.prototype._onItemConfigChange=function(_9e,_9f,_a0){var me=_a0[0];var _a2=_9f[0][0];var _a3=_a0[1];switch(_a2){case "submenu":var _a4=_9f[0][1];if(_a4){me._configureItemSubmenuModule(_a3);}break;case "text":case "helptext":if(me.element.style.width){var _a5=me._getOffsetWidth()+"px";me._oDom.setStyle(me.element,"width",_a5);}break;}};YAHOO.widget.MenuModule.prototype.enforceConstraints=function(_a6,_a7,obj){var Dom=this._oDom;var _aa=this.cfg;var pos=_a7[0];var x=pos[0];var y=pos[1];var bod=document.getElementsByTagName("body")[0];var htm=document.getElementsByTagName("html")[0];var _b0=Dom.getStyle(bod,"overflow");var _b1=Dom.getStyle(htm,"overflow");var _b2=this.element.offsetHeight;var _b3=this.element.offsetWidth;var _b4=Dom.getClientWidth();var _b5=Dom.getClientHeight();var _b6=window.scrollX||document.body.scrollLeft;var _b7=window.scrollY||document.body.scrollTop;var _b8=_b7+10;var _b9=_b6+10;var _ba=_b7+_b5-_b2-10;var _bb=_b6+_b4-_b3-10;var _bc=_aa.getProperty("context");var _bd=_bc?_bc[0]:null;if(x<10){x=_b9;}else{if((x+_b3)>_b4){if(_bd&&((x-_bd.offsetWidth)>_b3)){x=(x-(_bd.offsetWidth+_b3));}else{x=_bb;}}}if(y<10){y=_b8;}else{if(y>_ba){if(_bd&&(y>_b2)){y=((y+_bd.offsetHeight)-_b2);}else{y=_ba;}}}_aa.setProperty("x",x,true);_aa.setProperty("y",y,true);};YAHOO.widget.MenuModule.prototype.configPosition=function(_be,_bf,_c0){var _c1=_bf[0]=="static"?"static":"absolute";this._oDom.setStyle(this.element,"position",_c1);};YAHOO.widget.MenuModule.prototype.toString=function(){return ("Menu "+this.id);};YAHOO.widget.MenuModule.prototype.setItemGroupTitle=function(_c2,_c3){if(typeof _c2=="string"&&_c2.length>0){var Dom=this._oDom;var _c5=typeof _c3=="number"?_c3:0;var _c6=this._aGroupTitleElements[_c5];if(_c6){_c6.innerHTML=_c2;}else{_c6=document.createElement(this.GROUP_TITLE_TAG_NAME);_c6.innerHTML=_c2;this._aGroupTitleElements[_c5]=_c6;}var i=this._aGroupTitleElements.length-1;var _c8;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");_c8=i;}}while(i--);if(_c8!==null){Dom.addClass(this._aGroupTitleElements[_c8],"first-of-type");}}};YAHOO.widget.MenuModule.prototype.addItem=function(_c9,_ca){if(_c9){return this._addItemToGroup(_ca,_c9);}};YAHOO.widget.MenuModule.prototype.insertItem=function(_cb,_cc,_cd){if(_cb){return this._addItemToGroup(_cd,_cb,_cc);}};YAHOO.widget.MenuModule.prototype.removeItem=function(_ce,_cf){if(typeof _ce!="undefined"){var _d0;if(_ce instanceof YAHOO.widget.MenuModuleItem){_d0=this._removeItemFromGroupByValue(_cf,_ce);}else{if(typeof _ce=="number"){_d0=this._removeItemFromGroupByIndex(_cf,_ce);}}if(_d0){_d0.destroy();return _d0;}}};YAHOO.widget.MenuModule.prototype.getItemGroups=function(){return this._aItemGroups;};YAHOO.widget.MenuModule.prototype.getItem=function(_d1,_d2){if(typeof _d1=="number"){var _d3=this._getItemGroup(_d2);if(_d3){return _d3[_d1];}}};YAHOO.widget.MenuModule.prototype.destroy=function(){this._oEventUtil.purgeElement(this.element);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.beforeMoveEvent.unsubscribeAll();var _d4=this._aItemGroups.length;var _d5;var _d6;var _d7;var i;var n;if(_d4>0){i=_d4-1;do{_d6=this._aItemGroups[i];if(_d6){_d5=_d6.length;if(_d5>0){n=_d5-1;do{_d7=this._aItemGroups[i][n];if(_d7){_d7.destroy();}}while(n--);}}}while(i--);}YAHOO.widget.MenuModule.superclass.destroy.call(this);};YAHOO.widget.MenuModule.prototype.setInitialFocus=function(){var _da=this._getFirstEnabledItem();if(_da){_da.focus();}};YAHOO.widget.MenuModule.prototype.setInitialSelection=function(){var _db=this._getFirstEnabledItem();if(_db){_db.cfg.setProperty("selected",true);}};YAHOO.widget.MenuModule.prototype.clearActiveItem=function(){if(this.activeItem){var _dc=this.activeItem.cfg;_dc.setProperty("selected",false);var _dd=_dc.getProperty("submenu");if(_dd){_dd.hide();}}};YAHOO.widget.MenuModule.prototype.initDefaultConfig=function(){YAHOO.widget.MenuModule.superclass.initDefaultConfig.call(this);var _de=this.cfg;_de.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition});_de.refireEvent("position");_de.addProperty("submenualignment",{value:["tl","tr"]});};YAHOO.widget.MenuModuleItem=function(_df,_e0){if(_df){this.init(_df,_e0);}};YAHOO.widget.MenuModuleItem.prototype={SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_dim_1.gif",COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT:"Collapsed.  Click to expand.",EXPANDED_SUBMENU_INDICATOR_ALT_TEXT:"Expanded.  Click to collapse.",DISABLED_SUBMENU_INDICATOR_ALT_TEXT:"Disabled.",CSS_CLASS_NAME:"yuimenuitem",SUBMENU_TYPE:null,SUBMENU_ITEM_TYPE:null,IMG_ROOT:"http://us.i1.yimg.com/us.yimg.com/i/",IMG_ROOT_SSL:"https://a248.e.akamai.net/sec.yimg.com/i/",_oAnchor:null,_oText:null,_oHelpTextEM:null,_oSubmenu:null,_oDom:YAHOO.util.Dom,constructor:YAHOO.widget.MenuModuleItem,imageRoot:null,isSecure:YAHOO.widget.Module.prototype.isSecure,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:YAHOO.widget.Module.prototype.browser,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(_e1,_e2){this.imageRoot=(this.isSecure)?this.IMG_ROOT_SSL:this.IMG_ROOT;if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.MenuModule;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuModuleItem;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var _e3=this.cfg;if(this._checkString(_e1)){this._createRootNodeStructure();_e3.setProperty("text",_e1);}else{if(this._checkDOMNode(_e1)){switch(_e1.tagName){case "OPTION":this._createRootNodeStructure();_e3.setProperty("text",_e1.text);this.srcElement=_e1;break;case "OPTGROUP":this._createRootNodeStructure();_e3.setProperty("text",_e1.label);this.srcElement=_e1;this._initSubTree();break;case "LI":var _e4=this._getFirstElement(_e1,"A");var _e5="#";var _e6=null;if(_e4){_e5=_e4.getAttribute("href");if(_e4.innerText){_e6=_e4.innerText;}else{var _e7=_e4.ownerDocument.createRange();_e7.selectNodeContents(_e4);_e6=_e7.toString();}}else{var _e8=_e1.firstChild;_e6=_e8.nodeValue;_e4=document.createElement("a");_e4.setAttribute("href",_e5);_e1.replaceChild(_e4,_e8);_e4.appendChild(_e8);}this.srcElement=_e1;this.element=_e1;this._oAnchor=_e4;var _e9=this._getFirstElement(_e4);var _ea=false;var _eb=false;if(_e9){this._oText=_e9.firstChild;switch(_e9.tagName){case "EM":_ea=true;break;case "STRONG":_eb=true;break;}}else{this._oText=_e4.firstChild;}_e3.setProperty("text",_e6,true);_e3.setProperty("url",_e5,true);_e3.setProperty("emphasis",_ea,true);_e3.setProperty("strongemphasis",_eb,true);this._initSubTree();break;}}}if(this.element){this._oDom.addClass(this.element,this.CSS_CLASS_NAME);var _ec=YAHOO.util.CustomEvent;this.destroyEvent=new _ec("destroyEvent",this);this.mouseOverEvent=new _ec("mouseOverEvent",this);this.mouseOutEvent=new _ec("mouseOutEvent",this);this.mouseDownEvent=new _ec("mouseDownEvent",this);this.mouseUpEvent=new _ec("mouseUpEvent",this);this.clickEvent=new _ec("clickEvent",this);this.keyPressEvent=new _ec("keyPressEvent",this);this.keyDownEvent=new _ec("keyDownEvent",this);this.keyUpEvent=new _ec("keyUpEvent",this);this.focusEvent=new _ec("focusEvent",this);this.blurEvent=new _ec("blurEvent",this);if(_e2){_e3.applyConfig(_e2);}_e3.fireQueue();}},_getFirstElement:function(_ed,_ee){var _ef;if(_ed.firstChild&&_ed.firstChild.nodeType==1){_ef=_ed.firstChild;}else{if(_ed.firstChild&&_ed.firstChild.nextSibling&&_ed.firstChild.nextSibling.nodeType==1){_ef=_ed.firstChild.nextSibling;}}if(_ee){return (_ef&&_ef.tagName==_ee)?_ef:false;}return _ef;},_checkString:function(_f0){return (typeof _f0=="string");},_checkDOMNode:function(_f1){return (_f1&&_f1.tagName);},_createRootNodeStructure:function(){this.element=document.createElement("li");this._oText=document.createTextNode("");this._oAnchor=document.createElement("a");this._oAnchor.appendChild(this._oText);this.cfg.refireEvent("url");this.element.appendChild(this._oAnchor);},_initSubTree:function(){var _f2=this.SUBMENU_TYPE;var _f3=this.SUBMENU_ITEM_TYPE;var _f4=this.srcElement;var _f5=this.cfg;if(_f4.childNodes.length>0){var _f6=_f4.firstChild;var _f7=[];do{switch(_f6.tagName){case "DIV":_f5.setProperty("submenu",(new _f2(_f6)));break;case "OPTION":_f7[_f7.length]=_f6;break;}}while((_f6=_f6.nextSibling));var _f8=_f7.length;if(_f8>0){_f5.setProperty("submenu",(new _f2(this._oDom.generateId())));for(var n=0;n<_f8;n++){this._oSubmenu.addItem((new _f3(_f7[n])));}}}},configText:function(_fa,_fb,_fc){var _fd=_fb[0];if(this._oText){this._oText.nodeValue=_fd;}},configHelpText:function(_fe,_ff,_100){var me=this;var Dom=this._oDom;var _103=_ff[0];var oEl=this.element;var _105=this.cfg;var _106=[oEl,this._oAnchor];var oImg=this.submenuIndicator;function initHelpText(){Dom.addClass(_106,"hashelptext");if(_105.getProperty("disabled")){_105.refireEvent("disabled");}if(_105.getProperty("selected")){_105.refireEvent("selected");}}function removeHelpText(){Dom.removeClass(_106,"hashelptext");oEl.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;}if(this._checkDOMNode(_103)){if(this._oHelpTextEM){this._oHelpTextEM.parentNode.replaceChild(_103,this._oHelpTextEM);}else{this._oHelpTextEM=_103;oEl.insertBefore(this._oHelpTextEM,oImg);}initHelpText();}else{if(this._checkString(_103)){if(_103.length===0){removeHelpText();}else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");oEl.insertBefore(this._oHelpTextEM,oImg);}this._oHelpTextEM.innerHTML=_103;initHelpText();}}else{if(!_103&&this._oHelpTextEM){removeHelpText();}}}},configURL:function(_108,_109,_10a){var sURL=_109[0];if(!sURL){sURL="#";}this._oAnchor.setAttribute("href",sURL);},configEmphasis:function(_10c,_10d,_10e){var _10f=_10d[0];var _110=this._oAnchor;var _111=this._oText;var _112=this.cfg;var oEM;if(_10f&&_112.getProperty("strongemphasis")){_112.setProperty("strongemphasis",false);}if(_110){if(_10f){oEM=document.createElement("em");oEM.appendChild(_111);_110.appendChild(oEM);}else{oEM=this._getFirstElement(_110,"EM");_110.removeChild(oEM);_110.appendChild(_111);}}},configStrongEmphasis:function(_114,_115,_116){var _117=_115[0];var _118=this._oAnchor;var _119=this._oText;var _11a=this.cfg;var _11b;if(_117&&_11a.getProperty("emphasis")){_11a.setProperty("emphasis",false);}if(_118){if(_117){_11b=document.createElement("strong");_11b.appendChild(_119);_118.appendChild(_11b);}else{_11b=this._getFirstElement(_118,"STRONG");_118.removeChild(_11b);_118.appendChild(_119);}}},configDisabled:function(_11c,_11d,_11e){var _11f=_11d[0];var Dom=this._oDom;var _121=this._oAnchor;var _122=[this.element,_121];var oEM=this._oHelpTextEM;var _124=this.cfg;var oImg=this.submenuIndicator;var _126;var _127;if(oEM){_122[2]=oEM;}if(_11f){if(_124.getProperty("selected")){_124.setProperty("selected",false);}_121.removeAttribute("href");Dom.addClass(_122,"disabled");_126=this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;_127=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}else{_121.setAttribute("href",_124.getProperty("url"));Dom.removeClass(_122,"disabled");_126=this.SUBMENU_INDICATOR_IMAGE_PATH;_127=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}if(oImg){oImg.src=this.imageRoot+_126;oImg.alt=_127;}},configSelected:function(_128,_129,_12a){if(!this.cfg.getProperty("disabled")){var Dom=this._oDom;var _12c=_129[0];var oEM=this._oHelpTextEM;var _12e=[this.element,this._oAnchor];var oImg=this.submenuIndicator;var _130;if(oEM){_12e[2]=oEM;}if(_12c){Dom.addClass(_12e,"selected");_130=this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;}else{Dom.removeClass(_12e,"selected");_130=this.SUBMENU_INDICATOR_IMAGE_PATH;}if(oImg){oImg.src=document.images[(this.imageRoot+_130)].src;}}},configSubmenu:function(_131,_132,_133){var Dom=this._oDom;var oEl=this.element;var _136=_132[0];var oImg=this.submenuIndicator;var _138=this.cfg;var _139=[this.element,this._oAnchor];if(_136){_136.parent=this;this._oSubmenu=_136;if(!oImg){var me=this;function preloadImage(_13b){var _13c=me.imageRoot+_13b;if(!document.images[_13c]){var oImg=document.createElement("img");oImg.src=_13c;oImg.name=_13c;oImg.id=_13c;oImg.style.display="none";document.body.appendChild(oImg);}}preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.SUBMENU_INDICATOR_IMAGE_PATH);oImg.alt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;oEl.appendChild(oImg);this.submenuIndicator=oImg;Dom.addClass(_139,"hassubmenu");if(_138.getProperty("disabled")){_138.refireEvent("disabled");}if(_138.getProperty("selected")){_138.refireEvent("selected");}}}else{Dom.removeClass(_139,"hassubmenu");if(oImg){oEl.removeChild(oImg);}if(this._oSubmenu){this._oSubmenu.destroy();}}},initDefaultConfig:function(){var _13e=this.cfg;var _13f=_13e.checkBoolean;_13e.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});_13e.addProperty("helptext",{handler:this.configHelpText});_13e.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});_13e.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:_13f,suppressEvent:true});_13e.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:_13f,suppressEvent:true});_13e.addProperty("disabled",{value:false,handler:this.configDisabled,validator:_13f,suppressEvent:true});_13e.addProperty("selected",{value:false,handler:this.configSelected,validator:_13f,suppressEvent:true});_13e.addProperty("submenu",{handler:this.configSubmenu});},getNextEnabledSibling:function(){if(this.parent instanceof YAHOO.widget.MenuModule){var _140=this.groupIndex;function getNextArrayItem(_141,_142){return _141[_142]||getNextArrayItem(_141,(_142+1));}var _143=this.parent.getItemGroups();var _144;if(this.index<(_143[_140].length-1)){_144=getNextArrayItem(_143[_140],(this.index+1));}else{var _145;if(_140<(_143.length-1)){_145=_140+1;}else{_145=0;}var _146=getNextArrayItem(_143,_145);_144=getNextArrayItem(_146,0);}return _144.cfg.getProperty("disabled")?_144.getNextEnabledSibling():_144;}},getPreviousEnabledSibling:function(){if(this.parent instanceof YAHOO.widget.MenuModule){var _147=this.groupIndex;function getPreviousArrayItem(_148,_149){return _148[_149]||getPreviousArrayItem(_148,(_149-1));}function getFirstItemIndex(_14a,_14b){return _14a[_14b]?_14b:getFirstItemIndex(_14a,(_14b+1));}var _14c=this.parent.getItemGroups();var _14d;if(this.index>getFirstItemIndex(_14c[_147],0)){_14d=getPreviousArrayItem(_14c[_147],(this.index-1));}else{var _14e;if(_147>getFirstItemIndex(_14c,0)){_14e=_147-1;}else{_14e=_14c.length-1;}var _14f=getPreviousArrayItem(_14c,_14e);_14d=getPreviousArrayItem(_14f,(_14f.length-1));}return _14d.cfg.getProperty("disabled")?_14d.getPreviousEnabledSibling():_14d;}},focus:function(){var _150=this.parent;var _151=this._oAnchor;var _152=_150.activeItem;if(!this.cfg.getProperty("disabled")&&_150&&_150.cfg.getProperty("visible")){if(_152){_152.blur();}_151.focus();if(_150&&this.browser=="opera"&&this._oSubmenu){_151.focus();}this.focusEvent.fire();}},blur:function(){var _153=this.parent;if(!this.cfg.getProperty("disabled")&&_153&&this._oDom.getStyle(_153.element,"visibility")=="visible"){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){var oEl=this.element;if(oEl){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();var _155=oEl.parentNode;if(_155){_155.removeChild(oEl);this.destroyEvent.fire();}this.destroyEvent.unsubscribeAll();}}};YAHOO.widget.Menu=function(_156,_157){YAHOO.widget.Menu.superclass.constructor.call(this,_156,_157);};YAHOO.extend(YAHOO.widget.Menu,YAHOO.widget.MenuModule);YAHOO.widget.Menu.prototype.init=function(_158,_159){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.Menu.superclass.init.call(this,_158);this.beforeInitEvent.fire(YAHOO.widget.Menu);this.showEvent.subscribe(this._onMenuShow,this,true);this.mouseOverEvent.subscribe(this._onMenuMouseOver,this,true);this.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);if(_159){this.cfg.applyConfig(_159,true);}this.initEvent.fire(YAHOO.widget.Menu);};YAHOO.widget.Menu.prototype._onMenuShow=function(_15a,_15b,_15c){var _15d=this.parent;if(_15d&&_15d.parent instanceof YAHOO.widget.Menu){var _15e=_15d.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("submenualignment",[_15e[0],_15e[1]]);}};YAHOO.widget.Menu.prototype._onMenuMouseOver=function(_15f,_160,_161){if(this.parent){this.parent.cfg.setProperty("selected",true);}};YAHOO.widget.Menu.prototype._onMenuKeyDown=function(_162,_163,_164){if(this.cfg.getProperty("position")=="dynamic"){var _165=_163[0];var _166=this.parent;if(_165.keyCode==27){this.hide();if(_166){_166.focus();if(_166.parent instanceof YAHOO.widget.Menu){_166.cfg.setProperty("selected",true);}YAHOO.util.Event.preventDefault(_165);}}}};YAHOO.widget.Menu.prototype.onDomResize=function(e,obj){if(!this._handleResize){this._handleResize=true;return;}var me=this;var _16a=this.cfg;if(_16a.getProperty("position")=="dynamic"){_16a.setProperty("width",(this._getOffsetWidth()+"px"));if(this.parent&&_16a.getProperty("visible")){function align(){me.align();}window.setTimeout(align,0);}}YAHOO.widget.Menu.superclass.onDomResize.call(this,e,obj);};YAHOO.widget.MenuItem=function(_16b,_16c){YAHOO.widget.MenuItem.superclass.constructor.call(this,_16b,_16c);};YAHOO.extend(YAHOO.widget.MenuItem,YAHOO.widget.MenuModuleItem);YAHOO.widget.MenuItem.prototype.init=function(_16d,_16e){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.MenuItem.superclass.init.call(this,_16d);this.keyDownEvent.subscribe(this._onKeyDown,this,true);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.mouseOutEvent.subscribe(this._onMouseOut,this,true);var _16f=this.cfg;if(_16e){_16f.applyConfig(_16e,true);}_16f.fireQueue();};YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_PATH="nt/ic/ut/bsc/menuchk8_nrm_1.gif";YAHOO.widget.MenuItem.prototype.SELECTED_CHECKED_IMAGE_PATH="nt/ic/ut/bsc/menuchk8_hov_1.gif";YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_PATH="nt/ic/ut/bsc/menuchk8_dim_1.gif";YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_ALT_TEXT="Checked.";YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_ALT_TEXT="Checked. (Item disabled.)";YAHOO.widget.MenuItem.prototype._checkImage=null;YAHOO.widget.MenuItem.prototype._onKeyDown=function(_170,_171,_172){var _173=YAHOO.util.Event;var _174=_171[0];var _175=this.parent;var _176=this.cfg;var _177;switch(_174.keyCode){case 38:case 40:if(this==_175.activeItem&&!_176.getProperty("selected")){_176.setProperty("selected",true);}else{var _178=(_174.keyCode==38)?this.getPreviousEnabledSibling():this.getNextEnabledSibling();if(_178){_175.clearActiveItem();_178.cfg.setProperty("selected",true);_178.focus();}}_173.preventDefault(_174);break;case 39:_175.clearActiveItem();_176.setProperty("selected",true);this.focus();var _179=_176.getProperty("submenu");if(_179){_179.show();_179.setInitialSelection();}else{if(YAHOO.widget.MenuBarItem&&_175.parent&&_175.parent instanceof YAHOO.widget.MenuBarItem){_175.hide();_177=_175.parent;if(_177){_177.focus();_177.cfg.setProperty("selected",true);}}}_173.preventDefault(_174);break;case 37:if(_175.parent){_175.hide();_177=_175.parent;if(_177){_177.focus();_177.cfg.setProperty("selected",true);}}_173.preventDefault(_174);break;}};YAHOO.widget.MenuItem.prototype._onMouseOver=function(_17a,_17b,_17c){var _17d=this.parent;var _17e=this.cfg;var _17f=_17d.activeItem;if(_17f&&_17f!=this){_17d.clearActiveItem();}_17e.setProperty("selected",true);this.focus();var _180=_17e.getProperty("submenu");if(_180){_180.show();}};YAHOO.widget.MenuItem.prototype._onMouseOut=function(_181,_182,_183){var _184=this.cfg;var _185=_184.getProperty("submenu");_184.setProperty("selected",false);if(_185){var _186=_182[0];var _187=YAHOO.util.Event.getRelatedTarget(_186);if(!(_187==_185.element||YAHOO.util.Dom.isAncestor(_185.element,_187))){_185.hide();}}};YAHOO.widget.MenuItem.prototype.configChecked=function(_188,_189,_18a){var Dom=YAHOO.util.Dom;var _18c=_189[0];var oEl=this.element;var _18e=this.cfg;var oImg;if(_18c){var me=this;function preloadImage(_191){var _192=me.imageRoot+_191;if(!document.images[_192]){var oImg=document.createElement("img");oImg.src=_192;oImg.name=_192;oImg.id=_192;oImg.style.display="none";document.body.appendChild(oImg);}}preloadImage(this.CHECKED_IMAGE_PATH);preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.CHECKED_IMAGE_PATH);oImg.alt=this.CHECKED_IMAGE_ALT_TEXT;var _194=this.cfg.getProperty("submenu");if(_194){oEl.insertBefore(oImg,_194.element);}else{oEl.appendChild(oImg);}Dom.addClass([oEl,oImg],"checked");this._checkImage=oImg;if(_18e.getProperty("disabled")){_18e.refireEvent("disabled");}if(_18e.getProperty("selected")){_18e.refireEvent("selected");}}else{oImg=this._checkImage;Dom.removeClass([oEl,oImg],"checked");if(oImg){oEl.removeChild(oImg);}this._checkImage=null;}};YAHOO.widget.MenuItem.prototype.configSelected=function(_195,_196,_197){YAHOO.widget.MenuItem.superclass.configSelected.call(this,_195,_196,_197);var _198=this.cfg;if(!_198.getProperty("disabled")&&_198.getProperty("checked")){var _199=_196[0];var sSrc=this.imageRoot+(_199?this.SELECTED_CHECKED_IMAGE_PATH:this.CHECKED_IMAGE_PATH);this._checkImage.src=document.images[sSrc].src;}};YAHOO.widget.MenuItem.prototype.configDisabled=function(_19b,_19c,_19d){YAHOO.widget.MenuItem.superclass.configDisabled.call(this,_19b,_19c,_19d);if(this.cfg.getProperty("checked")){var _19e=_19c[0];var sAlt=this.CHECKED_IMAGE_ALT_TEXT;var sSrc=this.CHECKED_IMAGE_PATH;var oImg=this._checkImage;if(_19e){sAlt=this.DISABLED_CHECKED_IMAGE_ALT_TEXT;sSrc=this.DISABLED_CHECKED_IMAGE_PATH;}oImg.src=document.images[(this.imageRoot+sSrc)].src;oImg.alt=sAlt;}};YAHOO.widget.MenuItem.prototype.initDefaultConfig=function(){YAHOO.widget.MenuItem.superclass.initDefaultConfig.call(this);this.cfg.addProperty("checked",{value:false,handler:this.configChecked,validator:this.cfg.checkBoolean,suppressEvent:true});};YAHOO.widget.ContextMenu=function(_1a2,_1a3){YAHOO.widget.ContextMenu.superclass.constructor.call(this,_1a2,_1a3);};YAHOO.extend(YAHOO.widget.ContextMenu,YAHOO.widget.Menu);YAHOO.widget.ContextMenu.prototype._oTrigger=null;YAHOO.widget.ContextMenu.prototype.init=function(_1a4,_1a5){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenu.superclass.init.call(this,_1a4);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(_1a5){this.cfg.applyConfig(_1a5,true);}this.initEvent.fire(YAHOO.widget.ContextMenu);};YAHOO.widget.ContextMenu.prototype._onDocumentMouseDown=function(_1a6,_1a7){var _1a8=YAHOO.util.Event.getTarget(_1a6);var _1a9=this._oTargetElement;if(_1a8!=_1a9||!YAHOO.util.Dom.isAncestor(_1a9,_1a8)){this.hide();}};YAHOO.widget.ContextMenu.prototype._onTriggerClick=function(_1aa,_1ab){if(_1aa.ctrlKey){YAHOO.util.Event.stopEvent(_1aa);}};YAHOO.widget.ContextMenu.prototype._onTriggerContextMenu=function(_1ac,_1ad){var _1ae=YAHOO.util.Event;var _1af=this.cfg;if(_1ac.type=="mousedown"){if(!_1ac.ctrlKey){return;}_1ae.stopEvent(_1ac);}this.contextEventTarget=_1ae.getTarget(_1ac);var nX=_1ae.getPageX(_1ac);var nY=_1ae.getPageY(_1ac);_1af.applyConfig({x:nX,y:nY,visible:true});_1af.fireQueue();_1ae.preventDefault(_1ac);};YAHOO.widget.ContextMenu.prototype.contextEventTarget=null;YAHOO.widget.ContextMenu.prototype.initDefaultConfig=function(){YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty("trigger",{handler:this.configTrigger});};YAHOO.widget.ContextMenu.prototype.configTrigger=function(_1b2,_1b3,_1b4){var _1b5=YAHOO.util.Event;var _1b6=_1b3[0];if(_1b6){if(this._oTrigger){_1b5.purgeElement(this._oTrigger);}this._oTrigger=_1b6;var _1b7=(this.browser=="opera");_1b5.addListener(_1b6,(_1b7?"mousedown":"contextmenu"),this._onTriggerContextMenu,this,true);if(_1b7){_1b5.addListener(_1b6,"click",this._onTriggerClick,this,true);}_1b5.addListener(document,"mousedown",this._onDocumentMouseDown,this,true);}};YAHOO.widget.ContextMenuItem=function(_1b8,_1b9){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,_1b8,_1b9);};YAHOO.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem);YAHOO.widget.ContextMenuItem.prototype.init=function(_1ba,_1bb){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenuItem.superclass.init.call(this,_1ba);var _1bc=this.cfg;if(_1bb){_1bc.applyConfig(_1bb,true);}_1bc.fireQueue();};YAHOO.widget.MenuBar=function(_1bd,_1be){YAHOO.widget.MenuBar.superclass.constructor.call(this,_1bd,_1be);};YAHOO.extend(YAHOO.widget.MenuBar,YAHOO.widget.MenuModule);YAHOO.widget.MenuBar.prototype.init=function(_1bf,_1c0){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}YAHOO.widget.MenuBar.superclass.init.call(this,_1bf);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);var _1c1=this.cfg;if(!_1c0||(_1c0&&!_1c0.position)){_1c1.queueProperty("position","static");}if(!_1c0||(_1c0&&!_1c0.submenualignment)){_1c1.queueProperty("submenualignment",["tl","bl"]);}if(_1c0){_1c1.applyConfig(_1c0,true);}this.initEvent.fire(YAHOO.widget.MenuBar);};YAHOO.widget.MenuBar.prototype.CSS_CLASS_NAME="yuimenubar";YAHOO.widget.MenuBarItem=function(_1c2,_1c3){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,_1c2,_1c3);};YAHOO.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuModuleItem);YAHOO.widget.MenuBarItem.prototype.init=function(_1c4,_1c5){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.MenuBarItem.superclass.init.call(this,_1c4);this.keyDownEvent.subscribe(this._onKeyDown,this,true);var _1c6=this.cfg;if(_1c5){_1c6.applyConfig(_1c5,true);}_1c6.fireQueue();};YAHOO.widget.MenuBarItem.prototype.CSS_CLASS_NAME="yuimenubaritem";YAHOO.widget.MenuBarItem.prototype.SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/alt1/menuarodwn8_nrm_1.gif";YAHOO.widget.MenuBarItem.prototype.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/alt1/menuarodwn8_hov_1.gif";YAHOO.widget.MenuBarItem.prototype.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/alt1/menuarodwn8_dim_1.gif";YAHOO.widget.MenuBarItem.prototype._onKeyDown=function(_1c7,_1c8,_1c9){var _1ca=YAHOO.util.Event;var _1cb=_1c8[0];var _1cc=this.cfg;var _1cd=this.parent;switch(_1cb.keyCode){case 37:case 39:if(this==_1cd.activeItem&&!_1cc.getProperty("selected")){_1cc.setProperty("selected",true);}else{var _1ce=(_1cb.keyCode==37)?this.getPreviousEnabledSibling():this.getNextEnabledSibling();if(_1ce){_1cd.clearActiveItem();_1ce.cfg.setProperty("selected",true);_1ce.focus();}}_1ca.preventDefault(_1cb);break;case 40:_1cd.clearActiveItem();_1cc.setProperty("selected",true);this.focus();var _1cf=_1cc.getProperty("submenu");if(_1cf){_1cf.show();_1cf.setInitialSelection();}_1ca.preventDefault(_1cb);break;}};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){var _1=YAHOO.util.Dom;var _2=YAHOO.util.Event;YAHOO.widget.MenuManager=new function(){var _3=false;var _4={};var _5={};var _6={};var _7=function(_8){var _9=_1.generateId();if(_8&&_5[_9]!=_8){_8.element.setAttribute("yuiid",_9);_5[_9]=_8;_8.destroyEvent.subscribe(onItemDestroy,_8);}};var _a=function(_b){var _c=_b.element.getAttribute("yuiid");if(_c&&_5[_c]){delete _5[_c];}};var _d=function(_e){var _f;if(_e&&_e.tagName){switch(_e.tagName.toUpperCase()){case "DIV":_f=_e.parentNode;if(_1.hasClass(_e,"bd")&&_f&&_f.tagName&&_f.tagName.toUpperCase()=="DIV"){return _f;}else{return _e;}break;case "LI":return _e;default:_f=_e.parentNode;if(_f){return _d(_f);}break;}}};var _10=function(_11){var _12=_2.getTarget(_11);var _13=_d(_12);var _14;var _15;if(_13){var _16=_13.tagName.toUpperCase();if(_16=="LI"){var _17=_13.getAttribute("yuiid");if(_17){_14=_5[_17];_15=_14.parent;}}else{if(_16=="DIV"){if(_13.id){_15=_4[_13.id];}}}}if(_15){var _18={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"};var _19=_18[_11.type];if(_14&&!_14.cfg.getProperty("disabled")){_14[_19].fire(_11);}_15[_19].fire(_11,_14);}else{if(_11.type=="mousedown"){var _1a;for(var i in _4){if(_4.hasOwnProperty(i)){_15=_4[i];if(_15.cfg.getProperty("clicktohide")&&_15.cfg.getProperty("position")=="dynamic"){_15.hide();}else{_15.clearActiveItem(true);}}}}}};var _1c=function(_1d,_1e,_1f){this.removeMenu(_1f);};var _20=function(_21,_22,_23){var _24=_23.element.getAttribute("yuiid");if(_24){delete _5[_24];}};var _25=function(_26,_27,_28){var _29=_27[0];if(_29){_6[_28.id]=_28;}else{if(_6[_28.id]){delete _6[_28.id];}}};var _2a=function(_2b,_2c){_7(_2c[0]);};var _2d=function(_2e,_2f){_a(_2f[0]);};this.addMenu=function(_30){if(_30&&_30.id&&!_4[_30.id]){_4[_30.id]=_30;if(!_3){var _31=document;_2.addListener(_31,"mouseover",_10,this,true);_2.addListener(_31,"mouseout",_10,this,true);_2.addListener(_31,"mousedown",_10,this,true);_2.addListener(_31,"mouseup",_10,this,true);_2.addListener(_31,"click",_10,this,true);_2.addListener(_31,"keydown",_10,this,true);_2.addListener(_31,"keyup",_10,this,true);_2.addListener(_31,"keypress",_10,this,true);_3=true;}_30.destroyEvent.subscribe(_1c,_30,this);_30.cfg.subscribeToConfigEvent("visible",_25,_30);_30.itemAddedEvent.subscribe(_2a);_30.itemRemovedEvent.subscribe(_2d);}};this.removeMenu=function(_32){if(_32&&_4[_32.id]){delete _4[_32.id];}};this.hideVisible=function(){var _33;for(var i in _6){if(_6.hasOwnProperty(i)){_33=_6[i];if(_33.cfg.getProperty("position")=="dynamic"){_33.hide();}}}};this.getMenus=function(){return _4;};this.getMenu=function(_35){if(_4[_35]){return _4[_35];}};this.toString=function(){return ("MenuManager");};};})();(function(){var Dom=YAHOO.util.Dom;var _37=YAHOO.util.Event;YAHOO.widget.Menu=function(_38,_39){if(_39){this.parent=_39.parent;this.lazyLoad=_39.lazyLoad||_39.lazyload;this.itemData=_39.itemData||_39.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,_38,_39);};YAHOO.extend(YAHOO.widget.Menu,YAHOO.widget.Overlay,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",_nHideDelayId:null,_nShowDelayId:null,_hideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements: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(_3a,_3b){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var _3c;if(typeof _3a=="string"){_3c=document.getElementById(_3a);}else{if(_3a.tagName){_3c=_3a;}}if(_3c&&_3c.tagName){switch(_3c.tagName.toUpperCase()){case "DIV":this.srcElement=_3c;if(!_3c.id){_3c.setAttribute("id",Dom.generateId());}YAHOO.widget.Menu.superclass.init.call(this,_3c);this.beforeInitEvent.fire(YAHOO.widget.Menu);break;case "SELECT":this.srcElement=_3c;YAHOO.widget.Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(YAHOO.widget.Menu);break;}}else{YAHOO.widget.Menu.superclass.init.call(this,_3a);this.beforeInitEvent.fire(YAHOO.widget.Menu);}if(this.element){var oEl=this.element;Dom.addClass(oEl,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit,this,true);this.beforeRenderEvent.subscribe(this._onBeforeRender,this,true);this.renderEvent.subscribe(this._onRender,this,true);this.beforeShowEvent.subscribe(this._onBeforeShow,this,true);this.showEvent.subscribe(this._onShow,this,true);this.beforeHideEvent.subscribe(this._onBeforeHide,this,true);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.mouseOutEvent.subscribe(this._onMouseOut,this,true);this.clickEvent.subscribe(this._onClick,this,true);this.keyDownEvent.subscribe(this._onKeyDown,this,true);if(_3b){this.cfg.applyConfig(_3b,true);}YAHOO.widget.MenuManager.addMenu(this);this.initEvent.fire(YAHOO.widget.Menu);}},_initSubTree:function(){var _3e;if(this.srcElement.tagName=="DIV"){_3e=this.body.firstChild;var _3f=0;var _40=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case _40:this._aGroupTitleElements[_3f]=_3e;break;case "UL":this._aListElements[_3f]=_3e;this._aItemGroups[_3f]=[];_3f++;break;}}}while((_3e=_3e.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}_3e=null;if(this.srcElement.tagName){switch(this.srcElement.tagName.toUpperCase()){case "DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{_3e=this._aListElements[i].firstChild;do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case "LI":this.addItem(new this.ITEM_TYPE(_3e,{parent:this}),i);break;}}}while((_3e=_3e.nextSibling));}while(i--);}break;case "SELECT":_3e=this.srcElement.firstChild;do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case "OPTGROUP":case "OPTION":this.addItem(new this.ITEM_TYPE(_3e,{parent:this}));break;}}}while((_3e=_3e.nextSibling));break;}}},_getFirstEnabledItem:function(){var _42=this._aItemGroups.length;var _43;var _44;for(var i=0;i<_42;i++){_44=this._aItemGroups[i];if(_44){var _46=_44.length;for(var n=0;n<_46;n++){_43=_44[n];if(!_43.cfg.getProperty("disabled")&&_43.element.style.display!="none"){return _43;}_43=null;}}}},_checkPosition:function(_48){if(typeof _48=="string"){var _49=_48.toLowerCase();return ("dynamic,static".indexOf(_49)!=-1);}},_addItemToGroup:function(_4a,_4b,_4c){var _4d;if(_4b instanceof this.ITEM_TYPE){_4d=_4b;_4d.parent=this;}else{if(typeof _4b=="string"){_4d=new this.ITEM_TYPE(_4b,{parent:this});}else{if(typeof _4b=="object"&&_4b.text){var _4e=_4b.text;delete _4b["text"];_4b.parent=this;_4d=new this.ITEM_TYPE(_4e,_4b);}}}if(_4d){var _4f=typeof _4a=="number"?_4a:0;var _50=this._getItemGroup(_4f);var _51;if(!_50){_50=this._createItemGroup(_4f);}if(typeof _4c=="number"){var _52=(_4c>=_50.length);if(_50[_4c]){_50.splice(_4c,0,_4d);}else{_50[_4c]=_4d;}_51=_50[_4c];if(_51){if(_52&&(!_51.element.parentNode||_51.element.parentNode.nodeType==11)){this._aListElements[_4f].appendChild(_51.element);}else{var _53=function(_54,_55){return (_54[_55]||_53(_54,(_55+1)));};var _56=_53(_50,(_4c+1));if(_56&&(!_51.element.parentNode||_51.element.parentNode.nodeType==11)){this._aListElements[_4f].insertBefore(_51.element,_56.element);}}_51.parent=this;this._subscribeToItemEvents(_51);this._configureSubmenu(_51);this._updateItemProperties(_4f);this.itemAddedEvent.fire(_51);return _51;}}else{var _57=_50.length;_50[_57]=_4d;_51=_50[_57];if(_51){if(!Dom.isAncestor(this._aListElements[_4f],_51.element)){this._aListElements[_4f].appendChild(_51.element);}_51.element.setAttribute("groupindex",_4f);_51.element.setAttribute("index",_57);_51.parent=this;_51.index=_57;_51.groupIndex=_4f;this._subscribeToItemEvents(_51);this._configureSubmenu(_51);if(_57===0){Dom.addClass(_51.element,"first-of-type");}this.itemAddedEvent.fire(_51);return _51;}}}},_removeItemFromGroupByIndex:function(_58,_59){var _5a=typeof _58=="number"?_58:0;var _5b=this._getItemGroup(_5a);if(_5b){var _5c=_5b.splice(_59,1);var _5d=_5c[0];if(_5d){this._updateItemProperties(_5a);if(_5b.length===0){var oUL=this._aListElements[_5a];if(this.body&&oUL){this.body.removeChild(oUL);}this._aItemGroups.splice(_5a,1);this._aListElements.splice(_5a,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,"first-of-type");}}this.itemRemovedEvent.fire(_5d);return _5d;}}},_removeItemFromGroupByValue:function(_5f,_60){var _61=this._getItemGroup(_5f);if(_61){var _62=_61.length;var _63=-1;if(_62>0){var i=_62-1;do{if(_61[i]==_60){_63=i;break;}}while(i--);if(_63>-1){return this._removeItemFromGroupByIndex(_5f,_63);}}}},_updateItemProperties:function(_65){var _66=this._getItemGroup(_65);var _67=_66.length;if(_67>0){var i=_67-1;var _69;var oLI;do{_69=_66[i];if(_69){oLI=_69.element;_69.index=i;_69.groupIndex=_65;oLI.setAttribute("groupindex",_65);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(_6b){if(!this._aItemGroups[_6b]){this._aItemGroups[_6b]=[];var oUL=document.createElement("ul");this._aListElements[_6b]=oUL;return this._aItemGroups[_6b];}},_getItemGroup:function(_6d){var _6e=((typeof _6d=="number")?_6d:0);return this._aItemGroups[_6e];},_configureSubmenu:function(_6f){var _70=_6f.cfg.getProperty("submenu");if(_70){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,_70,true);this.renderEvent.subscribe(this._onParentMenuRender,_70,true);_70.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,_70,true);_70.showEvent.subscribe(this._onSubmenuShow,_70,true);_70.hideEvent.subscribe(this._onSubmenuHide,_70,true);}},_subscribeToItemEvents:function(_71){_71.focusEvent.subscribe(this._onMenuItemFocus,_71,this);_71.blurEvent.subscribe(this._onMenuItemBlur,this,true);_71.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,_71,this);},_getOffsetWidth:function(){var _72=this.element.cloneNode(true);Dom.setStyle(_72,"width","");document.body.appendChild(_72);var _73=_72.offsetWidth;document.body.removeChild(_72);return _73;},_cancelHideDelay:function(){var _74=this.getRoot();if(_74._nHideDelayId){window.clearTimeout(_74._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var _75=this.getRoot();var me=this;var _77=function(){if(_75.activeItem){_75.clearActiveItem();}if(_75==me&&me.cfg.getProperty("position")=="dynamic"){me.hide();}};_75._nHideDelayId=window.setTimeout(_77,_75.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var _78=this.getRoot();if(_78._nShowDelayId){window.clearTimeout(_78._nShowDelayId);}},_execShowDelay:function(_79){this._cancelShowDelay();var _7a=this.getRoot();var _7b=function(){_79.show();};_7a._nShowDelayId=window.setTimeout(_7b,_7a.cfg.getProperty("showdelay"));},_onMouseOver:function(_7c,_7d,_7e){var _7f=_7d[0];var _80=_7d[1];var _81=_37.getTarget(_7f);if(!this._bHandledMouseOverEvent&&(_81==this.element||Dom.isAncestor(this.element,_81))){this.clearActiveItem();this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(_80&&!_80.handledMouseOverEvent&&(_81==_80.element||Dom.isAncestor(_80.element,_81))){var _82=_80.cfg;_82.setProperty("selected",true);_80.focus();if(this.cfg.getProperty("autosubmenudisplay")){var _83=_82.getProperty("submenu");if(_83){if(this.cfg.getProperty("showdelay")>0){this._execShowDelay(_83);}else{_83.show();}}}_80.handledMouseOverEvent=true;_80.handledMouseOutEvent=false;}},_onMouseOut:function(_84,_85,_86){var _87=_85[0];var _88=_85[1];var _89=_37.getRelatedTarget(_87);var _8a=false;if(_88){var _8b=_88.cfg;var _8c=_8b.getProperty("submenu");if(_8c&&(_89==_8c.element||Dom.isAncestor(_8c.element,_89))){_8a=true;}if(!_88.handledMouseOutEvent&&((_89!=_88.element&&!Dom.isAncestor(_88.element,_89))||_8a)){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}if(!_8a){_8b.setProperty("selected",false);}if(this.cfg.getProperty("autosubmenudisplay")){if(_8c){if(!(_89==_8c.element||YAHOO.util.Dom.isAncestor(_8c.element,_89))){_8c.hide();}}}_88.handledMouseOutEvent=true;_88.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent&&((_89!=this.element&&!Dom.isAncestor(this.element,_89))||_8a)){this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onClick:function(_8d,_8e,_8f){var _90=_8e[0];var _91=_8e[1];var _92=_37.getTarget(_90);if(_91){var _93=_91.cfg;var _94=_93.getProperty("submenu");if(_92==_91.submenuIndicator&&_94){if(_94.cfg.getProperty("visible")){_94.hide();}else{this.clearActiveItem();this.activeItem=_91;_91.cfg.setProperty("selected",true);_94.show();}}else{var _95=_93.getProperty("url");var _96=(_95.substr((_95.length-1),1)=="#");var _97=_93.getProperty("target");var _98=(_97&&_97.length>0);if(_92.tagName.toUpperCase()=="A"&&_96&&!_98){_37.preventDefault(_90);}if(_92.tagName.toUpperCase()!="A"&&!_96&&!_98){document.location=_95;}if(_96&&!_94){var _99=this.getRoot();if(_99.cfg.getProperty("position")=="static"){_99.clearActiveItem();}else{_99.hide();}}}}},_onKeyDown:function(_9a,_9b,_9c){var _9d=_9b[0];var _9e=_9b[1];var _9f;if(_9e){var _a0=_9e.cfg;var _a1=this.parent;var _a2;var _a3;switch(_9d.keyCode){case 38:case 40:if(_9e==this.activeItem&&!_a0.getProperty("selected")){_a0.setProperty("selected",true);}else{_a3=(_9d.keyCode==38)?_9e.getPreviousEnabledSibling():_9e.getNextEnabledSibling();if(_a3){this.clearActiveItem();_a3.cfg.setProperty("selected",true);_a3.focus();}}_37.preventDefault(_9d);break;case 39:_9f=_a0.getProperty("submenu");if(_9f){if(!_a0.getProperty("selected")){_a0.setProperty("selected",true);}_9f.show();_9f.setInitialSelection();}else{_a2=this.getRoot();if(_a2 instanceof YAHOO.widget.MenuBar){_a3=_a2.activeItem.getNextEnabledSibling();if(_a3){_a2.clearActiveItem();_a3.cfg.setProperty("selected",true);_9f=_a3.cfg.getProperty("submenu");if(_9f){_9f.show();}_a3.focus();}}}_37.preventDefault(_9d);break;case 37:if(_a1){var _a4=_a1.parent;if(_a4 instanceof YAHOO.widget.MenuBar){_a3=_a4.activeItem.getPreviousEnabledSibling();if(_a3){_a4.clearActiveItem();_a3.cfg.setProperty("selected",true);_9f=_a3.cfg.getProperty("submenu");if(_9f){_9f.show();}_a3.focus();}}else{this.hide();_a1.focus();}}_37.preventDefault(_9d);break;}}if(_9d.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}else{if(this.activeItem){_9f=this.activeItem.cfg.getProperty("submenu");if(_9f&&_9f.cfg.getProperty("visible")){_9f.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}}_37.preventDefault(_9d);}},_onInit:function(_a5,_a6,_a7){if(((this.parent&&!this.lazyLoad)||(!this.parent&&this.cfg.getProperty("position")=="static")||(!this.parent&&!this.lazyLoad&&this.cfg.getProperty("position")=="dynamic"))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(this.lazyLoad){this.cfg.fireQueue();}}},_onBeforeRender:function(_a8,_a9,_aa){var _ab=this.cfg;var oEl=this.element;var _ad=this._aListElements.length;if(_ad>0){var i=0;var _af=true;var oUL;var _b1;do{oUL=this._aListElements[i];if(oUL){if(_af){Dom.addClass(oUL,"first-of-type");_af=false;}if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}_b1=this._aGroupTitleElements[i];if(_b1){if(!Dom.isAncestor(oEl,_b1)){oUL.parentNode.insertBefore(_b1,oUL);}Dom.addClass(oUL,"hastitle");}}i++;}while(i<_ad);}},_onRender:function(_b2,_b3,_b4){if(this.cfg.getProperty("position")=="dynamic"){var _b5=this.element.parentNode.tagName.toUpperCase()=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(_b5+"px"));}},_onBeforeShow:function(_b6,_b7,_b8){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"){var _b9=this.itemData.length;for(var n=0;n<_b9;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}else{this.addItems(this.itemData);}}if(this.srcElement){this.render();}else{if(this.parent){this.render(this.parent.element);}else{this.render(this.cfg.getProperty("container"));}}}},_onShow:function(_bb,_bc,_bd){this.setInitialFocus();var _be=this.parent;if(_be){var _bf=_be.parent;var _c0=_bf.cfg.getProperty("submenualignment");var _c1=this.cfg.getProperty("submenualignment");if((_c0[0]!=_c1[0])&&(_c0[1]!=_c1[1])){this.cfg.setProperty("submenualignment",[_c0[0],_c0[1]]);}if(!_bf.cfg.getProperty("autosubmenudisplay")&&_bf.cfg.getProperty("position")=="static"){_bf.cfg.setProperty("autosubmenudisplay",true);var _c2=function(_c3){if(_c3.type=="mousedown"||(_c3.type=="keydown"&&_c3.keyCode==27)){var _c4=_37.getTarget(_c3);if(_c4!=_bf.element||!YAHOO.util.Dom.isAncestor(_bf.element,_c4)){_bf.cfg.setProperty("autosubmenudisplay",false);_37.removeListener(document,"mousedown",_c2);_37.removeListener(document,"keydown",_c2);}}};_37.addListener(document,"mousedown",_c2);_37.addListener(document,"keydown",_c2);}}},_onBeforeHide:function(_c5,_c6,_c7){this.clearActiveItem(true);},_onParentMenuConfigChange:function(_c8,_c9,_ca){var _cb=_c9[0][0];var _cc=_c9[0][1];switch(_cb){case "iframe":case "constraintoviewport":case "hidedelay":case "showdelay":case "clicktohide":case "effect":_ca.cfg.setProperty(_cb,_cc);break;}},_onParentMenuRender:function(_cd,_ce,_cf){var _d0=_cf.parent.parent;var _d1={constraintoviewport:_d0.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:_d0.cfg.getProperty("clicktohide"),effect:_d0.cfg.getProperty("effect")};var _d2=_d0.cfg.getProperty("showdelay");if(_d2>0){_d1.showdelay=_d2;}var _d3=_d0.cfg.getProperty("hidedelay");if(_d3>0){_d1.hidedelay=_d3;}if(this.cfg.getProperty("position")==_d0.cfg.getProperty("position")){_d1.iframe=_d0.cfg.getProperty("iframe");}_cf.cfg.applyConfig(_d1);if(!this.lazyLoad){if(Dom.inDocument(this.element)){this.render();}else{this.render(this.parent.element);}}},_onSubmenuBeforeShow:function(_d4,_d5,_d6){var _d7=this.parent;var _d8=_d7.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[_d7.element,_d8[0],_d8[1]]);_d7.submenuIndicator.alt=_d7.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuShow:function(_d9,_da,_db){var _dc=this.parent;_dc.submenuIndicator.alt=_dc.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuHide:function(_dd,_de,_df){var _e0=this.parent;_e0.submenuIndicator.alt=_e0.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;},_onMenuItemFocus:function(_e1,_e2,_e3){this.activeItem=_e3;},_onMenuItemBlur:function(_e4,_e5){this.activeItem=null;},_onMenuItemConfigChange:function(_e6,_e7,_e8){var _e9=_e7[0][0];switch(_e9){case "submenu":var _ea=_e7[0][1];if(_ea){this._configureSubmenu(_e8);}break;case "text":case "helptext":if(this.element.style.width){var _eb=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",_eb);}break;}},enforceConstraints:function(_ec,_ed,obj){var _ef=this.cfg;var pos=_ed[0];var x=pos[0];var y=pos[1];var bod=document.getElementsByTagName("body")[0];var htm=document.getElementsByTagName("html")[0];var _f5=Dom.getStyle(bod,"overflow");var _f6=Dom.getStyle(htm,"overflow");var _f7=this.element.offsetHeight;var _f8=this.element.offsetWidth;var _f9=Dom.getClientWidth();var _fa=Dom.getClientHeight();var _fb=window.scrollX||document.body.scrollLeft;var _fc=window.scrollY||document.body.scrollTop;var _fd=_fc+10;var _fe=_fb+10;var _ff=_fc+_fa-_f7-10;var _100=_fb+_f9-_f8-10;var _101=_ef.getProperty("context");var _102=_101?_101[0]:null;if(x<10){x=_fe;}else{if((x+_f8)>_f9){if(_102&&((x-_102.offsetWidth)>_f8)){x=(x-(_102.offsetWidth+_f8));}else{x=_100;}}}if(y<10){y=_fd;}else{if(y>_ff){if(_102&&(y>_f7)){y=((y+_102.offsetHeight)-_f7);}else{y=_ff;}}}_ef.setProperty("x",x,true);_ef.setProperty("y",y,true);},configVisible:function(_103,_104,_105){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configVisible.call(this,_103,_104,_105);}else{var _106=_104[0];var _107=Dom.getStyle(this.element,"display");if(_106){if(_107!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(_107=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(_108,_109,_10a){var _10b=_109[0]=="static"?"static":"absolute";var oCfg=this.cfg;Dom.setStyle(this.element,"position",_10b);if(_10b=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}else{Dom.setStyle(this.element,"visibility","hidden");}if(_10b=="absolute"){var _10d=oCfg.getProperty("zindex");if(!_10d||_10d===0){_10d=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",_10d);}}},configIframe:function(_10e,_10f,_110){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configIframe.call(this,_10e,_10f,_110);}},configHideDelay:function(_111,_112,_113){var _114=_112[0];var _115=this.mouseOutEvent;var _116=this.mouseOverEvent;var _117=this.keyDownEvent;if(_114>0){if(!this._hideDelayEventHandlersAssigned){_115.subscribe(this._execHideDelay,true);_116.subscribe(this._cancelHideDelay,this,true);_117.subscribe(this._cancelHideDelay,this,true);this._hideDelayEventHandlersAssigned=true;}}else{_115.unsubscribe(this._execHideDelay,this);_116.unsubscribe(this._cancelHideDelay,this);_117.unsubscribe(this._cancelHideDelay,this);this._hideDelayEventHandlersAssigned=false;}},configContainer:function(_118,_119,_11a){var _11b=_119[0];if(typeof _11b=="string"){this.cfg.setProperty("container",document.getElementById(_11b),true);}},onDomResize:function(e,obj){if(!this._handleResize){this._handleResize=true;return;}var _11e=this.cfg;if(_11e.getProperty("position")=="dynamic"){_11e.setProperty("width",(this._getOffsetWidth()+"px"));}YAHOO.widget.Menu.superclass.onDomResize.call(this,e,obj);},initEvents:function(){YAHOO.widget.Menu.superclass.initEvents.call(this);var _11f=YAHOO.util.CustomEvent;this.mouseOverEvent=new _11f("mouseOverEvent",this);this.mouseOutEvent=new _11f("mouseOutEvent",this);this.mouseDownEvent=new _11f("mouseDownEvent",this);this.mouseUpEvent=new _11f("mouseUpEvent",this);this.clickEvent=new _11f("clickEvent",this);this.keyPressEvent=new _11f("keyPressEvent",this);this.keyDownEvent=new _11f("keyDownEvent",this);this.keyUpEvent=new _11f("keyUpEvent",this);this.itemAddedEvent=new _11f("itemAddedEvent",this);this.itemRemovedEvent=new _11f("itemRemovedEvent",this);},getRoot:function(){var _120=this.parent;if(_120){var _121=_120.parent;return _121?_121.getRoot():this;}else{return this;}},toString:function(){return ("Menu "+this.id);},setItemGroupTitle:function(_122,_123){if(typeof _122=="string"&&_122.length>0){var _124=typeof _123=="number"?_123:0;var _125=this._aGroupTitleElements[_124];if(_125){_125.innerHTML=_122;}else{_125=document.createElement(this.GROUP_TITLE_TAG_NAME);_125.innerHTML=_122;this._aGroupTitleElements[_124]=_125;}var i=this._aGroupTitleElements.length-1;var _127;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");_127=i;}}while(i--);if(_127!==null){Dom.addClass(this._aGroupTitleElements[_127],"first-of-type");}}},addItem:function(_128,_129){if(_128){return this._addItemToGroup(_129,_128);}},addItems:function(_12a,_12b){function isArray(_12c){return (typeof _12c=="object"&&_12c.constructor==Array);}if(isArray(_12a)){var _12d=_12a.length;var _12e=[];var _12f;for(var i=0;i<_12d;i++){_12f=_12a[i];if(isArray(_12f)){_12e[_12e.length]=this.addItems(_12f,i);}else{_12e[_12e.length]=this._addItemToGroup(_12b,_12f);}}if(_12e.length){return _12e;}}},insertItem:function(_131,_132,_133){if(_131){return this._addItemToGroup(_133,_131,_132);}},removeItem:function(_134,_135){if(typeof _134!="undefined"){var _136;if(_134 instanceof YAHOO.widget.MenuItem){_136=this._removeItemFromGroupByValue(_135,_134);}else{if(typeof _134=="number"){_136=this._removeItemFromGroupByIndex(_135,_134);}}if(_136){_136.destroy();return _136;}}},getItemGroups:function(){return this._aItemGroups;},getItem:function(_137,_138){if(typeof _137=="number"){var _139=this._getItemGroup(_138);if(_139){return _139[_137];}}},destroy:function(){this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();var _13a=this._aItemGroups.length;var _13b;var _13c;var _13d;var i;var n;if(_13a>0){i=_13a-1;do{_13c=this._aItemGroups[i];if(_13c){_13b=_13c.length;if(_13b>0){n=_13b-1;do{_13d=this._aItemGroups[i][n];if(_13d){_13d.destroy();}}while(n--);}}}while(i--);}YAHOO.widget.Menu.superclass.destroy.call(this);},setInitialFocus:function(){var _140=this._getFirstEnabledItem();if(_140){_140.focus();}},setInitialSelection:function(){var _141=this._getFirstEnabledItem();if(_141){_141.cfg.setProperty("selected",true);}},clearActiveItem:function(_142){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}var _143=this.activeItem;if(_143){var _144=_143.cfg;_144.setProperty("selected",false);var _145=_144.getProperty("submenu");if(_145){_145.hide();}if(_142){_143.blur();}}},initDefaultConfig:function(){YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);var _146=this.cfg;_146.addProperty("visible",{value:false,handler:this.configVisible,validator:this.cfg.checkBoolean});_146.addProperty("constraintoviewport",{value:true,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});_146.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});_146.addProperty("submenualignment",{value:["tl","tr"]});_146.addProperty("autosubmenudisplay",{value:true,validator:_146.checkBoolean});_146.addProperty("showdelay",{value:0,validator:_146.checkNumber});_146.addProperty("hidedelay",{value:0,validator:_146.checkNumber,handler:this.configHideDelay,suppressEvent:true});_146.addProperty("clicktohide",{value:true,validator:_146.checkBoolean});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}});})();YAHOO.widget.MenuModule=YAHOO.widget.Menu;(function(){var Dom=YAHOO.util.Dom;var _148=YAHOO.widget.Module;var Menu=YAHOO.widget.Menu;YAHOO.widget.MenuItem=function(_14a,_14b){if(_14a){if(_14b){this.parent=_14b.parent;this.value=_14b.value;}this.init(_14a,_14b);}};YAHOO.widget.MenuItem.prototype={SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_dim_1.gif",COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT:"Collapsed.  Click to expand.",EXPANDED_SUBMENU_INDICATOR_ALT_TEXT:"Expanded.  Click to collapse.",DISABLED_SUBMENU_INDICATOR_ALT_TEXT:"Disabled.",CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_nrm_1.gif",SELECTED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_hov_1.gif",DISABLED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_dim_1.gif",CHECKED_IMAGE_ALT_TEXT:"Checked.",DISABLED_CHECKED_IMAGE_ALT_TEXT:"Checked. (Item disabled.)",CSS_CLASS_NAME:"yuimenuitem",SUBMENU_TYPE:null,IMG_ROOT:"http://us.i1.yimg.com/us.yimg.com/i/",IMG_ROOT_SSL:"https://a248.e.akamai.net/sec.yimg.com/i/",_oAnchor:null,_oText:null,_oHelpTextEM:null,_oSubmenu:null,_checkImage:null,constructor:YAHOO.widget.MenuItem,imageRoot:null,isSecure:_148.prototype.isSecure,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:_148.prototype.browser,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(_14c,_14d){this.imageRoot=(this.isSecure)?this.IMG_ROOT_SSL:this.IMG_ROOT;if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var _14e=this.cfg;if(this._checkString(_14c)){this._createRootNodeStructure();_14e.setProperty("text",_14c);}else{if(this._checkDOMNode(_14c)){switch(_14c.tagName.toUpperCase()){case "OPTION":this._createRootNodeStructure();_14e.setProperty("text",_14c.text);this.srcElement=_14c;break;case "OPTGROUP":this._createRootNodeStructure();_14e.setProperty("text",_14c.label);this.srcElement=_14c;this._initSubTree();break;case "LI":var _14f=this._getFirstElement(_14c,"A");var sURL="#";var _151=null;var _152=null;if(_14f){sURL=_14f.getAttribute("href");_151=_14f.getAttribute("target");if(_14f.innerText){_152=_14f.innerText;}else{var _153=_14f.ownerDocument.createRange();_153.selectNodeContents(_14f);_152=_153.toString();}}else{var _154=_14c.firstChild;_152=_154.nodeValue;_14f=document.createElement("a");_14f.setAttribute("href",sURL);_14c.replaceChild(_14f,_154);_14f.appendChild(_154);}this.srcElement=_14c;this.element=_14c;this._oAnchor=_14f;var _155=this._getFirstElement(_14f);var _156=false;var _157=false;if(_155){this._oText=_155.firstChild;switch(_155.tagName.toUpperCase()){case "EM":_156=true;break;case "STRONG":_157=true;break;}}else{this._oText=_14f.firstChild;}_14e.setProperty("text",_152,true);_14e.setProperty("url",sURL,true);_14e.setProperty("target",_151,true);_14e.setProperty("emphasis",_156,true);_14e.setProperty("strongemphasis",_157,true);this._initSubTree();break;}}}if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);var _158=YAHOO.util.CustomEvent;this.destroyEvent=new _158("destroyEvent",this);this.mouseOverEvent=new _158("mouseOverEvent",this);this.mouseOutEvent=new _158("mouseOutEvent",this);this.mouseDownEvent=new _158("mouseDownEvent",this);this.mouseUpEvent=new _158("mouseUpEvent",this);this.clickEvent=new _158("clickEvent",this);this.keyPressEvent=new _158("keyPressEvent",this);this.keyDownEvent=new _158("keyDownEvent",this);this.keyUpEvent=new _158("keyUpEvent",this);this.focusEvent=new _158("focusEvent",this);this.blurEvent=new _158("blurEvent",this);if(_14d){_14e.applyConfig(_14d);}_14e.fireQueue();}},_getFirstElement:function(_159,_15a){var _15b;if(_159.firstChild&&_159.firstChild.nodeType==1){_15b=_159.firstChild;}else{if(_159.firstChild&&_159.firstChild.nextSibling&&_159.firstChild.nextSibling.nodeType==1){_15b=_159.firstChild.nextSibling;}}if(_15a){return (_15b&&_15b.tagName.toUpperCase()==_15a)?_15b:false;}return _15b;},_checkString:function(_15c){return (typeof _15c=="string");},_checkDOMNode:function(_15d){return (_15d&&_15d.tagName);},_createRootNodeStructure:function(){this.element=document.createElement("li");this._oText=document.createTextNode("");this._oAnchor=document.createElement("a");this._oAnchor.appendChild(this._oText);this.cfg.refireEvent("url");this.element.appendChild(this._oAnchor);},_initSubTree:function(){var _15e=this.srcElement;var _15f=this.cfg;if(_15e.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){_15f.setProperty("submenu",{id:Dom.generateId(),itemdata:_15e.childNodes});}else{var _160=_15e.firstChild;var _161=[];do{if(_160&&_160.tagName){switch(_160.tagName.toUpperCase()){case "DIV":_15f.setProperty("submenu",_160);break;case "OPTION":_161[_161.length]=_160;break;}}}while((_160=_160.nextSibling));var _162=_161.length;if(_162>0){var _163=new this.SUBMENU_TYPE(Dom.generateId());_15f.setProperty("submenu",_163);for(var n=0;n<_162;n++){_163.addItem((new _163.ITEM_TYPE(_161[n])));}}}}},_preloadImage:function(_165){var _166=this.imageRoot+_165;if(!document.images[_166]){var _167=document.createElement("img");_167.src=_166;_167.name=_166;_167.id=_166;_167.style.display="none";document.body.appendChild(_167);}},configText:function(_168,_169,_16a){var _16b=_169[0];if(this._oText){this._oText.nodeValue=_16b;}},configHelpText:function(_16c,_16d,_16e){var me=this;var _170=_16d[0];var oEl=this.element;var _172=this.cfg;var _173=[oEl,this._oAnchor];var oImg=this.submenuIndicator;var _175=function(){Dom.addClass(_173,"hashelptext");if(_172.getProperty("disabled")){_172.refireEvent("disabled");}if(_172.getProperty("selected")){_172.refireEvent("selected");}};var _176=function(){Dom.removeClass(_173,"hashelptext");oEl.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;};if(this._checkDOMNode(_170)){if(this._oHelpTextEM){this._oHelpTextEM.parentNode.replaceChild(_170,this._oHelpTextEM);}else{this._oHelpTextEM=_170;oEl.insertBefore(this._oHelpTextEM,oImg);}_175();}else{if(this._checkString(_170)){if(_170.length===0){_176();}else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");oEl.insertBefore(this._oHelpTextEM,oImg);}this._oHelpTextEM.innerHTML=_170;_175();}}else{if(!_170&&this._oHelpTextEM){_176();}}}},configURL:function(_177,_178,_179){var sURL=_178[0];if(!sURL){sURL="#";}this._oAnchor.setAttribute("href",sURL);},configTarget:function(_17b,_17c,_17d){var _17e=_17c[0];var _17f=this._oAnchor;if(_17e&&_17e.length>0){_17f.setAttribute("target",_17e);}else{_17f.removeAttribute("target");}},configEmphasis:function(_180,_181,_182){var _183=_181[0];var _184=this._oAnchor;var _185=this._oText;var _186=this.cfg;var oEM;if(_183&&_186.getProperty("strongemphasis")){_186.setProperty("strongemphasis",false);}if(_184){if(_183){oEM=document.createElement("em");oEM.appendChild(_185);_184.appendChild(oEM);}else{oEM=this._getFirstElement(_184,"EM");_184.removeChild(oEM);_184.appendChild(_185);}}},configStrongEmphasis:function(_188,_189,_18a){var _18b=_189[0];var _18c=this._oAnchor;var _18d=this._oText;var _18e=this.cfg;var _18f;if(_18b&&_18e.getProperty("emphasis")){_18e.setProperty("emphasis",false);}if(_18c){if(_18b){_18f=document.createElement("strong");_18f.appendChild(_18d);_18c.appendChild(_18f);}else{_18f=this._getFirstElement(_18c,"STRONG");_18c.removeChild(_18f);_18c.appendChild(_18d);}}},configChecked:function(_190,_191,_192){var _193=_191[0];var oEl=this.element;var _195=this.cfg;var oImg;if(_193){this._preloadImage(this.CHECKED_IMAGE_PATH);this._preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);this._preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.CHECKED_IMAGE_PATH);oImg.alt=this.CHECKED_IMAGE_ALT_TEXT;var _197=this.cfg.getProperty("submenu");if(_197){oEl.insertBefore(oImg,_197.element);}else{oEl.appendChild(oImg);}Dom.addClass([oEl,oImg],"checked");this._checkImage=oImg;if(_195.getProperty("disabled")){_195.refireEvent("disabled");}if(_195.getProperty("selected")){_195.refireEvent("selected");}}else{oImg=this._checkImage;Dom.removeClass([oEl,oImg],"checked");if(oImg){oEl.removeChild(oImg);}this._checkImage=null;}},configDisabled:function(_198,_199,_19a){var _19b=_199[0];var _19c=this._oAnchor;var _19d=[this.element,_19c];var oEM=this._oHelpTextEM;var _19f=this.cfg;var oImg;var _1a1;var _1a2;if(oEM){_19d[2]=oEM;}if(this.cfg.getProperty("checked")){_1a2=this.CHECKED_IMAGE_ALT_TEXT;_1a1=this.CHECKED_IMAGE_PATH;oImg=this._checkImage;if(_19b){_1a2=this.DISABLED_CHECKED_IMAGE_ALT_TEXT;_1a1=this.DISABLED_CHECKED_IMAGE_PATH;}oImg.src=document.images[(this.imageRoot+_1a1)].src;oImg.alt=_1a2;}oImg=this.submenuIndicator;if(_19b){if(_19f.getProperty("selected")){_19f.setProperty("selected",false);}_19c.removeAttribute("href");Dom.addClass(_19d,"disabled");_1a1=this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;_1a2=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}else{_19c.setAttribute("href",_19f.getProperty("url"));Dom.removeClass(_19d,"disabled");_1a1=this.SUBMENU_INDICATOR_IMAGE_PATH;_1a2=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}if(oImg){oImg.src=this.imageRoot+_1a1;oImg.alt=_1a2;}},configSelected:function(_1a3,_1a4,_1a5){if(!this.cfg.getProperty("disabled")){var _1a6=_1a4[0];var oEM=this._oHelpTextEM;var _1a8=[this.element,this._oAnchor];var oImg=this.submenuIndicator;var _1aa;if(oEM){_1a8[_1a8.length]=oEM;}if(oImg){_1a8[_1a8.length]=oImg;}if(this.cfg.getProperty("checked")){_1aa=this.imageRoot+(_1a6?this.SELECTED_CHECKED_IMAGE_PATH:this.CHECKED_IMAGE_PATH);this._checkImage.src=document.images[_1aa].src;}if(_1a6){Dom.addClass(_1a8,"selected");_1aa=this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;}else{Dom.removeClass(_1a8,"selected");_1aa=this.SUBMENU_INDICATOR_IMAGE_PATH;}if(oImg){oImg.src=document.images[(this.imageRoot+_1aa)].src;}}},configSubmenu:function(_1ab,_1ac,_1ad){var oEl=this.element;var _1af=_1ac[0];var oImg=this.submenuIndicator;var _1b1=this.cfg;var _1b2=[this.element,this._oAnchor];var _1b3;var _1b4=this.parent&&this.parent.lazyLoad;if(_1af){if(_1af instanceof Menu){_1b3=_1af;_1b3.parent=this;_1b3.lazyLoad=_1b4;}else{if(typeof _1af=="object"&&_1af.id&&!_1af.nodeType){var _1b5=_1af.id;var _1b6=_1af;delete _1af["id"];_1b6.lazyload=_1b4;_1b6.parent=this;_1b3=new this.SUBMENU_TYPE(_1b5,_1b6);this.cfg.setProperty("submenu",_1b3,true);}else{_1b3=new this.SUBMENU_TYPE(_1af,{lazyload:_1b4,parent:this});this.cfg.setProperty("submenu",_1b3,true);}}if(_1b3){this._oSubmenu=_1b3;if(!oImg){this._preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.SUBMENU_INDICATOR_IMAGE_PATH);oImg.alt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;oEl.appendChild(oImg);this.submenuIndicator=oImg;Dom.addClass(_1b2,"hassubmenu");if(_1b1.getProperty("disabled")){_1b1.refireEvent("disabled");}if(_1b1.getProperty("selected")){_1b1.refireEvent("selected");}}}}else{Dom.removeClass(_1b2,"hassubmenu");if(oImg){oEl.removeChild(oImg);}if(this._oSubmenu){this._oSubmenu.destroy();}}},initDefaultConfig:function(){var _1b7=this.cfg;var _1b8=_1b7.checkBoolean;_1b7.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});_1b7.addProperty("helptext",{handler:this.configHelpText});_1b7.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});_1b7.addProperty("target",{handler:this.configTarget,suppressEvent:true});_1b7.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:_1b8,suppressEvent:true});_1b7.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:_1b8,suppressEvent:true});_1b7.addProperty("checked",{value:false,handler:this.configChecked,validator:this.cfg.checkBoolean,suppressEvent:true,supercedes:["disabled"]});_1b7.addProperty("disabled",{value:false,handler:this.configDisabled,validator:_1b8,suppressEvent:true});_1b7.addProperty("selected",{value:false,handler:this.configSelected,validator:_1b8,suppressEvent:true});_1b7.addProperty("submenu",{handler:this.configSubmenu});},getNextEnabledSibling:function(){if(this.parent instanceof Menu){var _1b9=this.groupIndex;var _1ba=function(_1bb,_1bc){return _1bb[_1bc]||_1ba(_1bb,(_1bc+1));};var _1bd=this.parent.getItemGroups();var _1be;if(this.index<(_1bd[_1b9].length-1)){_1be=_1ba(_1bd[_1b9],(this.index+1));}else{var _1bf;if(_1b9<(_1bd.length-1)){_1bf=_1b9+1;}else{_1bf=0;}var _1c0=_1ba(_1bd,_1bf);_1be=_1ba(_1c0,0);}return (_1be.cfg.getProperty("disabled")||_1be.element.style.display=="none")?_1be.getNextEnabledSibling():_1be;}},getPreviousEnabledSibling:function(){if(this.parent instanceof Menu){var _1c1=this.groupIndex;var _1c2=function(_1c3,_1c4){return _1c3[_1c4]||_1c2(_1c3,(_1c4-1));};var _1c5=function(_1c6,_1c7){return _1c6[_1c7]?_1c7:_1c5(_1c6,(_1c7+1));};var _1c8=this.parent.getItemGroups();var _1c9;if(this.index>_1c5(_1c8[_1c1],0)){_1c9=_1c2(_1c8[_1c1],(this.index-1));}else{var _1ca;if(_1c1>_1c5(_1c8,0)){_1ca=_1c1-1;}else{_1ca=_1c8.length-1;}var _1cb=_1c2(_1c8,_1ca);_1c9=_1c2(_1cb,(_1cb.length-1));}return (_1c9.cfg.getProperty("disabled")||_1c9.element.style.display=="none")?_1c9.getPreviousEnabledSibling():_1c9;}},focus:function(){var _1cc=this.parent;var _1cd=this._oAnchor;var _1ce=_1cc.activeItem;if(!this.cfg.getProperty("disabled")&&_1cc&&_1cc.cfg.getProperty("visible")&&this.element.style.display!="none"){if(_1ce){_1ce.blur();}try{_1cd.focus();}catch(e){}this.focusEvent.fire();}},blur:function(){var _1cf=this.parent;if(!this.cfg.getProperty("disabled")&&_1cf&&Dom.getStyle(_1cf.element,"visibility")=="visible"){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){var oEl=this.element;if(oEl){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();var _1d1=oEl.parentNode;if(_1d1){_1d1.removeChild(oEl);this.destroyEvent.fire();}this.destroyEvent.unsubscribeAll();}},toString:function(){return ("MenuItem: "+this.cfg.getProperty("text"));}};})();YAHOO.widget.MenuModuleItem=YAHOO.widget.MenuItem;YAHOO.widget.ContextMenu=function(_1d2,_1d3){YAHOO.widget.ContextMenu.superclass.constructor.call(this,_1d2,_1d3);};YAHOO.extend(YAHOO.widget.ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,contextEventTarget:null,init:function(_1d4,_1d5){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenu.superclass.init.call(this,_1d4);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(_1d5){this.cfg.applyConfig(_1d5,true);}this.initEvent.fire(YAHOO.widget.ContextMenu);},_removeEventHandlers:function(){var _1d6=YAHOO.util.Event;var _1d7=this._oTrigger;var _1d8=(this.browser=="opera");_1d6.removeListener(_1d7,(_1d8?"mousedown":"contextmenu"),this._onTriggerContextMenu);if(_1d8){_1d6.removeListener(_1d7,"click",this._onTriggerClick);}},_onTriggerClick:function(_1d9,_1da){if(_1d9.ctrlKey){YAHOO.util.Event.stopEvent(_1d9);}},_onTriggerContextMenu:function(_1db,_1dc){YAHOO.widget.MenuManager.hideVisible();var _1dd=YAHOO.util.Event;var _1de=this.cfg;if(_1db.type=="mousedown"&&!_1db.ctrlKey){return;}this.contextEventTarget=_1dd.getTarget(_1db);var nX=_1dd.getPageX(_1db);var nY=_1dd.getPageY(_1db);_1de.applyConfig({xy:[nX,nY],visible:true});_1de.fireQueue();_1dd.stopEvent(_1db);},toString:function(){return ("ContextMenu "+this.id);},initDefaultConfig:function(){YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty("trigger",{handler:this.configTrigger});},destroy:function(){this._removeEventHandlers();YAHOO.widget.ContextMenu.superclass.destroy.call(this);},configTrigger:function(_1e1,_1e2,_1e3){var _1e4=YAHOO.util.Event;var _1e5=_1e2[0];if(_1e5){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=_1e5;var _1e6=(this.browser=="opera");_1e4.addListener(_1e5,(_1e6?"mousedown":"contextmenu"),this._onTriggerContextMenu,this,true);if(_1e6){_1e4.addListener(_1e5,"click",this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});YAHOO.widget.ContextMenuItem=function(_1e7,_1e8){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,_1e7,_1e8);};YAHOO.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(_1e9,_1ea){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}YAHOO.widget.ContextMenuItem.superclass.init.call(this,_1e9);var _1eb=this.cfg;if(_1ea){_1eb.applyConfig(_1ea,true);}_1eb.fireQueue();},toString:function(){return ("MenuBarItem: "+this.cfg.getProperty("text"));}});YAHOO.widget.MenuBar=function(_1ec,_1ed){YAHOO.widget.MenuBar.superclass.constructor.call(this,_1ec,_1ed);};YAHOO.extend(YAHOO.widget.MenuBar,YAHOO.widget.Menu,{init:function(_1ee,_1ef){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}YAHOO.widget.MenuBar.superclass.init.call(this,_1ee);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);if(_1ef){this.cfg.applyConfig(_1ef,true);}this.initEvent.fire(YAHOO.widget.MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(_1f0,_1f1,_1f2){var _1f3=YAHOO.util.Event;var _1f4=_1f1[0];var _1f5=_1f1[1];var _1f6=_1f5.cfg;var _1f7;switch(_1f4.keyCode){case 27:if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}else{if(this.activeItem){_1f7=this.activeItem.cfg.getProperty("submenu");if(_1f7&&_1f7.cfg.getProperty("visible")){_1f7.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}}_1f3.preventDefault(_1f4);break;case 37:case 39:if(_1f5==this.activeItem&&!_1f6.getProperty("selected")){_1f6.setProperty("selected",true);}else{var _1f8=(_1f4.keyCode==37)?_1f5.getPreviousEnabledSibling():_1f5.getNextEnabledSibling();if(_1f8){this.clearActiveItem();_1f8.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){_1f7=_1f8.cfg.getProperty("submenu");if(_1f7){_1f7.show();_1f7.activeItem.blur();_1f7.activeItem=null;}}_1f8.focus();}}_1f3.preventDefault(_1f4);break;case 40:if(this.activeItem!=_1f5){this.clearActiveItem();_1f6.setProperty("selected",true);_1f5.focus();}_1f7=_1f6.getProperty("submenu");if(_1f7){if(_1f7.cfg.getProperty("visible")){_1f7.setInitialSelection();_1f7.setInitialFocus();}else{_1f7.show();}}_1f3.preventDefault(_1f4);break;}},_onClick:function(_1f9,_1fa,_1fb){YAHOO.widget.MenuBar.superclass._onClick.call(this,_1f9,_1fa,_1fb);var _1fc=_1fa[1];if(_1fc){var _1fd=YAHOO.util.Event;var Dom=YAHOO.util.Dom;var _1ff=_1fa[0];var _200=_1fd.getTarget(_1ff);var _201=this.activeItem;var _202=this.cfg;if(_201&&_201!=_1fc){this.clearActiveItem();}_1fc.cfg.setProperty("selected",true);_1fc.focus();var _203=_1fc.cfg.getProperty("submenu");if(_203&&_200!=_1fc.submenuIndicator){if(_203.cfg.getProperty("visible")){_203.hide();}else{_203.show();}}}},toString:function(){return ("MenuBar "+this.id);},initDefaultConfig:function(){YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);var _204=this.cfg;_204.addProperty("position",{value:"static",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});_204.addProperty("submenualignment",{value:["tl","bl"]});_204.addProperty("autosubmenudisplay",{value:false,validator:_204.checkBoolean});}});YAHOO.widget.MenuBarItem=function(_205,_206){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,_205,_206);};YAHOO.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(_207,_208){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,_207);var _209=this.cfg;if(_208){_209.applyConfig(_208,true);}_209.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_dim_1.gif",toString:function(){return ("MenuBarItem: "+this.cfg.getProperty("text"));}});
\ No newline at end of file
index 47bc52fe934d624e476f283a6c7e66d2db553135..48956e7c9b919481509036769375a629aa8452f2 100755 (executable)
 /*\r
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+http://developer.yahoo.com/yui/license.txt\r
+version: 0.12.0\r
 */\r
 \r
-\r
-/**\r
-* @class The superclass of all menu containers.\r
-* @constructor\r
-* @extends YAHOO.widget.Overlay\r
-* @base YAHOO.widget.Overlay\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuModule instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.MenuModule = function(p_oElement, p_oConfig) {\r
-\r
-    YAHOO.widget.MenuModule.superclass.constructor.call(\r
-        this, \r
-        p_oElement, \r
-        p_oConfig\r
-    );\r
-\r
-};\r
-\r
-YAHOO.extend(YAHOO.widget.MenuModule, YAHOO.widget.Overlay);\r
-\r
-// Constants\r
-\r
 /**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLDivElement of the MenuModule instance.\r
-* @final\r
-* @type String\r
+* @module menu\r
+* @description <p>The Menu Library features a collection of widgets that make\r
+* it easy to add menus to your website or web application.  With the Menu\r
+* Library you can create website fly-out menus, customized context menus, or\r
+* application-style menu bars with just a small amount of scripting.</p>\r
+* <ul>\r
+*    <li>Screen-reader accessibility.</li>\r
+*    <li>Keyboard and mouse navigation.</li>\r
+*    <li>A rich event model that provides access to all of a menu's\r
+*    interesting moments.</li>\r
+*    <li>Support for\r
+*    <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive\r
+*    Enhancement</a>; Menus can be created from simple,\r
+*    semantic markup on the page or purely through JavaScript.</li>\r
+* </ul>\r
+* @title Menu Library\r
+* @namespace YAHOO.widget\r
+* @requires Event, Dom, Container\r
 */\r
-YAHOO.widget.MenuModule.prototype.CSS_CLASS_NAME = "yuimenu";\r
+(function() {\r
 \r
-/**\r
-* Constant representing the type of item to instantiate and add when parsing \r
-* the child nodes (either HTMLLIElement, HTMLOptGroupElement or \r
-* HTMLOptionElement) of a menu's DOM.  The default \r
-* is YAHOO.widget.MenuModuleItem.\r
-* @final\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype.ITEM_TYPE = null;\r
+var Dom = YAHOO.util.Dom;\r
+var Event = YAHOO.util.Event;\r
 \r
 /**\r
-* Constant representing the tagname of the HTMLElement used to title \r
-* a group of items.\r
-* @final\r
-* @type String\r
+* Singleton that manages a collection of all menus and menu items.  Listens for\r
+* DOM events at the document level and dispatches the events to the\r
+* corresponding menu or menu item.\r
+*\r
+* @namespace YAHOO.widget\r
+* @class MenuManager\r
+* @static\r
 */\r
-YAHOO.widget.MenuModule.prototype.GROUP_TITLE_TAG_NAME = "H6";\r
+YAHOO.widget.MenuManager = new function() {\r
 \r
-// Private properties\r
+    // Private member variables\r
 \r
-/**\r
-* Array of HTMLElements used to title groups of items.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aGroupTitleElements = null;\r
+    // Flag indicating if the DOM event handlers have been attached\r
 \r
-/**\r
-* Multi-dimensional array of items.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aItemGroups = null;\r
+    var m_bInitializedEventHandlers = false;\r
 \r
-/**\r
-* An array of HTMLUListElements, each of which is the parent node of each \r
-* items's HTMLLIElement node.\r
-* @private\r
-* @type {Array}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._aListElements = null;\r
+    // Collection of menus\r
 \r
-/**\r
-* Reference to the Event utility singleton.\r
-* @private\r
-* @type {YAHOO.util.Event}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oEventUtil = YAHOO.util.Event;\r
+    var m_oMenus = {};\r
 \r
-/**\r
-* Reference to the Dom utility singleton.\r
-* @private\r
-* @type {YAHOO.util.Dom}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oDom = YAHOO.util.Dom;\r
 \r
-/**\r
-* Reference to the item the mouse is currently over.\r
-* @private\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._oCurrentItem = null;\r
+    //  Collection of menu items\r
 \r
-/** \r
-* The current state of a MenuModule instance's "mouseover" event\r
-* @private\r
-* @type {Boolean}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._bFiredMouseOverEvent = false;\r
+    var m_oItems = {};\r
 \r
-/** \r
-* The current state of a MenuModule instance's "mouseout" event\r
-* @private\r
-* @type {Boolean}\r
-*/\r
-YAHOO.widget.MenuModule.prototype._bFiredMouseOutEvent = false;\r
+    // Collection of visible menus\r
 \r
-// Public properties\r
+    var m_oVisibleMenus = {};\r
 \r
-/**\r
-* Reference to the item that has focus.\r
-* @private\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.activeItem = null;\r
+    // Logger\r
 \r
-/**\r
-* Returns a MenuModule instance's parent object.\r
-* @type {YAHOO.widget.MenuModuleItem}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.parent = null;\r
 \r
-/**\r
-* Returns the HTMLElement (either HTMLSelectElement or HTMLDivElement)\r
-* used create the MenuModule instance.\r
-* @type {HTMLSelectElement/HTMLDivElement}\r
-*/\r
-YAHOO.widget.MenuModule.prototype.srcElement = null;\r
+    // Private methods\r
 \r
-// Events\r
+    /**\r
+    * Adds an item to the collection of known menu items.\r
+    * @private\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
+    * instance to be added.\r
+    */\r
+    var addItem = function(p_oItem) {\r
 \r
-/**\r
-* Fires when the mouse has entered a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseOverEvent = null;\r
+        var sYUIId = Dom.generateId();\r
 \r
-/**\r
-* Fires when the mouse has left a MenuModule instance.  Passes back the DOM \r
-* Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseOutEvent = null;\r
+        if(p_oItem && m_oItems[sYUIId] != p_oItem) {\r
 \r
-/**\r
-* Fires when the user mouses down on a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseDownEvent = null;\r
+            p_oItem.element.setAttribute("yuiid", sYUIId);\r
 \r
-/**\r
-* Fires when the user releases a mouse button while the mouse is over \r
-* a MenuModule instance.  Passes back the DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.mouseUpEvent = null;\r
+            m_oItems[sYUIId] = p_oItem;\r
 \r
-/**\r
-* Fires when the user clicks the on a MenuModule instance.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.clickEvent = null;\r
+            p_oItem.destroyEvent.subscribe(onItemDestroy, p_oItem);\r
 \r
-/**\r
-* Fires when the user presses an alphanumeric key.  Passes back the \r
-* DOM Event object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyPressEvent = null;\r
 \r
-/**\r
-* Fires when the user presses a key.  Passes back the DOM Event \r
-* object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyDownEvent = null;\r
+        }\r
 \r
-/**\r
-* Fires when the user releases a key.  Passes back the DOM Event \r
-* object as an argument.\r
-* @type {YAHOO.util.CustomEvent}\r
-* @see YAHOO.util.CustomEvent\r
-*/\r
-YAHOO.widget.MenuModule.prototype.keyUpEvent = null;\r
+    };\r
 \r
-/**\r
-* The MenuModule class's initialization method. This method is automatically \r
-* called  by the constructor, and sets up all DOM references for \r
-* pre-existing markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuModule instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.init = function(p_oElement, p_oConfig) {\r
+    /**\r
+    * Removes an item from the collection of known menu items.\r
+    * @private\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
+    * instance to be removed.\r
+    */\r
+    var removeItem = function(p_oItem) {\r
 \r
-    var Dom = this._oDom;\r
-    var Event = this._oEventUtil;\r
+        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
 \r
-    if(!this.ITEM_TYPE) {\r
+        if(sYUIId && m_oItems[sYUIId]) {\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.MenuModuleItem;\r
+            delete m_oItems[sYUIId];\r
 \r
-    }\r
 \r
-    this._aItemGroups = [];\r
-    this._aListElements = [];\r
-    this._aGroupTitleElements = [];\r
+        }\r
 \r
-    var oElement;\r
+    };\r
 \r
-    if(typeof p_oElement == "string") {\r
+    /**\r
+    * Finds the root DIV node of a menu or the root LI node of a menu item.\r
+    * @private\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying\r
+    * an HTML element.\r
+    */\r
+    var getMenuRootElement = function(p_oElement) {\r
 \r
-        oElement = document.getElementById(p_oElement);\r
+        var oParentNode;\r
 \r
-    }\r
-    else if(p_oElement.tagName) {\r
+        if(p_oElement && p_oElement.tagName) {\r
 \r
-        oElement = p_oElement;\r
+            switch(p_oElement.tagName.toUpperCase()) {\r
 \r
-    }\r
+                case "DIV":\r
 \r
-    if(oElement) {\r
+                    oParentNode = p_oElement.parentNode;\r
 \r
-        switch(oElement.tagName) {\r
-    \r
-            case "DIV":\r
+                    // Check if the DIV is the inner "body" node of a menu\r
 \r
-                this.srcElement = oElement;\r
+                    if(\r
+                        Dom.hasClass(p_oElement, "bd") &&\r
+                        oParentNode &&\r
+                        oParentNode.tagName &&\r
+                        oParentNode.tagName.toUpperCase() == "DIV"\r
+                    ) {\r
 \r
-                /* \r
-                    Note: we don't pass the user config in here yet \r
-                    because we only want it executed once, at the lowest \r
-                    subclass level.\r
-                */ \r
-            \r
-                YAHOO.widget.MenuModule.superclass.init.call(this, oElement);\r
+                        return oParentNode;\r
 \r
-                this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+                    }\r
+                    else {\r
 \r
-                /*\r
-                    Populate the collection of item groups and item\r
-                    group titles\r
-                */\r
+                        return p_oElement;\r
 \r
-                var oNode = this.body.firstChild;\r
-                var i = 0;\r
+                    }\r
 \r
-                do {\r
+                break;\r
 \r
-                    switch(oNode.tagName) {\r
+                case "LI":\r
 \r
-                        case this.GROUP_TITLE_TAG_NAME:\r
-                        \r
-                            this._aGroupTitleElements[i] = oNode;\r
+                    return p_oElement;\r
 \r
-                        break;\r
+                default:\r
 \r
-                        case "UL":\r
+                    oParentNode = p_oElement.parentNode;\r
 \r
-                            this._aListElements[i] = oNode;\r
-                            this._aItemGroups[i] = [];\r
-                            i++;\r
+                    if(oParentNode) {\r
 \r
-                        break;\r
+                        return getMenuRootElement(oParentNode);\r
 \r
                     }\r
 \r
-                }\r
-                while((oNode = oNode.nextSibling));\r
-\r
-                /*\r
-                    Apply the "first-of-type" class to the first UL to mimic \r
-                    the "first-of-type" CSS3 psuedo class.\r
-                */\r
-\r
-                if(this._aListElements[0]) {\r
-\r
-                    Dom.addClass(this._aListElements[0], "first-of-type");\r
+                break;\r
 \r
-                }\r
+            }\r
 \r
+        }\r
 \r
-    \r
-            break;\r
-    \r
-            case "SELECT":\r
-    \r
-                this.srcElement = oElement;\r
-    \r
-    \r
-                /*\r
-                    The source element is not something that we can use \r
-                    outright, so we need to create a new Overlay\r
-                */\r
-    \r
-                var sId = Dom.generateId();\r
+    };\r
 \r
-                /* \r
-                    Note: we don't pass the user config in here yet \r
-                    because we only want it executed once, at the lowest \r
-                    subclass level.\r
-                */ \r
-            \r
-                YAHOO.widget.MenuModule.superclass.init.call(this, sId); \r
+    // Private event handlers\r
 \r
-                this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+    /**\r
+    * Generic, global event handler for all of a menu's DOM-based\r
+    * events.  This listens for events against the document object.  If the\r
+    * target of a given event is a member of a menu or menu item's DOM, the\r
+    * instance's corresponding Custom Event is fired.\r
+    * @private\r
+    * @param {Event} p_oEvent Object representing the DOM event object passed\r
+    * back by the event utility (YAHOO.util.Event).\r
+    */\r
+    var onDOMEvent = function(p_oEvent) {\r
 \r
+        // Get the target node of the DOM event\r
 \r
+        var oTarget = Event.getTarget(p_oEvent);\r
 \r
-            break;\r
-    \r
-        }\r
+        // See if the target of the event was a menu, or a menu item\r
 \r
-    }\r
-    else {\r
+        var oElement = getMenuRootElement(oTarget);\r
 \r
-        /* \r
-            Note: we don't pass the user config in here yet \r
-            because we only want it executed once, at the lowest \r
-            subclass level.\r
-        */ \r
-    \r
-        YAHOO.widget.MenuModule.superclass.init.call(this, p_oElement);\r
+        var oMenuItem;\r
+        var oMenu;\r
 \r
-        this.beforeInitEvent.fire(YAHOO.widget.MenuModule);\r
+        if(oElement) {\r
 \r
+            var sTagName = oElement.tagName.toUpperCase();\r
 \r
+            if(sTagName == "LI") {\r
 \r
-    }\r
+                var sYUIId = oElement.getAttribute("yuiid");\r
 \r
-    if(this.element) {\r
+                if(sYUIId) {\r
 \r
-        var oEl = this.element;\r
-        var CustomEvent = YAHOO.util.CustomEvent;\r
+                    oMenuItem = m_oItems[sYUIId];\r
+                    oMenu = oMenuItem.parent;\r
 \r
-        Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
+                }\r
 \r
-        // Assign DOM event handlers\r
+            }\r
+            else if(sTagName == "DIV") {\r
 \r
-        Event.addListener(\r
-                oEl, \r
-                "mouseover", \r
-                this._onElementMouseOver, \r
-                this, \r
-                true\r
-            );\r
+                if(oElement.id) {\r
 \r
-        Event.addListener(oEl, "mouseout", this._onElementMouseOut, this, true);\r
-        Event.addListener(oEl, "mousedown", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "mouseup", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "click", this._onElementClick, this, true);\r
-        Event.addListener(oEl, "keydown", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "keyup", this._onDOMEvent, this, true);\r
-        Event.addListener(oEl, "keypress", this._onDOMEvent, this, true);\r
-\r
-        // Create custom events\r
-\r
-        this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
-        this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
-        this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
-        this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
-        this.clickEvent = new CustomEvent("clickEvent", this);\r
-        this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
-        this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
-        this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
+                    oMenu = m_oMenus[oElement.id];\r
 \r
-        // Subscribe to Custom Events\r
+                }\r
 \r
-        this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
-        this.renderEvent.subscribe(this._onRender, this, true);\r
-        this.showEvent.subscribe(this._onShow, this, true);\r
-        this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
+            }\r
 \r
-        if(p_oConfig) {\r
-    \r
-            this.cfg.applyConfig(p_oConfig, true);\r
-    \r
         }\r
 \r
-        this.cfg.queueProperty("visible", false);\r
-\r
-        if(this.srcElement) {\r
+        if(oMenu) {\r
 \r
-            this._initSubTree();\r
+            // Map of DOM event names to CustomEvent names\r
 \r
-        }\r
+            var oEventTypes =  {\r
+                    "click": "clickEvent",\r
+                    "mousedown": "mouseDownEvent",\r
+                    "mouseup": "mouseUpEvent",\r
+                    "mouseover": "mouseOverEvent",\r
+                    "mouseout": "mouseOutEvent",\r
+                    "keydown": "keyDownEvent",\r
+                    "keyup": "keyUpEvent",\r
+                    "keypress": "keyPressEvent"\r
+                };\r
 \r
-    }\r
+            var sCustomEventType = oEventTypes[p_oEvent.type];\r
 \r
-    this.initEvent.fire(YAHOO.widget.MenuModule);\r
+            // Fire the Custom Even that corresponds the current DOM event\r
 \r
-};\r
+            if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {\r
 \r
-// Private methods\r
+                oMenuItem[sCustomEventType].fire(p_oEvent);\r
 \r
-/**\r
-* Iterates the source element's childNodes collection and uses the child \r
-* nodes to instantiate MenuModule and MenuModuleItem instances.\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._initSubTree = function() {\r
+            }\r
 \r
-    var oNode;\r
+            oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);\r
 \r
+        }\r
+        else if(p_oEvent.type == "mousedown") {\r
 \r
-    switch(this.srcElement.tagName) {\r
+            /*\r
+                If the target of the event wasn't a menu, hide all\r
+                dynamically positioned menus\r
+            */\r
 \r
-        case "DIV":\r
+            var oActiveItem;\r
 \r
-            if(this._aListElements.length > 0) {\r
+            for(var i in m_oMenus) {\r
 \r
+                if(m_oMenus.hasOwnProperty(i)) {\r
 \r
-                var i = this._aListElements.length - 1;\r
+                    oMenu = m_oMenus[i];\r
 \r
-                do {\r
+                    if(\r
+                        oMenu.cfg.getProperty("clicktohide") &&\r
+                        oMenu.cfg.getProperty("position") == "dynamic"\r
+                    ) {\r
 \r
-                    oNode = this._aListElements[i].firstChild;\r
-    \r
+                        oMenu.hide();\r
 \r
-                    do {\r
-    \r
-                        switch(oNode.tagName) {\r
-        \r
-                            case "LI":\r
+                    }\r
+                    else {\r
 \r
+                        oMenu.clearActiveItem(true);\r
 \r
-                                this.addItem(new this.ITEM_TYPE(oNode), i);\r
-        \r
-                            break;\r
-        \r
-                        }\r
-            \r
                     }\r
-                    while((oNode = oNode.nextSibling));\r
-            \r
+\r
                 }\r
-                while(i--);\r
 \r
             }\r
 \r
-        break;\r
+        }\r
 \r
-        case "SELECT":\r
+    };\r
 \r
+    /**\r
+    * "destroy" event handler for a menu.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+    * fired the event.\r
+    */\r
+    var onMenuDestroy = function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-            oNode = this.srcElement.firstChild;\r
+        this.removeMenu(p_oMenu);\r
 \r
-            do {\r
+    };\r
 \r
-                switch(oNode.tagName) {\r
+    /**\r
+    * "destroy" event handler for a MenuItem instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    var onItemDestroy = function(p_sType, p_aArgs, p_oItem) {\r
 \r
-                    case "OPTGROUP":\r
-                    case "OPTION":\r
+        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
 \r
+        if(sYUIId) {\r
 \r
-                        this.addItem(new this.ITEM_TYPE(oNode));\r
+            delete m_oItems[sYUIId];\r
 \r
-                    break;\r
+        }\r
 \r
-                }\r
+    };\r
 \r
-            }\r
-            while((oNode = oNode.nextSibling));\r
+    /**\r
+    * Event handler for when the "visible" configuration property\r
+    * of a Menu instance changes.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+    * fired the event.\r
+    */\r
+    var onMenuVisibleConfigChange = function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-        break;\r
+        var bVisible = p_aArgs[0];\r
 \r
-    }\r
+        if(bVisible) {\r
 \r
-};\r
+            m_oVisibleMenus[p_oMenu.id] = p_oMenu;\r
 \r
-/**\r
-* Returns the first enabled item in a menu instance.\r
-* @return Returns a MenuModuleItem instance.\r
-* @type YAHOO.widget.MenuModuleItem\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._getFirstEnabledItem = function() {\r
 \r
-    var nGroups = this._aItemGroups.length;\r
-    var oItem;\r
-    var aItemGroup;\r
+        }\r
+        else if(m_oVisibleMenus[p_oMenu.id]) {\r
 \r
-    for(var i=0; i<nGroups; i++) {\r
+            delete m_oVisibleMenus[p_oMenu.id];\r
 \r
-        aItemGroup = this._aItemGroups[i];\r
-        \r
-        if(aItemGroup) {\r
 \r
-            var nItems = aItemGroup.length;\r
-            \r
-            for(var n=0; n<nItems; n++) {\r
-            \r
-                oItem = aItemGroup[n];\r
-                \r
-                if(!oItem.cfg.getProperty("disabled")) {\r
-                \r
-                    return oItem;\r
-                \r
-                }\r
-    \r
-                oItem = null;\r
-    \r
-            }\r
-        \r
         }\r
-    \r
-    }\r
-    \r
-};\r
 \r
-/**\r
-* Determines if the value is one of the supported positions.\r
-* @private\r
-* @param {Object} p_sPosition The object to be evaluated.\r
-* @return Returns true if the position is supported.\r
-* @type Boolean\r
-*/\r
-YAHOO.widget.MenuModule.prototype._checkPosition = function(p_sPosition) {\r
+    };\r
 \r
-    if(typeof p_sPosition == "string") {\r
+    /**\r
+    * "itemadded" event handler for a Menu instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    */\r
+    var onItemAdded = function(p_sType, p_aArgs) {\r
 \r
-        var sPosition = p_sPosition.toLowerCase();\r
+        addItem(p_aArgs[0]);\r
 \r
-        return ("dynamic,static".indexOf(sPosition) != -1);\r
+    };\r
 \r
-    }\r
 \r
-};\r
+    /**\r
+    * "itemremoved" event handler for a Menu instance.\r
+    * @private\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    */\r
+    var onItemRemoved = function(p_sType, p_aArgs) {\r
 \r
-/**\r
-* Adds an item to a group.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be added.\r
-* @param {Number} p_nItemIndex Optional. Index at which the item \r
-* should be added.\r
-* @return The item that was added.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype._addItemToGroup = \r
+        removeItem(p_aArgs[0]);\r
 \r
-    function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
+    };\r
 \r
-        var Dom = this._oDom;\r
-        var oItem;\r
+    // Privileged methods\r
 \r
-        if(p_oItem instanceof this.ITEM_TYPE) {\r
+    /**\r
+    * @method addMenu\r
+    * @description Adds a menu to the collection of known menus.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
+    * to be added.\r
+    */\r
+    this.addMenu = function(p_oMenu) {\r
 \r
-            oItem = p_oItem;     \r
+        if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
+\r
+            m_oMenus[p_oMenu.id] = p_oMenu;\r
+\r
+\r
+            if(!m_bInitializedEventHandlers) {\r
+\r
+                var oDoc = document;\r
+\r
+                Event.addListener(oDoc, "mouseover", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mouseout", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mousedown", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "mouseup", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "click", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keydown", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keyup", onDOMEvent, this, true);\r
+                Event.addListener(oDoc, "keypress", onDOMEvent, this, true);\r
+\r
+                m_bInitializedEventHandlers = true;\r
+\r
+\r
+            }\r
+\r
+            p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this);\r
+\r
+            p_oMenu.cfg.subscribeToConfigEvent(\r
+                "visible",\r
+                onMenuVisibleConfigChange,\r
+                p_oMenu\r
+            );\r
+\r
+            p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
+            p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
+\r
+\r
+        }\r
+\r
+    };\r
+\r
+    /**\r
+    * @method removeMenu\r
+    * @description Removes a menu from the collection of known menus.\r
+    * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
+    * to be removed.\r
+    */\r
+    this.removeMenu = function(p_oMenu) {\r
+\r
+        if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
+\r
+            delete m_oMenus[p_oMenu.id];\r
+\r
+\r
+        }\r
+\r
+    };\r
+\r
+    /**\r
+    * @method hideVisible\r
+    * @description Hides all visible, dynamically positioned menus.\r
+    */\r
+    this.hideVisible = function() {\r
+\r
+        var oMenu;\r
+\r
+        for(var i in m_oVisibleMenus) {\r
+\r
+            if(m_oVisibleMenus.hasOwnProperty(i)) {\r
+\r
+                oMenu = m_oVisibleMenus[i];\r
+\r
+                if(oMenu.cfg.getProperty("position") == "dynamic") {\r
+\r
+                    oMenu.hide();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+    };\r
+\r
+    /**\r
+    * @method getMenus\r
+    * @description Returns an array of all menus registered with the\r
+    * menu manger.\r
+    * @return {Array}\r
+    */\r
+    this.getMenus = function() {\r
+\r
+        return m_oMenus;\r
+\r
+    };\r
+\r
+    /**\r
+    * @method getMenu\r
+    * @description Returns a menu with the specified id.\r
+    * @param {String} p_sId String specifying the id of the menu to\r
+    * be retrieved.\r
+    * @return {YAHOO.widget.Menu}\r
+    */\r
+    this.getMenu = function(p_sId) {\r
+\r
+        if(m_oMenus[p_sId]) {\r
+\r
+            return m_oMenus[p_sId];\r
+\r
+        }\r
+\r
+    };\r
+\r
+\r
+    /**\r
+    * @method toString\r
+    * @description Returns a string representing the menu manager.\r
+    * @return {String}\r
+    */\r
+    this.toString = function() {\r
+\r
+        return ("MenuManager");\r
+\r
+    };\r
+\r
+};\r
+\r
+})();\r
+\r
+(function() {\r
+\r
+var Dom = YAHOO.util.Dom;\r
+var Event = YAHOO.util.Event;\r
+\r
+/**\r
+* The Menu class creates a container that holds a vertical list representing\r
+* a set of options or commands.  Menu is the base class for all\r
+* menu containers.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source\r
+* for the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
+* Object specifying the <code>&#60;select&#62;</code> element to be used as\r
+* the data source for the menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu. See configuration class documentation for\r
+* more details.\r
+* @namespace YAHOO.widget\r
+* @class Menu\r
+* @constructor\r
+* @extends YAHOO.widget.Overlay\r
+*/\r
+YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
+\r
+    if(p_oConfig) {\r
+\r
+        this.parent = p_oConfig.parent;\r
+\r
+        this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r
+\r
+        this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r
+\r
+    }\r
+\r
+    YAHOO.widget.Menu.superclass.constructor.call(\r
+        this,\r
+        p_oElement,\r
+        p_oConfig\r
+    );\r
+\r
+};\r
+\r
+YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r
+\r
+// Constants\r
+\r
+/**\r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the\r
+* menu's <code>&#60;div&#62;</code> element.\r
+* @default "yuimenu"\r
+* @final\r
+* @type String\r
+*/\r
+CSS_CLASS_NAME: "yuimenu",\r
+\r
+/**\r
+* @property ITEM_TYPE\r
+* @description Object representing the type of menu item to instantiate and\r
+* add when parsing the child nodes (either <code>&#60;li&#62;</code> element,\r
+* <code>&#60;optgroup&#62;</code> element or <code>&#60;option&#62;</code>)\r
+* of the menu's source HTML element.\r
+* @default YAHOO.widget.MenuItem\r
+* @final\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+ITEM_TYPE: null,\r
+\r
+/**\r
+* @property GROUP_TITLE_TAG_NAME\r
+* @description String representing the tagname of the HTML element used to\r
+* title the menu's item groups.\r
+* @default H6\r
+* @final\r
+* @type String\r
+*/\r
+GROUP_TITLE_TAG_NAME: "h6",\r
+\r
+// Private properties\r
+\r
+/**\r
+* @property _nHideDelayId\r
+* @description Number representing the time-out setting used to cancel the\r
+* hiding of a menu.\r
+* @default null\r
+* @private\r
+* @type Number\r
+*/\r
+_nHideDelayId: null,\r
+\r
+/**\r
+* @property _nShowDelayId\r
+* @description Number representing the time-out setting used to cancel the\r
+* showing of a menu.\r
+* @default null\r
+* @private\r
+* @type Number\r
+*/\r
+_nShowDelayId: null,\r
+\r
+/**\r
+* @property _hideDelayEventHandlersAssigned\r
+* @description Boolean indicating if the "mouseover" and "mouseout" event\r
+* handlers used for hiding the menu via a call to "window.setTimeout" have\r
+* already been assigned.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_hideDelayEventHandlersAssigned: false,\r
+\r
+/**\r
+* @property _bHandledMouseOverEvent\r
+* @description Boolean indicating the current state of the menu's\r
+* "mouseover" event.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_bHandledMouseOverEvent: false,\r
+\r
+/**\r
+* @property _bHandledMouseOutEvent\r
+* @description Boolean indicating the current state of the menu's\r
+* "mouseout" event.\r
+* @default false\r
+* @private\r
+* @type Boolean\r
+*/\r
+_bHandledMouseOutEvent: false,\r
+\r
+/**\r
+* @property _aGroupTitleElements\r
+* @description Array of HTML element used to title groups of menu items.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aGroupTitleElements: null,\r
+\r
+/**\r
+* @property _aItemGroups\r
+* @description Array of menu items.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aItemGroups: null,\r
+\r
+/**\r
+* @property _aListElements\r
+* @description Array of <code>&#60;ul&#62;</code> elements, each of which is\r
+* the parent node for each item's <code>&#60;li&#62;</code> element.\r
+* @default []\r
+* @private\r
+* @type Array\r
+*/\r
+_aListElements: null,\r
+\r
+// Public properties\r
+\r
+/**\r
+* @property lazyLoad\r
+* @description Boolean indicating if the menu's "lazy load" feature is\r
+* enabled.  If set to "true," initialization and rendering of the menu's\r
+* items will be deferred until the first time it is made visible.  This\r
+* property should be set via the constructor using the configuration\r
+* object literal.\r
+* @default false\r
+* @type Boolean\r
+*/\r
+lazyLoad: false,\r
+\r
+/**\r
+* @property itemData\r
+* @description Array of items to be added to the menu.  The array can contain\r
+* strings representing the text for each item to be created, object literals\r
+* representing the menu item configuration properties, or MenuItem instances.\r
+* This property should be set via the constructor using the configuration\r
+* object literal.\r
+* @default null\r
+* @type Array\r
+*/\r
+itemData: null,\r
+\r
+/**\r
+* @property activeItem\r
+* @description Object reference to the item in the menu that has focus.\r
+* @default null\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+activeItem: null,\r
+\r
+/**\r
+* @property parent\r
+* @description Object reference to the menu's parent menu or menu item.\r
+* This property can be set via the constructor using the configuration\r
+* object literal.\r
+* @default null\r
+* @type YAHOO.widget.MenuItem\r
+*/\r
+parent: null,\r
+\r
+/**\r
+* @property srcElement\r
+* @description Object reference to the HTML element (either\r
+* <code>&#60;select&#62;</code> or <code>&#60;div&#62;</code>) used to\r
+* create the menu.\r
+* @default null\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r
+* html#ID-22445964">HTMLDivElement</a>\r
+*/\r
+srcElement: null,\r
+\r
+// Events\r
+\r
+/**\r
+* @event mouseOverEvent\r
+* @description Fires when the mouse has entered the menu.  Passes back\r
+* the DOM Event object as an argument.\r
+*/\r
+mouseOverEvent: null,\r
+\r
+/**\r
+* @event mouseOutEvent\r
+* @description Fires when the mouse has left the menu.  Passes back the DOM\r
+* Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseOutEvent: null,\r
+\r
+/**\r
+* @event mouseDownEvent\r
+* @description Fires when the user mouses down on the menu.  Passes back the\r
+* DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseDownEvent: null,\r
+\r
+/**\r
+* @event mouseUpEvent\r
+* @description Fires when the user releases a mouse button while the mouse is\r
+* over the menu.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+mouseUpEvent: null,\r
+\r
+/**\r
+* @event clickEvent\r
+* @description Fires when the user clicks the on the menu.  Passes back the\r
+* DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+clickEvent: null,\r
+\r
+/**\r
+* @event keyPressEvent\r
+* @description Fires when the user presses an alphanumeric key when one of the\r
+* menu's items has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyPressEvent: null,\r
+\r
+/**\r
+* @event keyDownEvent\r
+* @description Fires when the user presses a key when one of the menu's items\r
+* has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyDownEvent: null,\r
+\r
+/**\r
+* @event keyUpEvent\r
+* @description Fires when the user releases a key when one of the menu's items\r
+* has focus.  Passes back the DOM Event object as an argument.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+keyUpEvent: null,\r
+\r
+/**\r
+* @event itemAddedEvent\r
+* @description Fires when an item is added to the menu.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+itemAddedEvent: null,\r
+\r
+/**\r
+* @event itemRemovedEvent\r
+* @description Fires when an item is removed to the menu.\r
+* @type YAHOO.util.CustomEvent\r
+*/\r
+itemRemovedEvent: null,\r
+\r
+/**\r
+* @method init\r
+* @description The Menu class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references\r
+* for pre-existing markup, and creates required markup if it is not\r
+* already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source\r
+* for the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
+* Object specifying the <code>&#60;select&#62;</code> element to be used as\r
+* the data source for the menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu. See configuration class documentation for\r
+* more details.\r
+*/\r
+init: function(p_oElement, p_oConfig) {\r
+\r
+    this._aItemGroups = [];\r
+    this._aListElements = [];\r
+    this._aGroupTitleElements = [];\r
+\r
+    if(!this.ITEM_TYPE) {\r
+\r
+        this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
+\r
+    }\r
+\r
+    var oElement;\r
+\r
+    if(typeof p_oElement == "string") {\r
+\r
+        oElement = document.getElementById(p_oElement);\r
+\r
+    }\r
+    else if(p_oElement.tagName) {\r
+\r
+        oElement = p_oElement;\r
+\r
+    }\r
+\r
+    if(oElement && oElement.tagName) {\r
+\r
+        switch(oElement.tagName.toUpperCase()) {\r
+\r
+            case "DIV":\r
+\r
+                this.srcElement = oElement;\r
+\r
+                if(!oElement.id) {\r
+\r
+                    oElement.setAttribute("id", Dom.generateId());\r
+\r
+                }\r
+\r
+                /*\r
+                    Note: we don't pass the user config in here yet\r
+                    because we only want it executed once, at the lowest\r
+                    subclass level.\r
+                */\r
+\r
+                YAHOO.widget.Menu.superclass.init.call(this, oElement);\r
+\r
+                this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+\r
+            break;\r
+\r
+            case "SELECT":\r
+\r
+                this.srcElement = oElement;\r
+\r
+\r
+                /*\r
+                    The source element is not something that we can use\r
+                    outright, so we need to create a new Overlay\r
+\r
+                    Note: we don't pass the user config in here yet\r
+                    because we only want it executed once, at the lowest\r
+                    subclass level.\r
+                */\r
+\r
+                YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r
+\r
+                this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+            break;\r
+\r
+        }\r
+\r
+    }\r
+    else {\r
+\r
+        /*\r
+            Note: we don't pass the user config in here yet\r
+            because we only want it executed once, at the lowest\r
+            subclass level.\r
+        */\r
+\r
+        YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
+\r
+        this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+\r
+    }\r
+\r
+    if(this.element) {\r
+\r
+        var oEl = this.element;\r
+\r
+        Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
+\r
+        // Subscribe to Custom Events\r
+\r
+        this.initEvent.subscribe(this._onInit, this, true);\r
+        this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
+        this.renderEvent.subscribe(this._onRender, this, true);\r
+        this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r
+        this.showEvent.subscribe(this._onShow, this, true);\r
+        this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
+        this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
+        this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
+        this.clickEvent.subscribe(this._onClick, this, true);\r
+        this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
+\r
+        if(p_oConfig) {\r
+\r
+            this.cfg.applyConfig(p_oConfig, true);\r
+\r
+        }\r
+\r
+        // Register the Menu instance with the MenuManager\r
+\r
+        YAHOO.widget.MenuManager.addMenu(this);\r
+\r
+\r
+        this.initEvent.fire(YAHOO.widget.Menu);\r
+\r
+    }\r
+\r
+},\r
+\r
+// Private methods\r
+\r
+/**\r
+* @method _initSubTree\r
+* @description Iterates the childNodes of the source element to find nodes\r
+* used to instantiate menu and menu items.\r
+* @private\r
+*/\r
+_initSubTree: function() {\r
+\r
+    var oNode;\r
+\r
+    if(this.srcElement.tagName == "DIV") {\r
+\r
+        /*\r
+            Populate the collection of item groups and item\r
+            group titles\r
+        */\r
+\r
+        oNode = this.body.firstChild;\r
+\r
+        var nGroup = 0;\r
+        var sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r
+\r
+        do {\r
+\r
+            if(oNode && oNode.tagName) {\r
+\r
+                switch(oNode.tagName.toUpperCase()) {\r
+\r
+                    case sGroupTitleTagName:\r
+\r
+                        this._aGroupTitleElements[nGroup] = oNode;\r
+\r
+                    break;\r
+\r
+                    case "UL":\r
+\r
+                        this._aListElements[nGroup] = oNode;\r
+                        this._aItemGroups[nGroup] = [];\r
+                        nGroup++;\r
+\r
+                    break;\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+        while((oNode = oNode.nextSibling));\r
+\r
+        /*\r
+            Apply the "first-of-type" class to the first UL to mimic\r
+            the "first-of-type" CSS3 psuedo class.\r
+        */\r
+\r
+        if(this._aListElements[0]) {\r
+\r
+            Dom.addClass(this._aListElements[0], "first-of-type");\r
+\r
+        }\r
+\r
+    }\r
+\r
+    oNode = null;\r
+\r
+    if(this.srcElement.tagName) {\r
+\r
+        switch(this.srcElement.tagName.toUpperCase()) {\r
+\r
+            case "DIV":\r
+\r
+                if(this._aListElements.length > 0) {\r
+\r
+\r
+                    var i = this._aListElements.length - 1;\r
+\r
+                    do {\r
+\r
+                        oNode = this._aListElements[i].firstChild;\r
+\r
+\r
+                        do {\r
+\r
+                            if(oNode && oNode.tagName) {\r
+\r
+                                switch(oNode.tagName.toUpperCase()) {\r
+\r
+                                    case "LI":\r
+\r
+\r
+                                        this.addItem(\r
+                                                new this.ITEM_TYPE(\r
+                                                    oNode,\r
+                                                    { parent: this }\r
+                                                ),\r
+                                                i\r
+                                            );\r
+\r
+                                    break;\r
+\r
+                                }\r
+\r
+                            }\r
+\r
+                        }\r
+                        while((oNode = oNode.nextSibling));\r
+\r
+                    }\r
+                    while(i--);\r
+\r
+                }\r
+\r
+            break;\r
+\r
+            case "SELECT":\r
+\r
+\r
+                oNode = this.srcElement.firstChild;\r
+\r
+                do {\r
+\r
+                    if(oNode && oNode.tagName) {\r
+\r
+                        switch(oNode.tagName.toUpperCase()) {\r
+\r
+                            case "OPTGROUP":\r
+                            case "OPTION":\r
+\r
+\r
+                                this.addItem(\r
+                                        new this.ITEM_TYPE(\r
+                                                oNode,\r
+                                                { parent: this }\r
+                                            )\r
+                                        );\r
+\r
+                            break;\r
+\r
+                        }\r
+\r
+                    }\r
+\r
+                }\r
+                while((oNode = oNode.nextSibling));\r
+\r
+            break;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _getFirstEnabledItem\r
+* @description Returns the first enabled item in the menu.\r
+* @return {YAHOO.widget.MenuItem}\r
+* @private\r
+*/\r
+_getFirstEnabledItem: function() {\r
+\r
+    var nGroups = this._aItemGroups.length;\r
+    var oItem;\r
+    var aItemGroup;\r
+\r
+    for(var i=0; i<nGroups; i++) {\r
+\r
+        aItemGroup = this._aItemGroups[i];\r
+\r
+        if(aItemGroup) {\r
+\r
+            var nItems = aItemGroup.length;\r
+\r
+            for(var n=0; n<nItems; n++) {\r
+\r
+                oItem = aItemGroup[n];\r
+\r
+                if(\r
+                    !oItem.cfg.getProperty("disabled") &&\r
+                    oItem.element.style.display != "none"\r
+                ) {\r
+\r
+                    return oItem;\r
+\r
+                }\r
+\r
+                oItem = null;\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _checkPosition\r
+* @description Checks to make sure that the value of the "position" property\r
+* is one of the supported strings. Returns true if the position is supported.\r
+* @private\r
+* @param {Object} p_sPosition String specifying the position of the menu.\r
+* @return {Boolean}\r
+*/\r
+_checkPosition: function(p_sPosition) {\r
+\r
+    if(typeof p_sPosition == "string") {\r
+\r
+        var sPosition = p_sPosition.toLowerCase();\r
+\r
+        return ("dynamic,static".indexOf(sPosition) != -1);\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _addItemToGroup\r
+* @description Adds a menu item to a group.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r
+* item belongs.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nItemIndex Optional. Number indicating the index at\r
+* which the menu item should be added.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
+\r
+    var oItem;\r
+\r
+    if(p_oItem instanceof this.ITEM_TYPE) {\r
+\r
+        oItem = p_oItem;\r
+        oItem.parent = this;\r
+\r
+    }\r
+    else if(typeof p_oItem == "string") {\r
+\r
+        oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r
+\r
+    }\r
+    else if(typeof p_oItem == "object" && p_oItem.text) {\r
+\r
+        var sText = p_oItem.text;\r
+\r
+        delete p_oItem["text"];\r
+\r
+        p_oItem.parent = this;\r
+\r
+        oItem = new this.ITEM_TYPE(sText, p_oItem);\r
+\r
+    }\r
+\r
+    if(oItem) {\r
+\r
+        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+\r
+        var aGroup = this._getItemGroup(nGroupIndex);\r
+\r
+        var oGroupItem;\r
+\r
+        if(!aGroup) {\r
+\r
+            aGroup = this._createItemGroup(nGroupIndex);\r
+\r
+        }\r
+\r
+        if(typeof p_nItemIndex == "number") {\r
+\r
+            var bAppend = (p_nItemIndex >= aGroup.length);\r
+\r
+            if(aGroup[p_nItemIndex]) {\r
+\r
+                aGroup.splice(p_nItemIndex, 0, oItem);\r
+\r
+            }\r
+            else {\r
+\r
+                aGroup[p_nItemIndex] = oItem;\r
+\r
+            }\r
+\r
+            oGroupItem = aGroup[p_nItemIndex];\r
+\r
+            if(oGroupItem) {\r
+\r
+                if(\r
+                    bAppend &&\r
+                    (\r
+                        !oGroupItem.element.parentNode ||\r
+                        oGroupItem.element.parentNode.nodeType == 11\r
+                    )\r
+                ) {\r
+\r
+                    this._aListElements[nGroupIndex].appendChild(\r
+                        oGroupItem.element\r
+                    );\r
+\r
+                }\r
+                else {\r
+\r
+\r
+                    /**\r
+                    * Returns the next sibling of an item in an array.\r
+                    * @private\r
+                    * @param {p_aArray} Array to search.\r
+                    * @param {p_nStartIndex} Number indicating the index to\r
+                    * start searching the array.\r
+                    * @return {Object}\r
+                    */\r
+                    var getNextItemSibling =\r
+\r
+                        function(p_aArray, p_nStartIndex) {\r
+\r
+                            return (\r
+                                    p_aArray[p_nStartIndex] ||\r
+                                    getNextItemSibling(\r
+                                        p_aArray,\r
+                                        (p_nStartIndex+1)\r
+                                    )\r
+                                );\r
+\r
+                        };\r
+\r
+\r
+                    var oNextItemSibling =\r
+                            getNextItemSibling(aGroup, (p_nItemIndex+1));\r
+\r
+                    if(\r
+                        oNextItemSibling &&\r
+                        (\r
+                            !oGroupItem.element.parentNode ||\r
+                            oGroupItem.element.parentNode.nodeType == 11\r
+                        )\r
+                    ) {\r
+\r
+                        this._aListElements[nGroupIndex].insertBefore(\r
+                                oGroupItem.element,\r
+                                oNextItemSibling.element\r
+                            );\r
+\r
+                    }\r
+\r
+                }\r
+\r
+\r
+                oGroupItem.parent = this;\r
+\r
+                this._subscribeToItemEvents(oGroupItem);\r
+\r
+                this._configureSubmenu(oGroupItem);\r
+\r
+                this._updateItemProperties(nGroupIndex);\r
+\r
+\r
+                this.itemAddedEvent.fire(oGroupItem);\r
+\r
+                return oGroupItem;\r
+\r
+            }\r
+\r
+        }\r
+        else {\r
+\r
+            var nItemIndex = aGroup.length;\r
+\r
+            aGroup[nItemIndex] = oItem;\r
+\r
+            oGroupItem = aGroup[nItemIndex];\r
+\r
+\r
+            if(oGroupItem) {\r
+\r
+                if(\r
+                    !Dom.isAncestor(\r
+                        this._aListElements[nGroupIndex],\r
+                        oGroupItem.element\r
+                    )\r
+                ) {\r
+\r
+                    this._aListElements[nGroupIndex].appendChild(\r
+                        oGroupItem.element\r
+                    );\r
+\r
+                }\r
+\r
+                oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
+                oGroupItem.element.setAttribute("index", nItemIndex);\r
+\r
+                oGroupItem.parent = this;\r
+\r
+                oGroupItem.index = nItemIndex;\r
+                oGroupItem.groupIndex = nGroupIndex;\r
+\r
+                this._subscribeToItemEvents(oGroupItem);\r
+\r
+                this._configureSubmenu(oGroupItem);\r
+\r
+                if(nItemIndex === 0) {\r
+\r
+                    Dom.addClass(oGroupItem.element, "first-of-type");\r
+\r
+                }\r
+\r
+\r
+\r
+                this.itemAddedEvent.fire(oGroupItem);\r
+\r
+                return oGroupItem;\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _removeItemFromGroupByIndex\r
+* @description Removes a menu item from a group by index.  Returns the menu\r
+* item that was removed.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r
+* item belongs.\r
+* @param {Number} p_nItemIndex Number indicating the index of the menu item\r
+* to be removed.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r
+\r
+    var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+    var aGroup = this._getItemGroup(nGroupIndex);\r
+\r
+    if(aGroup) {\r
+\r
+        var aArray = aGroup.splice(p_nItemIndex, 1);\r
+        var oItem = aArray[0];\r
+\r
+        if(oItem) {\r
+\r
+            // Update the index and className properties of each member\r
+\r
+            this._updateItemProperties(nGroupIndex);\r
+\r
+            if(aGroup.length === 0) {\r
+\r
+                // Remove the UL\r
+\r
+                var oUL = this._aListElements[nGroupIndex];\r
+\r
+                if(this.body && oUL) {\r
+\r
+                    this.body.removeChild(oUL);\r
+\r
+                }\r
+\r
+                // Remove the group from the array of items\r
+\r
+                this._aItemGroups.splice(nGroupIndex, 1);\r
+\r
+\r
+                // Remove the UL from the array of ULs\r
+\r
+                this._aListElements.splice(nGroupIndex, 1);\r
+\r
+\r
+                /*\r
+                     Assign the "first-of-type" class to the new first UL\r
+                     in the collection\r
+                */\r
+\r
+                oUL = this._aListElements[0];\r
+\r
+                if(oUL) {\r
+\r
+                    Dom.addClass(oUL, "first-of-type");\r
+\r
+                }\r
+\r
+            }\r
+\r
+\r
+            this.itemRemovedEvent.fire(oItem);\r
+\r
+            // Return a reference to the item that was removed\r
+\r
+            return oItem;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _removeItemFromGroupByValue\r
+* @description Removes a menu item from a group by reference.  Returns the\r
+* menu item that was removed.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r
+* menu item belongs.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be removed.\r
+* @return {YAHOO.widget.MenuItem}\r
+*/\r
+_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r
+\r
+    var aGroup = this._getItemGroup(p_nGroupIndex);\r
+\r
+    if(aGroup) {\r
+\r
+        var nItems = aGroup.length;\r
+        var nItemIndex = -1;\r
+\r
+        if(nItems > 0) {\r
+\r
+            var i = nItems-1;\r
+\r
+            do {\r
+\r
+                if(aGroup[i] == p_oItem) {\r
+\r
+                    nItemIndex = i;\r
+                    break;\r
+\r
+                }\r
+\r
+            }\r
+            while(i--);\r
+\r
+            if(nItemIndex > -1) {\r
+\r
+                return this._removeItemFromGroupByIndex(\r
+                            p_nGroupIndex,\r
+                            nItemIndex\r
+                        );\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _updateItemProperties\r
+* @description Updates the "index," "groupindex," and "className" properties\r
+* of the menu items in the specified group.\r
+* @private\r
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
+*/\r
+_updateItemProperties: function(p_nGroupIndex) {\r
+\r
+    var aGroup = this._getItemGroup(p_nGroupIndex);\r
+    var nItems = aGroup.length;\r
+\r
+    if(nItems > 0) {\r
+\r
+        var i = nItems - 1;\r
+        var oItem;\r
+        var oLI;\r
+\r
+        // Update the index and className properties of each member\r
+\r
+        do {\r
+\r
+            oItem = aGroup[i];\r
+\r
+            if(oItem) {\r
+\r
+                oLI = oItem.element;\r
+\r
+                oItem.index = i;\r
+                oItem.groupIndex = p_nGroupIndex;\r
+\r
+                oLI.setAttribute("groupindex", p_nGroupIndex);\r
+                oLI.setAttribute("index", i);\r
+\r
+                Dom.removeClass(oLI, "first-of-type");\r
+\r
+            }\r
+\r
+        }\r
+        while(i--);\r
+\r
+        if(oLI) {\r
+\r
+            Dom.addClass(oLI, "first-of-type");\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _createItemGroup\r
+* @description Creates a new menu item group (array) and its associated\r
+* <code>&#60;ul&#62;</code> element. Returns an aray of menu item groups.\r
+* @private\r
+* @param {Number} p_nIndex Number indicating the group to create.\r
+* @return {Array}\r
+*/\r
+_createItemGroup: function(p_nIndex) {\r
+\r
+    if(!this._aItemGroups[p_nIndex]) {\r
+\r
+        this._aItemGroups[p_nIndex] = [];\r
+\r
+        var oUL = document.createElement("ul");\r
+\r
+        this._aListElements[p_nIndex] = oUL;\r
+\r
+        return this._aItemGroups[p_nIndex];\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _getItemGroup\r
+* @description Returns the menu item group at the specified index.\r
+* @private\r
+* @param {Number} p_nIndex Number indicating the index of the menu item group\r
+* to be retrieved.\r
+* @return {Array}\r
+*/\r
+_getItemGroup: function(p_nIndex) {\r
+\r
+    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
+\r
+    return this._aItemGroups[nIndex];\r
+\r
+},\r
+\r
+/**\r
+* @method _configureSubmenu\r
+* @description Subscribes the menu item's submenu to its parent menu's events.\r
+* @private\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance with the submenu to be configured.\r
+*/\r
+_configureSubmenu: function(p_oItem) {\r
+\r
+    var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
+\r
+    if(oSubmenu) {\r
+\r
+        /*\r
+            Listen for configuration changes to the parent menu\r
+            so they they can be applied to the submenu.\r
+        */\r
+\r
+        this.cfg.configChangedEvent.subscribe(\r
+                this._onParentMenuConfigChange,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        this.renderEvent.subscribe(\r
+                this._onParentMenuRender,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.beforeShowEvent.subscribe(\r
+                this._onSubmenuBeforeShow,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.showEvent.subscribe(\r
+                this._onSubmenuShow,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+        oSubmenu.hideEvent.subscribe(\r
+                this._onSubmenuHide,\r
+                oSubmenu,\r
+                true\r
+            );\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _subscribeToItemEvents\r
+* @description Subscribes a menu to a menu item's event.\r
+* @private\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance whose events should be subscribed to.\r
+*/\r
+_subscribeToItemEvents: function(p_oItem) {\r
+\r
+    p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r
+\r
+    p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r
+\r
+    p_oItem.cfg.configChangedEvent.subscribe(\r
+        this._onMenuItemConfigChange,\r
+        p_oItem,\r
+        this\r
+    );\r
+\r
+},\r
+\r
+/**\r
+* @method _getOffsetWidth\r
+* @description Returns the offset width of the menu's\r
+* <code>&#60;div&#62;</code> element.\r
+* @private\r
+*/\r
+_getOffsetWidth: function() {\r
+\r
+    var oClone = this.element.cloneNode(true);\r
+\r
+    Dom.setStyle(oClone, "width", "");\r
+\r
+    document.body.appendChild(oClone);\r
+\r
+    var sWidth = oClone.offsetWidth;\r
+\r
+    document.body.removeChild(oClone);\r
+\r
+    return sWidth;\r
+\r
+},\r
+\r
+/**\r
+* @method _cancelHideDelay\r
+* @description Cancels the call to "hideMenu."\r
+* @private\r
+*/\r
+_cancelHideDelay: function() {\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    if(oRoot._nHideDelayId) {\r
+\r
+        window.clearTimeout(oRoot._nHideDelayId);\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _execHideDelay\r
+* @description Hides the menu after the number of milliseconds specified by\r
+* the "hidedelay" configuration property.\r
+* @private\r
+*/\r
+_execHideDelay: function() {\r
+\r
+    this._cancelHideDelay();\r
+\r
+    var oRoot = this.getRoot();\r
+    var me = this;\r
+\r
+    var hideMenu = function() {\r
+\r
+        if(oRoot.activeItem) {\r
+\r
+            oRoot.clearActiveItem();\r
+\r
+        }\r
+\r
+        if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r
+\r
+            me.hide();\r
+\r
+        }\r
+\r
+    };\r
+\r
+    oRoot._nHideDelayId =\r
+        window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r
+\r
+},\r
+\r
+/**\r
+* @method _cancelShowDelay\r
+* @description Cancels the call to the "showMenu."\r
+* @private\r
+*/\r
+_cancelShowDelay: function() {\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    if(oRoot._nShowDelayId) {\r
+\r
+        window.clearTimeout(oRoot._nShowDelayId);\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _execShowDelay\r
+* @description Shows the menu after the number of milliseconds specified by\r
+* the "showdelay" configuration property have ellapsed.\r
+* @private\r
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r
+* be made visible.\r
+*/\r
+_execShowDelay: function(p_oMenu) {\r
+\r
+    this._cancelShowDelay();\r
+\r
+    var oRoot = this.getRoot();\r
+\r
+    var showMenu = function() {\r
+\r
+        p_oMenu.show();\r
+\r
+    };\r
+\r
+    oRoot._nShowDelayId =\r
+        window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r
+\r
+},\r
+\r
+// Protected methods\r
+\r
+/**\r
+* @method _onMouseOver\r
+* @description "mouseover" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oTarget = Event.getTarget(oEvent);\r
+\r
+    if(\r
+        !this._bHandledMouseOverEvent &&\r
+        (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
+    ) {\r
+\r
+        // MENU  MOUSEOVER LOGIC HERE\r
+\r
+        this.clearActiveItem();\r
+\r
+        this._bHandledMouseOverEvent = true;\r
+        this._bHandledMouseOutEvent = false;\r
+\r
+    }\r
+\r
+    if(\r
+        oItem && !oItem.handledMouseOverEvent &&\r
+        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
+    ) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+\r
+        // Select and focus the current menu item\r
+\r
+        oItemCfg.setProperty("selected", true);\r
+        oItem.focus();\r
+\r
+        if(this.cfg.getProperty("autosubmenudisplay")) {\r
+\r
+            // Show the submenu this menu item\r
+\r
+            var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+            if(oSubmenu) {\r
+\r
+                if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+                    this._execShowDelay(oSubmenu);\r
+\r
+                }\r
+                else {\r
+\r
+                    oSubmenu.show();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+        oItem.handledMouseOverEvent = true;\r
+        oItem.handledMouseOutEvent = false;\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onMouseOut\r
+* @description "mouseout" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oRelatedTarget = Event.getRelatedTarget(oEvent);\r
+    var bMovingToSubmenu = false;\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+        if(\r
+            oSubmenu &&\r
+            (\r
+                oRelatedTarget == oSubmenu.element ||\r
+                Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
+            )\r
+        ) {\r
+\r
+            bMovingToSubmenu = true;\r
+\r
+        }\r
+\r
+        if(\r
+            !oItem.handledMouseOutEvent &&\r
+            (\r
+                (\r
+                    oRelatedTarget != oItem.element &&\r
+                    !Dom.isAncestor(oItem.element, oRelatedTarget)\r
+                ) || bMovingToSubmenu\r
+            )\r
+        ) {\r
+\r
+            if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+                this._cancelShowDelay();\r
+\r
+            }\r
+\r
+            if(!bMovingToSubmenu) {\r
+\r
+                oItemCfg.setProperty("selected", false);\r
+\r
+            }\r
+\r
+            if(this.cfg.getProperty("autosubmenudisplay")) {\r
+\r
+                if(oSubmenu) {\r
+\r
+                    if(\r
+                        !(\r
+                            oRelatedTarget == oSubmenu.element ||\r
+                            YAHOO.util.Dom.isAncestor(\r
+                                oSubmenu.element,\r
+                                oRelatedTarget\r
+                            )\r
+                        )\r
+                    ) {\r
+\r
+                        oSubmenu.hide();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+            }\r
+\r
+            oItem.handledMouseOutEvent = true;\r
+            oItem.handledMouseOverEvent = false;\r
+\r
+        }\r
+\r
+    }\r
+\r
+    if(\r
+        !this._bHandledMouseOutEvent &&\r
+        (\r
+            (\r
+                oRelatedTarget != this.element &&\r
+                !Dom.isAncestor(this.element, oRelatedTarget)\r
+            )\r
+            || bMovingToSubmenu\r
+        )\r
+    ) {\r
+\r
+        this._bHandledMouseOutEvent = true;\r
+        this._bHandledMouseOverEvent = false;\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onClick\r
+* @description "click" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onClick: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oTarget = Event.getTarget(oEvent);\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+        /*\r
+            ACCESSIBILITY FEATURE FOR SCREEN READERS:\r
+            Expand/collapse the submenu when the user clicks\r
+            on the submenu indicator image.\r
+        */\r
+\r
+        if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
+\r
+            if(oSubmenu.cfg.getProperty("visible")) {\r
+\r
+                oSubmenu.hide();\r
+\r
+            }\r
+            else {\r
+\r
+                this.clearActiveItem();\r
+\r
+                this.activeItem = oItem;\r
+\r
+                oItem.cfg.setProperty("selected", true);\r
+\r
+                oSubmenu.show();\r
+\r
+            }\r
+\r
+        }\r
+        else {\r
+\r
+            var sURL = oItemCfg.getProperty("url");\r
+            var bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
+            var sTarget = oItemCfg.getProperty("target");\r
+            var bHasTarget = (sTarget && sTarget.length > 0);\r
+\r
+            /*\r
+                Prevent the browser from following links\r
+                equal to "#"\r
+            */\r
+\r
+            if(\r
+                oTarget.tagName.toUpperCase() == "A" &&\r
+                bCurrentPageURL && !bHasTarget\r
+            ) {\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            }\r
+\r
+            if(\r
+                oTarget.tagName.toUpperCase() != "A" &&\r
+                !bCurrentPageURL && !bHasTarget\r
+            ) {\r
+\r
+                /*\r
+                    Follow the URL of the item regardless of\r
+                    whether or not the user clicked specifically\r
+                    on the anchor element.\r
+                */\r
+\r
+                document.location = sURL;\r
+\r
+            }\r
+\r
+            /*\r
+                If the item doesn't navigate to a URL and it doesn't have\r
+                a submenu, then collapse the menu tree.\r
+            */\r
+\r
+            if(bCurrentPageURL && !oSubmenu) {\r
+\r
+                var oRoot = this.getRoot();\r
+\r
+                if(oRoot.cfg.getProperty("position") == "static") {\r
+\r
+                    oRoot.clearActiveItem();\r
+\r
+                }\r
+                else {\r
+\r
+                    oRoot.hide();\r
+\r
+                }\r
+\r
+            }\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onKeyDown\r
+* @description "keydown" event handler for the menu.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oSubmenu;\r
+\r
+    if(oItem) {\r
+\r
+        var oItemCfg = oItem.cfg;\r
+        var oParentItem = this.parent;\r
+        var oRoot;\r
+        var oNextItem;\r
+\r
+        switch(oEvent.keyCode) {\r
+\r
+            case 38:    // Up arrow\r
+            case 40:    // Down arrow\r
+\r
+                if(\r
+                    oItem == this.activeItem &&\r
+                    !oItemCfg.getProperty("selected")\r
+                ) {\r
+\r
+                    oItemCfg.setProperty("selected", true);\r
+\r
+                }\r
+                else {\r
+\r
+                    oNextItem = (oEvent.keyCode == 38) ?\r
+                        oItem.getPreviousEnabledSibling() :\r
+                        oItem.getNextEnabledSibling();\r
+\r
+                    if(oNextItem) {\r
+\r
+                        this.clearActiveItem();\r
+\r
+                        oNextItem.cfg.setProperty("selected", true);\r
+                        oNextItem.focus();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+\r
+            case 39:    // Right arrow\r
+\r
+                oSubmenu = oItemCfg.getProperty("submenu");\r
+\r
+                if(oSubmenu) {\r
+\r
+                    if(!oItemCfg.getProperty("selected")) {\r
+\r
+                        oItemCfg.setProperty("selected", true);\r
+\r
+                    }\r
+\r
+                    oSubmenu.show();\r
+\r
+                    oSubmenu.setInitialSelection();\r
+\r
+                }\r
+                else {\r
+\r
+                    oRoot = this.getRoot();\r
+\r
+                    if(oRoot instanceof YAHOO.widget.MenuBar) {\r
+\r
+                        oNextItem = oRoot.activeItem.getNextEnabledSibling();\r
+\r
+                        if(oNextItem) {\r
+\r
+                            oRoot.clearActiveItem();\r
+\r
+                            oNextItem.cfg.setProperty("selected", true);\r
+\r
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+\r
+                            if(oSubmenu) {\r
+\r
+                                oSubmenu.show();\r
+\r
+                            }\r
+\r
+                            oNextItem.focus();\r
+\r
+                        }\r
+\r
+                    }\r
+\r
+                }\r
+\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+\r
+            case 37:    // Left arrow\r
+\r
+                if(oParentItem) {\r
+\r
+                    var oParentMenu = oParentItem.parent;\r
+\r
+                    if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r
+\r
+                        oNextItem =\r
+                            oParentMenu.activeItem.getPreviousEnabledSibling();\r
+\r
+                        if(oNextItem) {\r
+\r
+                            oParentMenu.clearActiveItem();\r
+\r
+                            oNextItem.cfg.setProperty("selected", true);\r
+\r
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+\r
+                            if(oSubmenu) {\r
+\r
+                                oSubmenu.show();\r
+\r
+                            }\r
+\r
+                            oNextItem.focus();\r
+\r
+                        }\r
+\r
+                    }\r
+                    else {\r
+\r
+                        this.hide();\r
+\r
+                        oParentItem.focus();\r
+\r
+                    }\r
+\r
+                }\r
+\r
+                Event.preventDefault(oEvent);\r
+\r
+            break;\r
+\r
+        }\r
+\r
+    }\r
+\r
+    if(oEvent.keyCode == 27) { // Esc key\r
+\r
+        if(this.cfg.getProperty("position") == "dynamic") {\r
+\r
+            this.hide();\r
+\r
+            if(this.parent) {\r
+\r
+                this.parent.focus();\r
+\r
+            }\r
+\r
+        }\r
+        else if(this.activeItem) {\r
+\r
+            oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
+\r
+            if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
+\r
+                oSubmenu.hide();\r
+                this.activeItem.focus();\r
+\r
+            }\r
+            else {\r
+\r
+                this.activeItem.cfg.setProperty("selected", false);\r
+                this.activeItem.blur();\r
+\r
+            }\r
+\r
+        }\r
+\r
+        Event.preventDefault(oEvent);\r
+\r
+    }\r
+\r
+},\r
+\r
+// Private methods\r
+\r
+/**\r
+* @method _onInit\r
+* @description "init" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onInit: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(\r
+        (\r
+            (this.parent && !this.lazyLoad) ||\r
+            (!this.parent && this.cfg.getProperty("position") == "static") ||\r
+            (\r
+                !this.parent &&\r
+                !this.lazyLoad &&\r
+                this.cfg.getProperty("position") == "dynamic"\r
+            )\r
+        ) &&\r
+        this.getItemGroups().length === 0\r
+    ) {\r
+\r
+        if(this.srcElement) {\r
+\r
+            this._initSubTree();\r
+\r
+        }\r
+\r
+        if(this.itemData) {\r
+\r
+            this.addItems(this.itemData);\r
+\r
+        }\r
+\r
+    }\r
+    else if(this.lazyLoad) {\r
+\r
+        this.cfg.fireQueue();\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onBeforeRender\r
+* @description "beforerender" event handler for the menu.  Appends all of the\r
+* <code>&#60;ul&#62;</code>, <code>&#60;li&#62;</code> and their accompanying\r
+* title elements to the body element of the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var oConfig = this.cfg;\r
+    var oEl = this.element;\r
+    var nListElements = this._aListElements.length;\r
+\r
+    if(nListElements > 0) {\r
+\r
+        var i = 0;\r
+        var bFirstList = true;\r
+        var oUL;\r
+        var oGroupTitle;\r
+\r
+        do {\r
+\r
+            oUL = this._aListElements[i];\r
+\r
+            if(oUL) {\r
+\r
+                if(bFirstList) {\r
+\r
+                    Dom.addClass(oUL, "first-of-type");\r
+                    bFirstList = false;\r
+\r
+                }\r
+\r
+                if(!Dom.isAncestor(oEl, oUL)) {\r
+\r
+                    this.appendToBody(oUL);\r
+\r
+                }\r
+\r
+                oGroupTitle = this._aGroupTitleElements[i];\r
+\r
+                if(oGroupTitle) {\r
+\r
+                    if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
+\r
+                        oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
+\r
+                    }\r
+\r
+                    Dom.addClass(oUL, "hastitle");\r
+\r
+                }\r
+\r
+            }\r
+\r
+            i++;\r
 \r
         }\r
-        else if(typeof p_oItem == "string") {\r
+        while(i < nListElements);\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onRender\r
+* @description "render" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onRender: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
+\r
+        var sWidth =\r
+            this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r
+            this.element.offsetWidth : this._getOffsetWidth();\r
+\r
+        this.cfg.setProperty("width", (sWidth + "px"));\r
+\r
+    }\r
+\r
+},\r
+\r
+/**\r
+* @method _onBeforeShow\r
+* @description "beforeshow" event handler for the menu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
+*/\r
+_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    if(this.lazyLoad && this.getItemGroups().length === 0) {\r
+\r
+        if(this.srcElement) {\r
+\r
+            this._initSubTree();\r
 \r
-            oItem = new this.ITEM_TYPE(p_oItem);\r
-        \r
         }\r
 \r
-        if(oItem) {\r
-        \r
-            var nGroupIndex = typeof p_nGroupIndex == "number" ? \r
-                    p_nGroupIndex : 0;\r
-            \r
-            var aGroup = this._getItemGroup(nGroupIndex);\r
-            \r
-            var oGroupItem;\r
-    \r
-\r
-            if(!aGroup) {\r
-    \r
-                aGroup = this._createItemGroup(nGroupIndex);\r
-    \r
-            }\r
+        if(this.itemData) {\r
+\r
+            if(\r
+                this.parent && this.parent.parent &&\r
+                this.parent.parent.srcElement &&\r
+                this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
+            ) {\r
 \r
-            if(typeof p_nItemIndex == "number") {\r
-    \r
-                var bAppend = (p_nItemIndex >= aGroup.length);            \r
-    \r
+                var nOptions = this.itemData.length;\r
+\r
+                for(var n=0; n<nOptions; n++) {\r
+\r
+                    if(this.itemData[n].tagName) {\r
+\r
+                        this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r
 \r
-                if(aGroup[p_nItemIndex]) {\r
-        \r
-                    aGroup.splice(p_nItemIndex, 0, oItem);\r
-        \r
-                }\r
-                else {\r
-        \r
-                    aGroup[p_nItemIndex] = oItem;\r
-        \r
-                }\r
-    \r
-    \r
-                oGroupItem = aGroup[p_nItemIndex];\r
-    \r
-                if(oGroupItem) {\r
-    \r
-                    if(bAppend && !oGroupItem.element.parentNode) {\r
-            \r
-                        this._aListElements[nGroupIndex].appendChild(\r
-                            oGroupItem.element\r
-                        );\r
-        \r
-                    }\r
-                    else {\r
-      \r
-        \r
-                        /**\r
-                        * Returns the next sibling of an item in an array \r
-                        * @param {p_aArray} An array\r
-                        * @param {p_nStartIndex} The index to start searching\r
-                        * the array \r
-                        * @ignore\r
-                        * @return Returns an item in an array\r
-                        * @type Object \r
-                        */\r
-                        function getNextItemSibling(p_aArray, p_nStartIndex) {\r
-                \r
-                            return (\r
-                                    p_aArray[p_nStartIndex] || \r
-                                    getNextItemSibling(\r
-                                        p_aArray, \r
-                                        (p_nStartIndex+1)\r
-                                    )\r
-                                );\r
-                \r
-                        }\r
-        \r
-        \r
-                        var oNextItemSibling = \r
-                                getNextItemSibling(aGroup, (p_nItemIndex+1));\r
-        \r
-                        if(oNextItemSibling && !oGroupItem.element.parentNode) {\r
-                \r
-                            this._aListElements[nGroupIndex].insertBefore(\r
-                                    oGroupItem.element, \r
-                                    oNextItemSibling.element\r
-                                );\r
-            \r
-                        }\r
-        \r
                     }\r
-        \r
-    \r
-                    oGroupItem.parent = this;\r
-            \r
-                    this._subscribeToItemEvents(oGroupItem);\r
-        \r
-                    this._configureItemSubmenuModule(oGroupItem);\r
-                    \r
-                    this._updateItemProperties(nGroupIndex);\r
-            \r
-\r
-                    return oGroupItem;\r
-        \r
+\r
                 }\r
-    \r
+\r
             }\r
             else {\r
-        \r
-                var nItemIndex = aGroup.length;\r
-        \r
-                aGroup[nItemIndex] = oItem;\r
-        \r
-        \r
-                oGroupItem = aGroup[nItemIndex];\r
-        \r
-                if(oGroupItem) {\r
-        \r
-                    if(\r
-                        !Dom.isAncestor(\r
-                            this._aListElements[nGroupIndex], \r
-                            oGroupItem.element\r
-                        )\r
-                    ) {\r
-        \r
-                        this._aListElements[nGroupIndex].appendChild(\r
-                            oGroupItem.element\r
-                        );\r
-        \r
-                    }\r
-        \r
-                    oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
-                    oGroupItem.element.setAttribute("index", nItemIndex);\r
-            \r
-                    oGroupItem.parent = this;\r
-        \r
-                    oGroupItem.index = nItemIndex;\r
-                    oGroupItem.groupIndex = nGroupIndex;\r
-            \r
-                    this._subscribeToItemEvents(oGroupItem);\r
-        \r
-                    this._configureItemSubmenuModule(oGroupItem);\r
-        \r
-                    if(nItemIndex === 0) {\r
-            \r
-                        Dom.addClass(oGroupItem.element, "first-of-type");\r
-            \r
-                    }\r
 \r
-            \r
-                    return oGroupItem;\r
-        \r
-                }\r
-        \r
+                this.addItems(this.itemData);\r
+\r
+            }\r
+\r
+        }\r
+\r
+        if(this.srcElement) {\r
+\r
+            this.render();\r
+\r
+        }\r
+        else {\r
+\r
+            if(this.parent) {\r
+\r
+                this.render(this.parent.element);\r
+\r
+            }\r
+            else {\r
+\r
+                this.render(this.cfg.getProperty("container"));\r
+\r
             }\r
 \r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Removes an item from a group by index.\r
+* @method _onShow\r
+* @description "show" event handler for the menu.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {Number} p_nItemIndex Number indicating the index of the item to  \r
-* be removed.\r
-* @return The item that was removed.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/    \r
-YAHOO.widget.MenuModule.prototype._removeItemFromGroupByIndex = \r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
+* the event.\r
+*/\r
+_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_nGroupIndex, p_nItemIndex) {\r
+    this.setInitialFocus();\r
+\r
+    var oParent = this.parent;\r
+\r
+    if(oParent) {\r
+\r
+        var oParentMenu = oParent.parent;\r
+\r
+        var aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");\r
+        var aAlignment = this.cfg.getProperty("submenualignment");\r
+\r
+        if(\r
+            (aParentAlignment[0] != aAlignment[0]) &&\r
+            (aParentAlignment[1] != aAlignment[1])\r
+        ) {\r
+\r
+            this.cfg.setProperty(\r
+                "submenualignment",\r
+                [ aParentAlignment[0], aParentAlignment[1] ]\r
+            );\r
+\r
+        }\r
+\r
+        if(\r
+            !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r
+            oParentMenu.cfg.getProperty("position") == "static"\r
+        ) {\r
+\r
+            oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
+\r
+            /**\r
+            * "click" event handler for the document\r
+            * @private\r
+            * @param {Event} p_oEvent Object reference for the DOM event object\r
+            * passed back by the event utility (YAHOO.util.Event).\r
+            */\r
+            var disableAutoSubmenuDisplay = function(p_oEvent) {\r
+\r
+                if(\r
+                    p_oEvent.type == "mousedown" ||\r
+                    (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r
+                ) {\r
 \r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-        var aGroup = this._getItemGroup(nGroupIndex);\r
-    \r
-        if(aGroup) {\r
-    \r
-            var aArray = aGroup.splice(p_nItemIndex, 1);\r
-            var oItem = aArray[0];\r
-        \r
-            if(oItem) {\r
-        \r
-                // Update the index and className properties of each member        \r
-                \r
-                this._updateItemProperties(nGroupIndex);\r
-        \r
-                if(aGroup.length === 0) {\r
-        \r
-                    // Remove the UL\r
-        \r
-                    var oUL = this._aListElements[nGroupIndex];\r
-        \r
-                    if(this.body && oUL) {\r
-        \r
-                        this.body.removeChild(oUL);\r
-        \r
-                    }\r
-        \r
-                    // Remove the group from the array of items\r
-        \r
-                    this._aItemGroups.splice(nGroupIndex, 1);\r
-        \r
-        \r
-                    // Remove the UL from the array of ULs\r
-        \r
-                    this._aListElements.splice(nGroupIndex, 1);\r
-        \r
-        \r
                     /*\r
-                         Assign the "first-of-type" class to the new first UL \r
-                         in the collection\r
+                        Set the "autosubmenudisplay" to "false" if the user\r
+                        clicks outside the menu bar.\r
                     */\r
-        \r
-                    oUL = this._aListElements[0];\r
-        \r
-                    if(oUL) {\r
-        \r
-                        this._oDom.addClass(oUL, "first-of-type");\r
-        \r
-                    }            \r
-        \r
+\r
+                    var oTarget = Event.getTarget(p_oEvent);\r
+\r
+                    if(\r
+                        oTarget != oParentMenu.element ||\r
+                        !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r
+                    ) {\r
+\r
+                        oParentMenu.cfg.setProperty(\r
+                            "autosubmenudisplay",\r
+                            false\r
+                        );\r
+\r
+                        Event.removeListener(\r
+                                document,\r
+                                "mousedown",\r
+                                disableAutoSubmenuDisplay\r
+                            );\r
+\r
+                        Event.removeListener(\r
+                                document,\r
+                                "keydown",\r
+                                disableAutoSubmenuDisplay\r
+                            );\r
+\r
+                    }\r
+\r
                 }\r
-        \r
-        \r
-                // Return a reference to the item that was removed\r
-            \r
-                return oItem;\r
-        \r
-            }\r
-    \r
+\r
+            };\r
+\r
+            Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r
+            Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
+\r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Removes a item from a group by reference.\r
+* @method _onBeforeHide\r
+* @description "beforehide" event handler for the menu.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which\r
-* the item belongs.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be removed.\r
-* @return The item that was removed.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/    \r
-YAHOO.widget.MenuModule.prototype._removeItemFromGroupByValue =\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
+* the event.\r
+*/\r
+_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_nGroupIndex, p_oItem) {\r
+    this.clearActiveItem(true);\r
 \r
-        var aGroup = this._getItemGroup(p_nGroupIndex);\r
+},\r
 \r
-        if(aGroup) {\r
+/**\r
+* @method _onParentMenuConfigChange\r
+* @description "configchange" event handler for a submenu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r
 \r
-            var nItems = aGroup.length;\r
-            var nItemIndex = -1;\r
-        \r
-            if(nItems > 0) {\r
-        \r
-                var i = nItems-1;\r
-            \r
-                do {\r
-            \r
-                    if(aGroup[i] == p_oItem) {\r
-            \r
-                        nItemIndex = i;\r
-                        break;    \r
-            \r
-                    }\r
-            \r
-                }\r
-                while(i--);\r
-            \r
-                if(nItemIndex > -1) {\r
-            \r
-                    return this._removeItemFromGroupByIndex(\r
-                                p_nGroupIndex, \r
-                                nItemIndex\r
-                            );\r
-            \r
-                }\r
-        \r
-            }\r
-        \r
-        }\r
-    \r
-    };\r
+    var sPropertyName = p_aArgs[0][0];\r
+    var oPropertyValue = p_aArgs[0][1];\r
+\r
+    switch(sPropertyName) {\r
+\r
+        case "iframe":\r
+        case "constraintoviewport":\r
+        case "hidedelay":\r
+        case "showdelay":\r
+        case "clicktohide":\r
+        case "effect":\r
+\r
+            p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
+\r
+        break;\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Updates the index, groupindex, and className properties of the items\r
-* in the specified group. \r
+* @method _onParentMenuRender\r
+* @description "render" event handler for a submenu.  Renders a\r
+* submenu in response to the firing of its parent's "render" event.\r
 * @private\r
-* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._updateItemProperties = \r
+_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
 \r
-    function(p_nGroupIndex) {\r
+    /*\r
+        Set the "constraintoviewport" configuration\r
+        property to match the parent Menu\r
+    */\r
+\r
+    var oParentMenu = p_oSubmenu.parent.parent;\r
+\r
+    var oConfig = {\r
+\r
+            constraintoviewport:\r
+                oParentMenu.cfg.getProperty("constraintoviewport"),\r
+\r
+            xy: [0,0],\r
+\r
+            clicktohide:\r
+                oParentMenu.cfg.getProperty("clicktohide"),\r
+\r
+            effect:\r
+                oParentMenu.cfg.getProperty("effect")\r
+\r
+        };\r
+\r
+    var nShowDelay = oParentMenu.cfg.getProperty("showdelay");\r
+\r
+    if(nShowDelay > 0) {\r
+\r
+        oConfig.showdelay = nShowDelay;\r
+\r
+    }\r
+\r
+    var nHideDelay = oParentMenu.cfg.getProperty("hidedelay");\r
+\r
+    if(nHideDelay > 0) {\r
+\r
+        oConfig.hidedelay = nHideDelay;\r
+\r
+    }\r
+\r
+    /*\r
+        Only sync the "iframe" configuration property if the parent\r
+        menu's "position" configuration is the same.\r
+    */\r
+\r
+    if(\r
+        this.cfg.getProperty("position") ==\r
+        oParentMenu.cfg.getProperty("position")\r
+    ) {\r
+\r
+        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r
+\r
+    }\r
+\r
+\r
+    p_oSubmenu.cfg.applyConfig(oConfig);\r
+\r
+    if(!this.lazyLoad) {\r
+\r
+        if(Dom.inDocument(this.element)) {\r
+\r
+            this.render();\r
 \r
-        var aGroup = this._getItemGroup(p_nGroupIndex);\r
-        var nItems = aGroup.length;\r
-    \r
-        if(nItems > 0) {\r
-    \r
-            var Dom = this._oDom;\r
-            var i = nItems - 1;\r
-            var oItem;\r
-            var oLI;\r
-    \r
-            // Update the index and className properties of each member        \r
-        \r
-            do {\r
-    \r
-                oItem = aGroup[i];\r
-    \r
-                if(oItem) {\r
-        \r
-                    oLI = oItem.element;\r
-    \r
-                    oItem.index = i;\r
-                    oItem.groupIndex = p_nGroupIndex;\r
-    \r
-                    oLI.setAttribute("groupindex", p_nGroupIndex);\r
-                    oLI.setAttribute("index", i);\r
-    \r
-                    Dom.removeClass(oLI, "first-of-type");\r
-    \r
-                }\r
-        \r
-            }\r
-            while(i--);\r
-    \r
-    \r
-            if(oLI) {\r
-    \r
-                Dom.addClass(oLI, "first-of-type");\r
-    \r
-            }\r
-    \r
         }\r
-    \r
-    };\r
+        else {\r
+\r
+            this.render(this.parent.element);\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Creates a new item group (array) and it's associated HTMLUlElement node \r
+* @method _onSubmenuBeforeShow\r
+* @description "beforeshow" event handler for a submenu.\r
 * @private\r
-* @param {Number} p_nIndex Number indicating the group to create.\r
-* @return An item group.\r
-* @type Array\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
+\r
+    var oParent = this.parent;\r
+    var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
+\r
+    this.cfg.setProperty(\r
+        "context",\r
+        [oParent.element, aAlignment[0], aAlignment[1]]\r
+    );\r
+\r
+    oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+},\r
+\r
+/**\r
+* @method _onSubmenuShow\r
+* @description "show" event handler for a submenu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
+\r
+    var oParent = this.parent;\r
+\r
+    oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+},\r
+\r
+/**\r
+* @method _onSubmenuHide\r
+* @description "hide" Custom Event handler for a submenu.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
+* subscribed to the event.\r
+*/\r
+_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r
+\r
+    var oParent = this.parent;\r
+\r
+    oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+},\r
+\r
+/**\r
+* @method _onMenuItemFocus\r
+* @description "focus" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+* that fired the event.\r
+*/\r
+_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+    this.activeItem = p_oItem;\r
+\r
+},\r
+\r
+/**\r
+* @method _onMenuItemBlur\r
+* @description "blur" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event\r
+* that was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+*/\r
+_onMenuItemBlur: function(p_sType, p_aArgs) {\r
+\r
+    this.activeItem = null;\r
+\r
+},\r
+\r
+/**\r
+* @method _onMenuItemConfigChange\r
+* @description "configchange" event handler for the menu's items.\r
+* @private\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+* that fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._createItemGroup = function(p_nIndex) {\r
+_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+    var sProperty = p_aArgs[0][0];\r
+\r
+    switch(sProperty) {\r
+\r
+        case "submenu":\r
+\r
+            var oSubmenu = p_aArgs[0][1];\r
+\r
+            if(oSubmenu) {\r
+\r
+                this._configureSubmenu(p_oItem);\r
+\r
+            }\r
+\r
+        break;\r
+\r
+        case "text":\r
+        case "helptext":\r
+\r
+            /*\r
+                A change to an item's "text" or "helptext"\r
+                configuration properties requires the width of the parent\r
+                menu to be recalculated.\r
+            */\r
 \r
-    if(!this._aItemGroups[p_nIndex]) {\r
+            if(this.element.style.width) {\r
 \r
-        this._aItemGroups[p_nIndex] = [];\r
+                var sWidth = this._getOffsetWidth() + "px";\r
 \r
-        var oUL = document.createElement("ul");\r
+                Dom.setStyle(this.element, "width", sWidth);\r
 \r
-        this._aListElements[p_nIndex] = oUL;\r
+            }\r
 \r
-        return this._aItemGroups[p_nIndex];\r
+        break;\r
 \r
     }\r
 \r
-};\r
+},\r
+\r
+// Public event handlers for configuration properties\r
 \r
 /**\r
-* Returns the item group at the specified index.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the index of the item group to\r
-* be retrieved.\r
-* @return An array of items.\r
-* @type Array\r
+* @method enforceConstraints\r
+* @description The default event handler executed when the moveEvent is fired,\r
+* if the "constraintoviewport" configuration property is set to true.\r
+* @param {String} type The name of the event that was fired.\r
+* @param {Array} args Collection of arguments sent when the\r
+* event was fired.\r
+* @param {Array} obj Array containing the current Menu instance\r
+* and the item that fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._getItemGroup = function(p_nIndex) {\r
+enforceConstraints: function(type, args, obj) {\r
 \r
-    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
+    var oConfig = this.cfg;\r
 \r
-    return this._aItemGroups[nIndex];\r
+    var pos = args[0];\r
 \r
-};\r
+    var x = pos[0];\r
+    var y = pos[1];\r
 \r
-/**\r
-* Subscribe's a MenuModule instance to it's parent MenuModule instance's events.\r
-* @private\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to listen\r
-* for events on.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._configureItemSubmenuModule = \r
+    var bod = document.getElementsByTagName('body')[0];\r
+    var htm = document.getElementsByTagName('html')[0];\r
 \r
-    function(p_oItem) {\r
+    var bodyOverflow = Dom.getStyle(bod, "overflow");\r
+    var htmOverflow = Dom.getStyle(htm, "overflow");\r
 \r
-        var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            /*\r
-                Listen for configuration changes to the parent MenuModule \r
-                instance so they they can be applied to the submenu.\r
-            */\r
-    \r
-            this.cfg.configChangedEvent.subscribe(\r
-                this._onParentMenuModuleConfigChange, \r
-                oSubmenu, \r
-                true\r
-            );\r
-            \r
-            this.renderEvent.subscribe(\r
-                this._onParentMenuModuleRender,\r
-                oSubmenu, \r
-                true\r
-            );\r
-    \r
-            oSubmenu.beforeShowEvent.subscribe(\r
-                this._onSubmenuBeforeShow, \r
-                oSubmenu, \r
-                true\r
-            );\r
-    \r
-            oSubmenu.showEvent.subscribe(this._onSubmenuShow, oSubmenu, true);\r
-    \r
-            oSubmenu.hideEvent.subscribe(this._onSubmenuHide, oSubmenu, true);\r
-    \r
-        }\r
+    var offsetHeight = this.element.offsetHeight;\r
+    var offsetWidth = this.element.offsetWidth;\r
 \r
-};\r
+    var viewPortWidth = Dom.getClientWidth();\r
+    var viewPortHeight = Dom.getClientHeight();\r
 \r
-/**\r
-* Subscribes a MenuModule instance to the specified item's Custom Events.\r
-* @private\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to listen for events on.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._subscribeToItemEvents = function(p_oItem) {\r
+    var scrollX = window.scrollX || document.body.scrollLeft;\r
+    var scrollY = window.scrollY || document.body.scrollTop;\r
 \r
-    var aArguments = [this, p_oItem];\r
+    var topConstraint = scrollY + 10;\r
+    var leftConstraint = scrollX + 10;\r
+    var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
+    var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
 \r
-    p_oItem.focusEvent.subscribe(this._onItemFocus, aArguments);\r
+    var aContext = oConfig.getProperty("context");\r
+    var oContextElement = aContext ? aContext[0] : null;\r
 \r
-    p_oItem.blurEvent.subscribe(this._onItemBlur, aArguments);\r
 \r
-    p_oItem.cfg.configChangedEvent.subscribe(\r
-        this._onItemConfigChange,\r
-        aArguments\r
-    );\r
+    if (x < 10) {\r
 \r
-};\r
+        x = leftConstraint;\r
 \r
-/**\r
-* Returns the offset width of a MenuModule instance.\r
-* @private\r
-*/\r
-YAHOO.widget.MenuModule.prototype._getOffsetWidth = function() {\r
+    } else if ((x + offsetWidth) > viewPortWidth) {\r
 \r
-    var oClone = this.element.cloneNode(true);\r
+        if(\r
+            oContextElement &&\r
+            ((x - oContextElement.offsetWidth) > offsetWidth)\r
+        ) {\r
 \r
-    this._oDom.setStyle(oClone, "width", "");\r
+            x = (x - (oContextElement.offsetWidth + offsetWidth));\r
 \r
-    document.body.appendChild(oClone);\r
+        }\r
+        else {\r
 \r
-    var sWidth = oClone.offsetWidth;\r
+            x = rightConstraint;\r
 \r
-    document.body.removeChild(oClone);\r
+        }\r
 \r
-    return sWidth;\r
+    }\r
 \r
-};\r
+    if (y < 10) {\r
 \r
-/**\r
-* Determines if a DOM event was fired on an item and (if so) fires the item's\r
-* associated Custom Event\r
-* @private\r
-* @param {HTMLElement} p_oElement The original target of the event.\r
-* @param {String} p_sEventType The type/name of the Custom Event to fire.\r
-* @param {Event} p_oDOMEvent The DOM event to pass back when firing the \r
-* Custom Event.\r
-* @return An item.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype._fireItemEvent = \r
+        y = topConstraint;\r
 \r
-    function(p_oElement, p_sEventType, p_oDOMEvent) {\r
+    } else if (y > bottomConstraint) {\r
+\r
+        if(oContextElement && (y > offsetHeight)) {\r
+\r
+            y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
 \r
-        var me = this;\r
-    \r
-        /**\r
-        * Returns the specified element's parent HTMLLIElement (&#60;LI&#60;)\r
-        * @param {p_oElement} An HTMLElement node\r
-        * @ignore\r
-        * @return Returns an HTMLElement node\r
-        * @type HTMLElement \r
-        */\r
-        function getItemElement(p_oElement) {\r
-        \r
-            if(p_oElement == me.element) {\r
-    \r
-                return;\r
-            \r
-            }\r
-            else if(p_oElement.tagName == "LI") {\r
-        \r
-                return p_oElement;\r
-        \r
-            }\r
-            else if(p_oElement.parentNode) {\r
-    \r
-                return getItemElement(p_oElement.parentNode);\r
-        \r
-            }\r
-        \r
         }\r
-    \r
-    \r
-        var oElement = getItemElement(p_oElement);\r
-    \r
-        if(oElement) {\r
-    \r
-            /*\r
-                Retrieve the item that corresponds to the \r
-                HTMLLIElement (&#60;LI&#60;) and fire the Custom Event        \r
-            */\r
-    \r
-            var nGroupIndex = parseInt(oElement.getAttribute("groupindex"), 10);\r
-            var nIndex = parseInt(oElement.getAttribute("index"), 10);\r
-            var oItem = this._aItemGroups[nGroupIndex][nIndex];\r
-    \r
-            if(!oItem.cfg.getProperty("disabled")) {\r
-    \r
-                oItem[p_sEventType].fire(p_oDOMEvent);\r
-    \r
-                return oItem;\r
-    \r
-            }\r
-    \r
+        else {\r
+\r
+            y = bottomConstraint;\r
+\r
         }\r
 \r
-    };\r
+    }\r
+\r
+    oConfig.setProperty("x", x, true);\r
+    oConfig.setProperty("y", y, true);\r
 \r
-// Private DOM event handlers\r
+},\r
 \r
 /**\r
-* Generic event handler for the MenuModule's root HTMLDivElement node.  Used \r
-* to handle "mousedown," "mouseup," "keydown," "keyup," and "keypress" events.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event \r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
+* @method configVisible\r
+* @description Event handler for when the "visible" configuration property\r
+* the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onDOMEvent = \r
-\r
-    function(p_oEvent, p_oMenuModule) {\r
+configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-        var Event = this._oEventUtil;\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-        // Map of DOM event types to Custom Event types\r
+        YAHOO.widget.Menu.superclass.configVisible.call(\r
+            this,\r
+            p_sType,\r
+            p_aArgs,\r
+            p_oMenu\r
+        );\r
 \r
-        var oEventTypes =  {\r
-                "mousedown": "mouseDownEvent",\r
-                "mouseup": "mouseUpEvent",\r
-                "keydown": "keyDownEvent",\r
-                "keyup": "keyUpEvent",\r
-                "keypress": "keyPressEvent"\r
-            };\r
-    \r
-        var sCustomEventType = oEventTypes[p_oEvent.type];\r
-        \r
-        var oTarget = Event.getTarget(p_oEvent);\r
-    \r
-        /*\r
-            Check if the target was an element that is a part of a \r
-            an item and (if so), fire the associated custom event.\r
-        */\r
-    \r
-        this._fireItemEvent(oTarget, sCustomEventType, p_oEvent);\r
-\r
-    \r
-        // Fire the associated custom event for the MenuModule\r
-    \r
-        this[sCustomEventType].fire(p_oEvent);\r
-    \r
-    \r
-        /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
-        */\r
-            \r
-        Event.stopPropagation(p_oEvent);\r
+    }\r
+    else {\r
 \r
-    };\r
+        var bVisible = p_aArgs[0];\r
+       var sDisplay = Dom.getStyle(this.element, "display");\r
 \r
-/**\r
-* "mouseover" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event\r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onElementMouseOver = \r
+        if(bVisible) {\r
 \r
-    function(p_oEvent, p_oMenuModule) {\r
+            if(sDisplay != "block") {\r
+                this.beforeShowEvent.fire();\r
+                Dom.setStyle(this.element, "display", "block");\r
+                this.showEvent.fire();\r
+            }\r
 \r
-        var Event = this._oEventUtil;\r
-        var oTarget = Event.getTarget(p_oEvent);\r
-    \r
-        if(\r
-            (\r
-                oTarget == this.element || \r
-                this._oDom.isAncestor(this.element, oTarget)\r
-            )  && \r
-            !this._bFiredMouseOverEvent\r
-        ) {\r
-    \r
-            // Fire the "mouseover" Custom Event for the MenuModule instance\r
-    \r
-            this.mouseOverEvent.fire(p_oEvent);\r
-    \r
-            this._bFiredMouseOverEvent = true;\r
-            this._bFiredMouseOutEvent = false;\r
-    \r
         }\r
-    \r
-    \r
-        /*\r
-            Check if the target was an element that is a part of an item\r
-            and (if so), fire the "mouseover" Custom Event.\r
-        */\r
-    \r
-        if(!this._oCurrentItem) {\r
-    \r
-            this._oCurrentItem = \r
-                this._fireItemEvent(oTarget, "mouseOverEvent", p_oEvent);\r
-    \r
+        else {\r
+\r
+                       if(sDisplay == "block") {\r
+                               this.beforeHideEvent.fire();\r
+                               Dom.setStyle(this.element, "display", "none");\r
+                               this.hideEvent.fire();\r
+                       }\r
+\r
         }\r
-    \r
-    \r
-        /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
-        */\r
-    \r
-        Event.stopPropagation(p_oEvent);\r
 \r
-    };\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* "mouseout" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the event\r
-* utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
+* @method configPosition\r
+* @description Event handler for when the "position" configuration property\r
+* of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
+* fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onElementMouseOut = \r
-\r
-    function(p_oEvent, p_oMenuModule) {\r
-\r
-        var Dom = this._oDom;\r
-        var Event = this._oEventUtil;\r
-        var oRelatedTarget = Event.getRelatedTarget(p_oEvent);\r
-        var bLIMouseOut = true;\r
-        var bMovingToSubmenu = false;\r
-            \r
-    \r
-        // Determine where the mouse is going\r
-    \r
-        if(this._oCurrentItem && oRelatedTarget) {\r
-    \r
-            if(\r
-                oRelatedTarget == this._oCurrentItem.element || \r
-                Dom.isAncestor(this._oCurrentItem.element, oRelatedTarget)\r
-            ) {\r
-    \r
-                bLIMouseOut = false;\r
-    \r
-            }\r
-    \r
-    \r
-            var oSubmenu = this._oCurrentItem.cfg.getProperty("submenu");\r
-    \r
-            if(\r
-                oSubmenu && \r
-                (\r
-                    oRelatedTarget == oSubmenu.element ||\r
-                    Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
-                )\r
-            ) {\r
-    \r
-                bMovingToSubmenu = true;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-    \r
-        if(this._oCurrentItem && (bLIMouseOut || bMovingToSubmenu)) {\r
-    \r
-            // Fire the "mouseout" Custom Event for the item\r
-    \r
-            this._oCurrentItem.mouseOutEvent.fire(p_oEvent);\r
-    \r
-            this._oCurrentItem = null;\r
-    \r
-        }\r
-    \r
-    \r
-        if(\r
-            !this._bFiredMouseOutEvent && \r
-            (\r
-                !Dom.isAncestor(this.element, oRelatedTarget) ||\r
-                bMovingToSubmenu\r
-            )\r
-        ) {\r
-    \r
-            // Fire the "mouseout" Custom Event for the MenuModule instance\r
-    \r
-            this.mouseOutEvent.fire(p_oEvent);\r
-    \r
-            this._bFiredMouseOutEvent = true;\r
-            this._bFiredMouseOverEvent = false;\r
-    \r
-        }\r
-    \r
-    \r
+configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
+\r
+    var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
+    var oCfg = this.cfg;\r
+\r
+    Dom.setStyle(this.element, "position", sCSSPosition);\r
+\r
+    if(sCSSPosition == "static") {\r
+\r
         /*\r
-            Stop the propagation of the event at each MenuModule instance\r
-            since menus can be embedded in eachother.\r
+            Remove the iframe for statically positioned menus since it will\r
+            intercept mouse events.\r
         */\r
-    \r
-        Event.stopPropagation(p_oEvent);\r
 \r
-    };\r
+        oCfg.setProperty("iframe", false);\r
 \r
-/**\r
-* "click" event handler for the MenuModule's root HTMLDivElement node.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance \r
-* corresponding to the HTMLDivElement that fired the event.\r
-*/         \r
-YAHOO.widget.MenuModule.prototype._onElementClick = \r
+        // Statically positioned menus are visible by default\r
 \r
-    function(p_oEvent, p_oMenuModule) {\r
+        Dom.setStyle(this.element, "display", "block");\r
+\r
+        oCfg.setProperty("visible", true);\r
+\r
+    }\r
+    else {\r
 \r
-        var Event = this._oEventUtil;\r
-        \r
-        var oTarget = Event.getTarget(p_oEvent);\r
-        \r
         /*\r
-            Check if the target was a DOM element that is a part of an\r
-            item and (if so), fire the associated "click" \r
-            Custom Event.\r
+            Even though the "visible" property is queued to\r
+            "false" by default, we need to set the "visibility" property to\r
+            "hidden" since Overlay's "configVisible" implementation checks the\r
+            element's "visibility" style property before deciding whether\r
+            or not to show an Overlay instance.\r
         */\r
-        \r
-        var oItem = this._fireItemEvent(oTarget, "clickEvent", p_oEvent);\r
-        \r
-        var bCurrentPageURL; // Indicates if the URL points to the current page\r
-    \r
-    \r
-        if(oItem) {\r
-    \r
-            var sURL = oItem.cfg.getProperty("url");\r
-            var oSubmenu = oItem.cfg.getProperty("submenu");\r
-            \r
-            bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
-    \r
-            /*\r
-                ACCESSIBILITY FEATURE FOR SCREEN READERS: Expand/collapse the\r
-                submenu when the user clicks on the submenu indicator image.\r
-            */        \r
-    \r
-            if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
 \r
-                if(oSubmenu.cfg.getProperty("visible")) {\r
-        \r
-                    oSubmenu.hide();\r
-        \r
-                }\r
-                else {\r
+        Dom.setStyle(this.element, "visibility", "hidden");\r
 \r
-                    var oActiveItem = this.activeItem;\r
-               \r
+    }\r
 \r
-                    // Hide any other submenus that might be visible\r
-                \r
-                    if(oActiveItem && oActiveItem != this) {\r
-                \r
-                        this.clearActiveItem();\r
-                \r
-                    }\r
+    if(sCSSPosition == "absolute") {\r
 \r
-                    this.activeItem = oItem;\r
-        \r
-                    oItem.cfg.setProperty("selected", true);\r
+        var nZIndex = oCfg.getProperty("zindex");\r
+\r
+        if(!nZIndex || nZIndex === 0) {\r
+\r
+            nZIndex = this.parent ?\r
+                (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r
+\r
+            oCfg.setProperty("zindex", nZIndex);\r
 \r
-                    oSubmenu.show();\r
-        \r
-                }\r
-        \r
-            }\r
-            else if(oTarget.tagName != "A" && !bCurrentPageURL) {\r
-                \r
-                /*\r
-                    Follow the URL of the item regardless of whether or \r
-                    not the user clicked specifically on the\r
-                    HTMLAnchorElement (&#60;A&#60;) node.\r
-                */\r
-    \r
-                document.location = sURL;\r
-        \r
-            }\r
-        \r
-        }\r
-            \r
-    \r
-        switch(oTarget.tagName) {\r
-        \r
-            case "A":\r
-            \r
-                if(bCurrentPageURL) {\r
-    \r
-                    // Don't follow URLs that are equal to "#"\r
-    \r
-                    Event.preventDefault(p_oEvent);\r
-                \r
-                }\r
-                else {\r
-    \r
-                    /*\r
-                        Break if the anchor's URL is something other than "#" \r
-                        to prevent the call to "stopPropagation" from be \r
-                        executed.  This is required for Safari to be able to \r
-                        follow the URL.\r
-                    */\r
-                \r
-                    break;\r
-                \r
-                }\r
-            \r
-            default:\r
-    \r
-                /*\r
-                    Stop the propagation of the event at each MenuModule \r
-                    instance since Menus can be embedded in eachother.\r
-                */\r
-    \r
-                Event.stopPropagation(p_oEvent);\r
-            \r
-            break;\r
-        \r
         }\r
-    \r
-    \r
-        // Fire the associated "click" Custom Event for the MenuModule instance\r
-    \r
-        this.clickEvent.fire(p_oEvent);\r
 \r
-    };\r
+    }\r
 \r
-// Private Custom Event handlers\r
+},\r
 \r
 /**\r
-* "beforerender" Custom Event handler for a MenuModule instance.  Appends all \r
-* of the HTMLUListElement (&#60;UL&#60;s) nodes (and their child \r
-* HTMLLIElement (&#60;LI&#60;)) nodes and their accompanying title nodes to  \r
-* the body of the MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configIframe\r
+* @description Event handler for when the "iframe" configuration property of\r
+* the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onBeforeRender = \r
+configIframe: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-        var Dom = this._oDom;\r
-        var oConfig = this.cfg;\r
-        var oEl = this.element;\r
-        var nListElements = this._aListElements.length;\r
-    \r
-\r
-        if(oConfig.getProperty("position") == "static") {\r
-    \r
-            oConfig.queueProperty("iframe", false);\r
-            oConfig.queueProperty("visible", true);\r
-            \r
-        }\r
-    \r
-    \r
-        if(nListElements > 0) {\r
-    \r
-            var i = 0;\r
-            var bFirstList = true;\r
-            var oUL;\r
-            var oGroupTitle;\r
-    \r
-    \r
-            do {\r
-    \r
-                oUL = this._aListElements[i];\r
-    \r
-                if(oUL) {\r
-    \r
-                    if(bFirstList) {\r
-            \r
-                        Dom.addClass(oUL, "first-of-type");\r
-                        bFirstList = false;\r
-            \r
-                    }\r
-    \r
-    \r
-                    if(!Dom.isAncestor(oEl, oUL)) {\r
-    \r
-                        this.appendToBody(oUL);\r
-    \r
-                    }\r
-    \r
-    \r
-                    oGroupTitle = this._aGroupTitleElements[i];\r
-    \r
-                    if(oGroupTitle) {\r
-    \r
-                        if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
-    \r
-                            oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
-    \r
-                        }\r
-    \r
-    \r
-                        Dom.addClass(oUL, "hastitle");\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                i++;\r
-    \r
-            }\r
-            while(i < nListElements);\r
-    \r
-        }\r
+        YAHOO.widget.Menu.superclass.configIframe.call(\r
+            this,\r
+            p_sType,\r
+            p_aArgs,\r
+            p_oMenu\r
+        );\r
 \r
-    };\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* "render" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configHideDelay\r
+* @description Event handler for when the "hidedelay" configuration property\r
+* of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onRender = \r
+configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    var nHideDelay = p_aArgs[0];\r
+    var oMouseOutEvent = this.mouseOutEvent;\r
+    var oMouseOverEvent = this.mouseOverEvent;\r
+    var oKeyDownEvent = this.keyDownEvent;\r
+\r
+    if(nHideDelay > 0) {\r
+\r
+        /*\r
+            Only assign event handlers once. This way the user change\r
+            the value for the hidedelay as many times as they want.\r
+        */\r
+\r
+        if(!this._hideDelayEventHandlersAssigned) {\r
+\r
+            oMouseOutEvent.subscribe(this._execHideDelay, true);\r
+            oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r
+            oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r
+\r
+            this._hideDelayEventHandlersAssigned = true;\r
 \r
-        if(this.cfg.getProperty("position") == "dynamic") {\r
-    \r
-            var sWidth = this.element.parentNode.tagName == "BODY" ? \r
-                    this.element.offsetWidth : this._getOffsetWidth();\r
-        \r
-            this.cfg.setProperty("width", (sWidth + "px"));\r
-    \r
         }\r
 \r
-    };\r
+    }\r
+    else {\r
+\r
+        oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r
+        oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r
+        oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r
+\r
+        this._hideDelayEventHandlersAssigned = false;\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* "show" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configContainer\r
+* @description Event handler for when the "container" configuration property\r
+of the menu changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
 * fired the event.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onShow = \r
+configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
-    \r
-        /*\r
-            Setting focus to an item in the newly visible submenu alerts the \r
-            contents of the submenu to the screen reader.\r
-        */\r
+       var oElement = p_aArgs[0];\r
 \r
-        this.setInitialFocus();\r
-    \r
-    };\r
+       if(typeof oElement == 'string') {\r
+\r
+        this.cfg.setProperty(\r
+                "container",\r
+                document.getElementById(oElement),\r
+                true\r
+            );\r
+\r
+       }\r
+\r
+},\r
+\r
+// Public methods\r
 \r
 /**\r
-* "hide" Custom Event handler for a MenuModule instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* Event handler called when the resize monitor element's "resize" evet is fired.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onBeforeHide = \r
+onDomResize: function(e, obj) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    if(!this._handleResize) {\r
 \r
-        var oActiveItem = this.activeItem;\r
+        this._handleResize = true;\r
+        return;\r
 \r
-        if(oActiveItem) {\r
-    \r
-            oActiveItem.blur();\r
+    }\r
 \r
-            if(oActiveItem.cfg.getProperty("selected")) {\r
-    \r
-                oActiveItem.cfg.setProperty("selected", false);\r
-    \r
-            }\r
-    \r
-            var oSubmenu = oActiveItem.cfg.getProperty("submenu");\r
-    \r
-            if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
-    \r
-                oSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\r
+    var oConfig = this.cfg;\r
+\r
+    if(oConfig.getProperty("position") == "dynamic") {\r
+\r
+        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
+\r
+    }\r
+\r
+    YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
+\r
+},\r
+\r
+/**\r
+* @method initEvents\r
+* @description Initializes the custom events for the menu.\r
+*/\r
+initEvents: function() {\r
+\r
+       YAHOO.widget.Menu.superclass.initEvents.call(this);\r
+\r
+    // Create custom events\r
+\r
+    var CustomEvent = YAHOO.util.CustomEvent;\r
+\r
+    this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
+    this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
+    this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
+    this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
+    this.clickEvent = new CustomEvent("clickEvent", this);\r
+    this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
+    this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
+    this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
+    this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r
+    this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r
+\r
+},\r
+\r
+/**\r
+* @method getRoot\r
+* @description Finds the menu's root menu.\r
+*/\r
+getRoot: function() {\r
+\r
+    var oItem = this.parent;\r
+\r
+    if(oItem) {\r
+\r
+        var oParentMenu = oItem.parent;\r
+\r
+        return oParentMenu ? oParentMenu.getRoot() : this;\r
+\r
+    }\r
+    else {\r
+\r
+        return this;\r
 \r
-    };\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* "configchange" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that subscribed\r
-* to the event.\r
+* @method toString\r
+* @description Returns a string representing the menu.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuModule.prototype._onParentMenuModuleConfigChange = \r
-\r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var sPropertyName = p_aArgs[0][0];\r
-        var oPropertyValue = p_aArgs[0][1];\r
-    \r
-        switch(sPropertyName) {\r
-    \r
-            case "iframe":\r
-            case "constraintoviewport":\r
-    \r
-                p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
-                    \r
-            break;        \r
-            \r
-        }\r
-    \r
-    };\r
+toString: function() {\r
+\r
+    return ("Menu " + this.id);\r
+\r
+},\r
 \r
 /**\r
-* "render" Custom Event handler for a MenuModule instance.  Renders a  \r
-* submenu in response to the firing of it's parent's "render" event.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that subscribed\r
-* to the event.\r
+* @method setItemGroupTitle\r
+* @description Sets the title of a group of menu items.\r
+* @param {String} p_sGroupTitle String specifying the title of the group.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r
+* the title belongs.\r
 */\r
-YAHOO.widget.MenuModule.prototype._onParentMenuModuleRender = \r
+setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
+    if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
+\r
+        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
+        var oTitle = this._aGroupTitleElements[nGroupIndex];\r
+\r
+        if(oTitle) {\r
+\r
+            oTitle.innerHTML = p_sGroupTitle;\r
 \r
-        /*\r
-            Set the "iframe" and "constraintoviewport" configuration \r
-            properties to match the parent MenuModule\r
-        */ \r
-    \r
-        var oParentMenu = p_oSubmenu.parent.parent;\r
-    \r
-        p_oSubmenu.cfg.applyConfig(\r
-        \r
-            {\r
-                constraintoviewport: \r
-                    oParentMenu.cfg.getProperty("constraintoviewport"),\r
-    \r
-                xy: [0,0],\r
-    \r
-                iframe: oParentMenu.cfg.getProperty("iframe")\r
-    \r
-            }\r
-        \r
-        );\r
-    \r
-    \r
-        if(this._oDom.inDocument(this.element)) {\r
-    \r
-            this.render();\r
-    \r
         }\r
         else {\r
-    \r
-            this.render(this.parent.element);\r
-    \r
-        }\r
-    \r
-    };\r
 \r
-/**\r
-* "beforeshow" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onSubmenuBeforeShow = \r
+            oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
-        var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
+            oTitle.innerHTML = p_sGroupTitle;\r
 \r
-        this.cfg.setProperty(\r
-            "context", \r
-            [\r
-                oParent.element, \r
-                aAlignment[0], \r
-                aAlignment[1]\r
-            ]\r
-        );\r
+            this._aGroupTitleElements[nGroupIndex] = oTitle;\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
+        }\r
 \r
-/**\r
-* "show" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onSubmenuShow = \r
+        var i = this._aGroupTitleElements.length - 1;\r
+        var nFirstIndex;\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
+        do {\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
+            if(this._aGroupTitleElements[i]) {\r
 \r
-/**\r
-* "hide" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oSubmenu The submenu that fired\r
-* the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onSubmenuHide = \r
+                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r
 \r
-    function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-        var oParent = this.parent;\r
+                nFirstIndex = i;\r
 \r
-        if(oParent.parent.cfg.getProperty("visible")) {\r
+            }\r
 \r
-            oParent.cfg.setProperty("selected", false);\r
-    \r
-            oParent.focus();\r
-        \r
         }\r
+        while(i--);\r
 \r
-        oParent.submenuIndicator.alt = \r
-            oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
-    \r
-    };\r
-\r
-/**\r
-* "focus" YAHOO.util.CustomEvent handler for a MenuModule instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemFocus = \r
-\r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-    \r
-        var me = p_aObjects[0];\r
-        var oItem = p_aObjects[1];\r
-    \r
-        me.activeItem = oItem;\r
-    \r
-    };\r
+        if(nFirstIndex !== null) {\r
 \r
-/**\r
-* "blur" YAHOO.util.CustomEvent handler for a MenuModule instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemBlur = \r
+            Dom.addClass(\r
+                this._aGroupTitleElements[nFirstIndex],\r
+                "first-of-type"\r
+            );\r
 \r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-    \r
-        var me = p_aObjects[0];\r
-        var oItem = p_aObjects[1];\r
-        var oSubmenu = oItem.cfg.getProperty("submenu");\r
-    \r
-        if(!oSubmenu || (oSubmenu && !oSubmenu.cfg.getProperty("visible"))) {\r
-    \r
-            me.activeItem = null;\r
-    \r
         }\r
-    \r
-    };\r
 \r
-/**\r
-* "configchange" YAHOO.util.CustomEvent handler for the MenuModule \r
-* instance's items.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {Array} p_aObjects Array containing the current MenuModule instance \r
-* and the item that fired the event.\r
-*/\r
-YAHOO.widget.MenuModule.prototype._onItemConfigChange = \r
-\r
-    function(p_sType, p_aArgs, p_aObjects) {\r
-\r
-        var me = p_aObjects[0];    \r
-        var sProperty = p_aArgs[0][0];\r
-        var oItem = p_aObjects[1];\r
-    \r
-        switch(sProperty) {\r
-    \r
-            case "submenu":\r
-    \r
-                var oSubmenu = p_aArgs[0][1];\r
-    \r
-                if(oSubmenu) {\r
-    \r
-                    me._configureItemSubmenuModule(oItem);\r
-    \r
-                }\r
-    \r
-            break;\r
-    \r
-            case "text":\r
-            case "helptext":\r
-    \r
-                /*\r
-                    A change to an item's "text" or "helptext"\r
-                    configuration properties requires the width of the parent\r
-                    MenuModule instance to be recalculated.\r
-                */\r
-    \r
-                if(me.element.style.width) {\r
-        \r
-                    var sWidth = me._getOffsetWidth() + "px";\r
-    \r
-                    me._oDom.setStyle(me.element, "width", sWidth);\r
-    \r
-                }\r
-    \r
-            break;\r
-    \r
-        }\r
-    \r
-    };\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* The default event handler executed when the moveEvent is fired, if the \r
-* "constraintoviewport" configuration property is set to true.\r
+* @method addItem\r
+* @description Appends an item to the menu.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r
+* which the item belongs.\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.enforceConstraints = \r
+addItem: function(p_oItem, p_nGroupIndex) {\r
 \r
-    function(type, args, obj) {\r
+    if(p_oItem) {\r
 \r
-        var Dom = this._oDom;\r
-        var oConfig = this.cfg;\r
-    \r
-        var pos = args[0];\r
-            \r
-        var x = pos[0];\r
-        var y = pos[1];\r
-        \r
-        var bod = document.getElementsByTagName('body')[0];\r
-        var htm = document.getElementsByTagName('html')[0];\r
-        \r
-        var bodyOverflow = Dom.getStyle(bod, "overflow");\r
-        var htmOverflow = Dom.getStyle(htm, "overflow");\r
-        \r
-        var offsetHeight = this.element.offsetHeight;\r
-        var offsetWidth = this.element.offsetWidth;\r
-        \r
-        var viewPortWidth = Dom.getClientWidth();\r
-        var viewPortHeight = Dom.getClientHeight();\r
-        \r
-        var scrollX = window.scrollX || document.body.scrollLeft;\r
-        var scrollY = window.scrollY || document.body.scrollTop;\r
-        \r
-        var topConstraint = scrollY + 10;\r
-        var leftConstraint = scrollX + 10;\r
-        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
-        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-        \r
-        var aContext = oConfig.getProperty("context");\r
-        var oContextElement = aContext ? aContext[0] : null;\r
-    \r
-    \r
-        if (x < 10) {\r
-    \r
-            x = leftConstraint;\r
-    \r
-        } else if ((x + offsetWidth) > viewPortWidth) {\r
-    \r
-            if(\r
-                oContextElement && \r
-                ((x - oContextElement.offsetWidth) > offsetWidth)\r
-            ) {\r
-    \r
-                x = (x - (oContextElement.offsetWidth + offsetWidth));\r
-    \r
-            }\r
-            else {\r
-    \r
-                x = rightConstraint;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-        if (y < 10) {\r
-    \r
-            y = topConstraint;\r
-    \r
-        } else if (y > bottomConstraint) {\r
-    \r
-            if(oContextElement && (y > offsetHeight)) {\r
-    \r
-                y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
-    \r
-            }\r
-            else {\r
-    \r
-                y = bottomConstraint;\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-        oConfig.setProperty("x", x, true);\r
-        oConfig.setProperty("y", y, true);\r
-    \r
-    };\r
+        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
+\r
+    }\r
 \r
-// Event handlers for configuration properties\r
+},\r
 \r
 /**\r
-* Event handler for when the "position" configuration property of a\r
-* MenuModule changes.\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance fired\r
-* the event.\r
-* @see YAHOO.widget.Overlay#configIframe\r
+* @method addItems\r
+* @description Adds an array of items to the menu.\r
+* @param {Array} p_aItems Array of items to be added to the menu.  The array\r
+* can contain strings specifying the text for each item to be created, object\r
+* literals specifying each of the menu item configuration properties,\r
+* or MenuItem instances.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
+* which the items belongs.\r
+* @return {Array}\r
 */\r
-YAHOO.widget.MenuModule.prototype.configPosition = \r
+addItems: function(p_aItems, p_nGroupIndex) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenuModule) {\r
+    function isArray(p_oValue) {\r
 \r
-        var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
-    \r
-        this._oDom.setStyle(this.element, "position", sCSSPosition);\r
-    \r
-    };\r
+        return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
 \r
-// Public methods\r
+    }\r
 \r
-YAHOO.widget.MenuModule.prototype.toString = function() {\r
+    if(isArray(p_aItems)) {\r
 \r
-    return ("Menu " + this.id);\r
+        var nItems = p_aItems.length;\r
+        var aItems = [];\r
+        var oItem;\r
 \r
-};\r
+        for(var i=0; i<nItems; i++) {\r
+\r
+            oItem = p_aItems[i];\r
+\r
+            if(isArray(oItem)) {\r
+\r
+                aItems[aItems.length] = this.addItems(oItem, i);\r
 \r
-/**\r
-* Sets the title of a group of items.\r
-* @param {String} p_sGroupTitle The title of the group.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the title belongs.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.setItemGroupTitle = \r
-\r
-    function(p_sGroupTitle, p_nGroupIndex) {\r
-        \r
-        if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-    \r
-            var Dom = this._oDom;\r
-\r
-            var nGroupIndex = \r
-                    typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-    \r
-            var oTitle = this._aGroupTitleElements[nGroupIndex];\r
-    \r
-    \r
-            if(oTitle) {\r
-    \r
-                oTitle.innerHTML = p_sGroupTitle;\r
-                \r
             }\r
             else {\r
-    \r
-                oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
-                        \r
-                oTitle.innerHTML = p_sGroupTitle;\r
-    \r
-                this._aGroupTitleElements[nGroupIndex] = oTitle;\r
-    \r
-            }\r
-    \r
-    \r
-            var i = this._aGroupTitleElements.length - 1;\r
-            var nFirstIndex;\r
-    \r
-            do {\r
-    \r
-                if(this._aGroupTitleElements[i]) {\r
-    \r
-                    Dom.removeClass(\r
-                        this._aGroupTitleElements[i],\r
-                        "first-of-type"\r
-                    );\r
 \r
-                    nFirstIndex = i;\r
-    \r
-                }\r
-    \r
-            }\r
-            while(i--);\r
-    \r
-    \r
-            if(nFirstIndex !== null) {\r
-    \r
-                Dom.addClass(\r
-                    this._aGroupTitleElements[nFirstIndex], \r
-                    "first-of-type"\r
-                );\r
-    \r
+                aItems[aItems.length] =\r
+                    this._addItemToGroup(p_nGroupIndex, oItem);\r
+\r
             }\r
-    \r
+\r
+        }\r
+\r
+        if(aItems.length) {\r
+\r
+            return aItems;\r
+\r
         }\r
-    \r
-    };\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Appends the specified item to a MenuModule instance.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be added.\r
+* @method insertItem\r
+* @description Inserts an item into the menu at the specified index.\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
+* instance to be added to the menu.\r
+* @param {String} p_oItem String specifying the text of the item to be added\r
+* to the menu.\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r
+* configuration properties.\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r
+* the item should be added.\r
 * @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
 * the item belongs.\r
-* @return The item that was added to the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.addItem = function(p_oItem, p_nGroupIndex) {\r
+insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
 \r
     if(p_oItem) {\r
 \r
-        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-        \r
+        return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
+\r
     }\r
 \r
-};\r
+},\r
 \r
 /**\r
-* Inserts an item into a MenuModule instance at the specified index.\r
-* @param {YAHOO.widget.MenuModuleItem} p_oItem The item to be inserted.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position \r
-* at which the item should be added.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return The item that was inserted into the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @method removeItem\r
+* @description Removes the specified item from the menu.\r
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r
+* instance to be removed from the menu.\r
+* @param {Number} p_oObject Number specifying the index of the item\r
+* to be removed.\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
+* which the item belongs.\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.insertItem = \r
-\r
-    function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
-    \r
-        if(p_oItem) {\r
-    \r
-            return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
-    \r
+removeItem: function(p_oObject, p_nGroupIndex) {\r
+\r
+    if(typeof p_oObject != "undefined") {\r
+\r
+        var oItem;\r
+\r
+        if(p_oObject instanceof YAHOO.widget.MenuItem) {\r
+\r
+            oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r
+\r
         }\r
-    \r
-    };\r
+        else if(typeof p_oObject == "number") {\r
 \r
-/**\r
-* Removes the specified item from a MenuModule instance.\r
-* @param {YAHOO.widget.MenuModuleItem/Number} p_oObject The item or index of \r
-* the item to be removed.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return The item that was removed from the MenuModule.\r
-* @type YAHOO.widget.MenuModuleItem\r
-*/\r
-YAHOO.widget.MenuModule.prototype.removeItem =\r
-\r
-    function(p_oObject, p_nGroupIndex) {\r
-    \r
-        if(typeof p_oObject != "undefined") {\r
-    \r
-            var oItem;\r
-    \r
-            if(p_oObject instanceof YAHOO.widget.MenuModuleItem) {\r
-    \r
-                oItem = \r
-                    this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);           \r
-    \r
-            }\r
-            else if(typeof p_oObject == "number") {\r
-    \r
-                oItem = \r
-                    this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
-    \r
-            }\r
-    \r
-            if(oItem) {\r
-    \r
-                oItem.destroy();\r
+            oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
 \r
-    \r
-                return oItem;\r
-    \r
-            }\r
-    \r
         }\r
-    \r
-    };\r
+\r
+        if(oItem) {\r
+\r
+            oItem.destroy();\r
+\r
+            return oItem;\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Returns a multi-dimensional array of all of a MenuModule's items.\r
-* @return An array of items.\r
-* @type Array\r
-*/        \r
-YAHOO.widget.MenuModule.prototype.getItemGroups = function() {\r
+* @method getItemGroups\r
+* @description Returns a multi-dimensional array of all of the items in the menu.\r
+* @return {Array}\r
+*/\r
+getItemGroups: function() {\r
 \r
     return this._aItemGroups;\r
 \r
-};\r
+},\r
 \r
 /**\r
-* Returns the item at the specified index.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position of the \r
+* @method getItem\r
+* @description Returns the item at the specified index.\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r
 * item to be retrieved.\r
 * @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
 * the item belongs.\r
-* @return An item.\r
-* @type YAHOO.widget.MenuModuleItem\r
+* @return {YAHOO.widget.MenuItem}\r
 */\r
-YAHOO.widget.MenuModule.prototype.getItem = \r
+getItem: function(p_nItemIndex, p_nGroupIndex) {\r
+\r
+    if(typeof p_nItemIndex == "number") {\r
+\r
+        var aGroup = this._getItemGroup(p_nGroupIndex);\r
+\r
+        if(aGroup) {\r
+\r
+            return aGroup[p_nItemIndex];\r
 \r
-    function(p_nItemIndex, p_nGroupIndex) {\r
-    \r
-        if(typeof p_nItemIndex == "number") {\r
-    \r
-            var aGroup = this._getItemGroup(p_nGroupIndex);\r
-    \r
-            if(aGroup) {\r
-    \r
-                return aGroup[p_nItemIndex];\r
-            \r
-            }\r
-    \r
         }\r
-    \r
-    };\r
 \r
-/**\r
-* Removes the MenuModule instance's element from the DOM and sets all child \r
-* elements to null.\r
-*/\r
-YAHOO.widget.MenuModule.prototype.destroy = function() {\r
+    }\r
 \r
-    // Remove DOM event handlers\r
+},\r
 \r
-    this._oEventUtil.purgeElement(this.element);\r
+/**\r
+* @method destroy\r
+* @description Removes the menu's <code>&#60;div&#62;</code> element\r
+* (and accompanying child nodes) from the document.\r
+*/\r
+destroy: function() {\r
 \r
     // Remove Custom Event listeners\r
 \r
@@ -2180,7 +3507,6 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
     this.keyPressEvent.unsubscribeAll();\r
     this.keyDownEvent.unsubscribeAll();\r
     this.keyUpEvent.unsubscribeAll();\r
-    this.beforeMoveEvent.unsubscribeAll();\r
 \r
     var nItemGroups = this._aItemGroups.length;\r
     var nItems;\r
@@ -2202,23 +3528,23 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
             if(oItemGroup) {\r
 \r
                 nItems = oItemGroup.length;\r
-    \r
+\r
                 if(nItems > 0) {\r
-    \r
+\r
                     n = nItems - 1;\r
-        \r
+\r
                     do {\r
 \r
                         oItem = this._aItemGroups[i][n];\r
 \r
                         if(oItem) {\r
-        \r
+\r
                             oItem.destroy();\r
                         }\r
-        \r
+\r
                     }\r
                     while(n--);\r
-    \r
+\r
                 }\r
 \r
             }\r
@@ -2226,442 +3552,768 @@ YAHOO.widget.MenuModule.prototype.destroy = function() {
         }\r
         while(i--);\r
 \r
-    }        \r
+    }\r
 \r
     // Continue with the superclass implementation of this method\r
 \r
-    YAHOO.widget.MenuModule.superclass.destroy.call(this);\r
-    \r
+    YAHOO.widget.Menu.superclass.destroy.call(this);\r
 \r
-};\r
+\r
+},\r
 \r
 /**\r
-* Sets focus to a MenuModule instance's first enabled item.\r
+* @method setInitialFocus\r
+* @description Sets focus to the menu's first enabled item.\r
 */\r
-YAHOO.widget.MenuModule.prototype.setInitialFocus = function() {\r
+setInitialFocus: function() {\r
 \r
     var oItem = this._getFirstEnabledItem();\r
-    \r
+\r
     if(oItem) {\r
-    \r
+\r
         oItem.focus();\r
     }\r
-    \r
-};\r
+\r
+},\r
 \r
 /**\r
-* Sets the "selected" configuration property of a MenuModule instance's first\r
+* @method setInitialSelection\r
+* @description Sets the "selected" configuration property of the menu's first\r
 * enabled item to "true."\r
 */\r
-YAHOO.widget.MenuModule.prototype.setInitialSelection = function() {\r
+setInitialSelection: function() {\r
 \r
     var oItem = this._getFirstEnabledItem();\r
-    \r
+\r
     if(oItem) {\r
-    \r
+\r
         oItem.cfg.setProperty("selected", true);\r
-    }        \r
+    }\r
 \r
-};\r
+},\r
+\r
+/**\r
+* @method clearActiveItem\r
+* @description Sets the "selected" configuration property of the menu's active\r
+* item to "false" and hides the item's submenu.\r
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r
+* should be blurred.\r
+*/\r
+clearActiveItem: function(p_bBlur) {\r
+\r
+    if(this.cfg.getProperty("showdelay") > 0) {\r
+\r
+        this._cancelShowDelay();\r
+\r
+    }\r
+\r
+    var oActiveItem = this.activeItem;\r
+\r
+    if(oActiveItem) {\r
+\r
+        var oConfig = oActiveItem.cfg;\r
+\r
+        oConfig.setProperty("selected", false);\r
+\r
+        var oSubmenu = oConfig.getProperty("submenu");\r
+\r
+        if(oSubmenu) {\r
+\r
+            oSubmenu.hide();\r
+\r
+        }\r
+\r
+        if(p_bBlur) {\r
+\r
+            oActiveItem.blur();\r
+\r
+        }\r
+\r
+    }\r
+\r
+},\r
 \r
 /**\r
-* Sets the "selected" configuration property of a MenuModule instance's active \r
-* item to "false," blurs the item and hide's the item's submenu.\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the menu's Config object ("cfg").\r
+* @method initDefaultConfig\r
 */\r
-YAHOO.widget.MenuModule.prototype.clearActiveItem = function () {\r
+initDefaultConfig: function() {\r
+\r
+    YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r
+\r
+    var oConfig = this.cfg;\r
+\r
+       // Add configuration properties\r
+\r
+    /*\r
+        Change the default value for the "visible" configuration\r
+        property to "false" by re-adding the property.\r
+    */\r
+\r
+    /**\r
+    * @config visible\r
+    * @description Boolean indicating whether or not the menu is visible.  If\r
+    * the menu's "position" configuration property is set to "dynamic" (the\r
+    * default), this property toggles the menu's <code>&#60;div&#62;</code>\r
+    * element's "visibility" style property between "visible" (true) or\r
+    * "hidden" (false).  If the menu's "position" configuration property is\r
+    * set to "static" this property toggles the menu's\r
+    * <code>&#60;div&#62;</code> element's "display" style property\r
+    * between "block" (true) or "none" (false).\r
+    * @default false\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "visible",\r
+        {\r
+            value:false,\r
+            handler:this.configVisible,\r
+            validator:this.cfg.checkBoolean\r
+         }\r
+     );\r
+\r
+    /*\r
+        Change the default value for the "constraintoviewport" configuration\r
+        property to "true" by re-adding the property.\r
+    */\r
+\r
+    /**\r
+    * @config constraintoviewport\r
+    * @description Boolean indicating if the menu will try to remain inside\r
+    * the boundaries of the size of viewport.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "constraintoviewport",\r
+        {\r
+            value:true,\r
+            handler:this.configConstrainToViewport,\r
+            validator:this.cfg.checkBoolean,\r
+            supercedes:["iframe","x","y","xy"]\r
+        }\r
+    );\r
+\r
+    /**\r
+    * @config position\r
+    * @description String indicating how a menu should be positioned on the\r
+    * screen.  Possible values are "static" and "dynamic."  Static menus are\r
+    * visible by default and reside in the normal flow of the document\r
+    * (CSS position: static).  Dynamic menus are hidden by default, reside\r
+    * out of the normal flow of the document (CSS position: absolute), and\r
+    * can overlay other elements on the screen.\r
+    * @default dynamic\r
+    * @type String\r
+    */\r
+    oConfig.addProperty(\r
+        "position",\r
+        {\r
+            value: "dynamic",\r
+            handler: this.configPosition,\r
+            validator: this._checkPosition,\r
+            supercedes: ["visible"]\r
+        }\r
+    );\r
 \r
-    if(this.activeItem) {\r
+    /**\r
+    * @config submenualignment\r
+    * @description Array defining how submenus should be aligned to their\r
+    * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r
+    * a submenu's top left corner is aligned to its parent menu item's top\r
+    * right corner.\r
+    * @default ["tl","tr"]\r
+    * @type Array\r
+    */\r
+    oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
 \r
-        var oConfig = this.activeItem.cfg;\r
+    /**\r
+    * @config autosubmenudisplay\r
+    * @description Boolean indicating if submenus are automatically made\r
+    * visible when the user mouses over the menu's items.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+       oConfig.addProperty(\r
+          "autosubmenudisplay",\r
+          {\r
+              value: true,\r
+              validator: oConfig.checkBoolean\r
+       }\r
+    );\r
 \r
-        oConfig.setProperty("selected", false);\r
+    /**\r
+    * @config showdelay\r
+    * @description Number indicating the time (in milliseconds) that should\r
+    * expire before a submenu is made visible when the user mouses over\r
+    * the menu's items.\r
+    * @default 0\r
+    * @type Number\r
+    */\r
+       oConfig.addProperty(\r
+          "showdelay",\r
+          {\r
+              value: 0,\r
+              validator: oConfig.checkNumber\r
+       }\r
+    );\r
 \r
-        var oSubmenu = oConfig.getProperty("submenu");\r
+    /**\r
+    * @config hidedelay\r
+    * @description Number indicating the time (in milliseconds) that should\r
+    * expire before the menu is hidden.\r
+    * @default 0\r
+    * @type Number\r
+    */\r
+       oConfig.addProperty(\r
+          "hidedelay",\r
+          {\r
+              value: 0,\r
+              validator: oConfig.checkNumber,\r
+              handler: this.configHideDelay,\r
+              suppressEvent: true\r
+       }\r
+    );\r
 \r
-        if(oSubmenu) {\r
+    /**\r
+    * @config clicktohide\r
+    * @description Boolean indicating if the menu will automatically be\r
+    * hidden if the user clicks outside of it.\r
+    * @default true\r
+    * @type Boolean\r
+    */\r
+    oConfig.addProperty(\r
+        "clicktohide",\r
+        {\r
+            value: true,\r
+            validator: oConfig.checkBoolean\r
+        }\r
+    );\r
 \r
-            oSubmenu.hide();\r
+       /**\r
+       * @config container\r
+       * @description HTML element reference or string specifying the id\r
+       * attribute of the HTML element that the menu's markup should be rendered into.\r
+       * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+       * level-one-html.html#ID-58190037">HTMLElement</a>|String\r
+       * @default document.body\r
+       */\r
+       this.cfg.addProperty(\r
+          "container",\r
+          { value:document.body, handler:this.configContainer }\r
+   );\r
 \r
-        }\r
+}\r
 \r
-    }\r
+}); // END YAHOO.extend\r
 \r
-};\r
+})();\r
 \r
 /**\r
-* Initializes the class's configurable properties which can be changed using \r
-* the MenuModule's Config object (cfg).\r
+* The base class for all menuing containers.\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu module.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu module.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929\r
+* /level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
+* specifying the <code>&#60;div&#62;</code> element of the menu module.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu module.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu module. See configuration class documentation for\r
+* more details.\r
+* @class MenuModule\r
+* @constructor\r
+* @extends YAHOO.widget.Overlay\r
+* @deprecated As of version 0.12, all MenuModule functionality has been\r
+* implemented directly in YAHOO.widget.Menu, making YAHOO.widget.Menu the base\r
+* class for all menuing containers.\r
 */\r
-YAHOO.widget.MenuModule.prototype.initDefaultConfig = function() {\r
-\r
-    YAHOO.widget.MenuModule.superclass.initDefaultConfig.call(this);\r
-\r
-    var oConfig = this.cfg;\r
-\r
-       // Add configuration properties\r
-\r
-    oConfig.addProperty(\r
-        "position", \r
-        {\r
-            value: "dynamic", \r
-            handler: this.configPosition, \r
-            validator: this._checkPosition \r
-        } \r
-    );\r
+YAHOO.widget.MenuModule = YAHOO.widget.Menu;\r
 \r
-    oConfig.refireEvent("position");\r
-\r
-    oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
+(function() {\r
 \r
-};\r
+var Dom = YAHOO.util.Dom;\r
+var Module = YAHOO.widget.Module;\r
+var Menu = YAHOO.widget.Menu;\r
 \r
 /**\r
-* @class The MenuModuleItem class allows you to create and modify an item for a\r
-* MenuModule instance.\r
+* Creates an item for a menu.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying\r
+* the <code>&#60;li&#62;</code> element of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object\r
+* specifying the <code>&#60;option&#62;</code> element of the menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu item. See configuration class documentation\r
+* for more details.\r
+* @class MenuItem\r
 * @constructor\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuModuleItem instance. See the configuration \r
-* class documentation for more details.\r
 */\r
-YAHOO.widget.MenuModuleItem = function(p_oObject, p_oConfig) {\r
+YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {\r
 \r
     if(p_oObject) {\r
 \r
+        if(p_oConfig) {\r
+\r
+            this.parent = p_oConfig.parent;\r
+            this.value = p_oConfig.value;\r
+\r
+        }\r
+\r
         this.init(p_oObject, p_oConfig);\r
 \r
     }\r
 \r
 };\r
 \r
-YAHOO.widget.MenuModuleItem.prototype = {\r
+YAHOO.widget.MenuItem.prototype = {\r
 \r
     // Constants\r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator.\r
+    * @property SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * menu item's submenu arrow indicator.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_nrm_1.gif"\r
     * @final\r
     * @type String\r
     */\r
     SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarorght8_nrm_1.gif",\r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator when a MenuModuleItem instance is selected.\r
+    * @property SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * submenu arrow indicator when the menu item is selected.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_hov_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: \r
+    SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:\r
         "nt/ic/ut/alt1/menuarorght8_hov_1.gif",\r
 \r
     /**\r
-    * Constant representing the path to the image to be used for the submenu\r
-    * arrow indicator when a MenuModuleItem instance is disabled.\r
+    * @property DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for the\r
+    * submenu arrow indicator when the menu item is disabled.\r
+    * @default "nt/ic/ut/alt1/menuarorght8_dim_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: \r
+    DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:\r
         "nt/ic/ut/alt1/menuarorght8_dim_1.gif",\r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator.\r
+    * @property COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator.\r
+    * @default "Collapsed.  Click to expand."\r
     * @final\r
     * @type String\r
     */\r
     COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT: "Collapsed.  Click to expand.",\r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator when the submenu is visible.\r
+    * @property EXPANDED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator when the submenu is visible.\r
+    * @default "Expanded.  Click to collapse."\r
     * @final\r
     * @type String\r
     */\r
     EXPANDED_SUBMENU_INDICATOR_ALT_TEXT: "Expanded.  Click to collapse.",\r
 \r
     /**\r
-    * Constant representing the alt text for the image to be used for the \r
-    * submenu arrow indicator when a MenuModuleItem instance is disabled.\r
+    * @property DISABLED_SUBMENU_INDICATOR_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the submenu arrow indicator when the menu item is disabled.\r
+    * @default "Disabled."\r
     * @final\r
     * @type String\r
     */\r
     DISABLED_SUBMENU_INDICATOR_ALT_TEXT: "Disabled.",\r
 \r
     /**\r
-    * Constant representing the CSS class(es) to be applied to the root \r
-    * HTMLLIElement of the MenuModuleItem.\r
+    * @property CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_nrm_1.gif"\r
     * @final\r
     * @type String\r
     */\r
-    CSS_CLASS_NAME: "yuimenuitem",\r
+    CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_nrm_1.gif",\r
+\r
 \r
     /**\r
-    * Constant representing the type of menu to instantiate when creating \r
-    * submenu instances from parsing the child nodes (either HTMLSelectElement \r
-    * or HTMLDivElement) of the item's DOM.  The default \r
-    * is YAHOO.widget.MenuModule.\r
+    * @property SELECTED_CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the selected checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_hov_1.gif"\r
     * @final\r
-    * @type YAHOO.widget.MenuModule\r
+    * @type String\r
     */\r
-    SUBMENU_TYPE: null,\r
+    SELECTED_CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_hov_1.gif",\r
+\r
+\r
+    /**\r
+    * @property DISABLED_CHECKED_IMAGE_PATH\r
+    * @description String representing the path to the image to be used for\r
+    * the disabled checked state.\r
+    * @default "nt/ic/ut/bsc/menuchk8_dim_1.gif"\r
+    * @final\r
+    * @type String\r
+    */\r
+    DISABLED_CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_dim_1.gif",\r
+\r
+\r
+    /**\r
+    * @property CHECKED_IMAGE_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the checked image.\r
+    * @default "Checked."\r
+    * @final\r
+    * @type String\r
+    */\r
+    CHECKED_IMAGE_ALT_TEXT: "Checked.",\r
+\r
+\r
+    /**\r
+    * @property DISABLED_CHECKED_IMAGE_ALT_TEXT\r
+    * @description String representing the alt text for the image to be used\r
+    * for the checked image when the item is disabled.\r
+    * @default "Checked. (Item disabled.)"\r
+    * @final\r
+    * @type String\r
+    */\r
+    DISABLED_CHECKED_IMAGE_ALT_TEXT: "Checked. (Item disabled.)",\r
+\r
+    /**\r
+    * @property CSS_CLASS_NAME\r
+    * @description String representing the CSS class(es) to be applied to the\r
+    * <code>&#60;li&#62;</code> element of the menu item.\r
+    * @default "yuimenuitem"\r
+    * @final\r
+    * @type String\r
+    */\r
+    CSS_CLASS_NAME: "yuimenuitem",\r
 \r
     /**\r
-    * Constant representing the type of item to instantiate when \r
-    * creating item instances from parsing the child nodes (either \r
-    * HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-    * submenu's DOM.  \r
-    * The default is YAHOO.widget.MenuModuleItem.\r
+    * @property SUBMENU_TYPE\r
+    * @description Object representing the type of menu to instantiate and\r
+    * add when parsing the child nodes of the menu item's source HTML element.\r
     * @final\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @type YAHOO.widget.Menu\r
     */\r
-    SUBMENU_ITEM_TYPE: null,\r
+    SUBMENU_TYPE: null,\r
 \r
     /**\r
-    * Constant representing the prefix path to use for non-secure images\r
-    * @type string\r
+    * @property IMG_ROOT\r
+    * @description String representing the prefix path to use for\r
+    * non-secure images.\r
+    * @default "http://us.i1.yimg.com/us.yimg.com/i/"\r
+    * @type String\r
     */\r
     IMG_ROOT: "http://us.i1.yimg.com/us.yimg.com/i/",\r
-    \r
+\r
 \r
     /**\r
-    * Constant representing the prefix path to use for securely served images\r
-    * @type string\r
+    * @property IMG_ROOT_SSL\r
+    * @description String representing the prefix path to use for securely\r
+    * served images.\r
+    * @default "https://a248.e.akamai.net/sec.yimg.com/i/"\r
+    * @type String\r
     */\r
     IMG_ROOT_SSL: "https://a248.e.akamai.net/sec.yimg.com/i/",\r
 \r
     // Private member variables\r
-    \r
+\r
     /**\r
-    * Reference to the HTMLAnchorElement of the MenuModuleItem's core internal\r
-    * DOM structure.\r
+    * @property _oAnchor\r
+    * @description Object reference to the menu item's\r
+    * <code>&#60;a&#62;</code> element.\r
+    * @default null\r
     * @private\r
-    * @type {HTMLAnchorElement}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-48250443">HTMLAnchorElement</a>\r
     */\r
     _oAnchor: null,\r
-    \r
+\r
 \r
     /**\r
-    * Reference to the text node of the MenuModuleItem's core internal\r
-    * DOM structure.\r
+    * @property _oText\r
+    * @description Object reference to the menu item's text node.\r
+    * @default null\r
     * @private\r
-    * @type {Text}\r
+    * @type TextNode\r
     */\r
     _oText: null,\r
-    \r
-    \r
+\r
+\r
     /**\r
-    * Reference to the HTMLElement (&#60;EM&#60;) used to create the optional\r
-    * help text for a MenuModuleItem instance.\r
+    * @property _oHelpTextEM\r
+    * @description Object reference to the menu item's help text\r
+    * <code>&#60;em&#62;</code> element.\r
+    * @default null\r
     * @private\r
-    * @type {HTMLElement}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-58190037">HTMLElement</a>\r
     */\r
     _oHelpTextEM: null,\r
-    \r
-    \r
+\r
+\r
     /**\r
-    * Reference to the submenu for a MenuModuleItem instance.\r
+    * @property _oSubmenu\r
+    * @description Object reference to the menu item's submenu.\r
+    * @default null\r
     * @private\r
-    * @type {YAHOO.widget.MenuModule}\r
+    * @type YAHOO.widget.Menu\r
     */\r
     _oSubmenu: null,\r
-    \r
-    \r
+\r
     /**\r
-    * Reference to the Dom utility singleton.\r
+    * @property _checkImage\r
+    * @description Object reference to the menu item's checkmark image.\r
+    * @default null\r
     * @private\r
-    * @type {YAHOO.util.Dom}\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-17701901">HTMLImageElement</a>\r
     */\r
-    _oDom: YAHOO.util.Dom,\r
+    _checkImage: null,\r
 \r
     // Public properties\r
 \r
        /**\r
-       * The class's constructor function\r
-       * @type YAHOO.widget.MenuModuleItem\r
+    * @property constructor\r
+       * @description Object reference to the menu item's constructor function.\r
+    * @default YAHOO.widget.MenuItem\r
+       * @type YAHOO.widget.MenuItem\r
        */\r
-       constructor: YAHOO.widget.MenuModuleItem,\r
+       constructor: YAHOO.widget.MenuItem,\r
 \r
        /**\r
-       * The string representing the image root\r
-       * @type string\r
+    * @property imageRoot\r
+       * @description String representing the root path for all of the menu\r
+       * item's images.\r
+       * @type String\r
        */\r
        imageRoot: null,\r
 \r
        /**\r
-       * Boolean representing whether or not the current browsing context \r
-       * is secure (https)\r
-       * @type boolean\r
+    * @property isSecure\r
+       * @description Boolean representing whether or not the current browsing\r
+       * context is secure (HTTPS).\r
+       * @type Boolean\r
        */\r
-       isSecure: YAHOO.widget.Module.prototype.isSecure,\r
+       isSecure: Module.prototype.isSecure,\r
 \r
     /**\r
-    * Returns the ordinal position of a MenuModuleItem instance in a group.\r
+    * @property index\r
+    * @description Number indicating the ordinal position of the menu item in\r
+    * its group.\r
+    * @default null\r
     * @type Number\r
     */\r
     index: null,\r
 \r
     /**\r
-    * Returns the index of the group to which a MenuModuleItem instance belongs.\r
+    * @property groupIndex\r
+    * @description Number indicating the index of the group to which the menu\r
+    * item belongs.\r
+    * @default null\r
     * @type Number\r
     */\r
     groupIndex: null,\r
 \r
     /**\r
-    * Returns the parent object for a MenuModuleItem instance.\r
-    * @type {YAHOO.widget.MenuModule}\r
+    * @property parent\r
+    * @description Object reference to the menu item's parent menu.\r
+    * @default null\r
+    * @type YAHOO.widget.Menu\r
     */\r
     parent: null,\r
 \r
     /**\r
-    * Returns the HTMLLIElement for a MenuModuleItem instance.\r
-    * @type {HTMLLIElement}\r
+    * @property element\r
+    * @description Object reference to the menu item's\r
+    * <code>&#60;li&#62;</code> element.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level\r
+    * -one-html.html#ID-74680021">HTMLLIElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>\r
     */\r
     element: null,\r
 \r
     /**\r
-    * Returns the HTMLElement (either HTMLLIElement, HTMLOptGroupElement or\r
-    * HTMLOptionElement) used create the MenuModuleItem instance.\r
-    * @type {HTMLLIElement/HTMLOptGroupElement/HTMLOptionElement}\r
+    * @property srcElement\r
+    * @description Object reference to the HTML element (either\r
+    * <code>&#60;li&#62;</code>, <code>&#60;optgroup&#62;</code> or\r
+    * <code>&#60;option&#62;</code>) used create the menu item.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.\r
+    * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"\r
+    * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-\r
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3.\r
+    * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247">\r
+    * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-\r
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>\r
     */\r
     srcElement: null,\r
 \r
     /**\r
-    * Specifies an arbitrary value for a MenuModuleItem instance.\r
-    * @type {Object}\r
+    * @property value\r
+    * @description Object reference to the menu item's value.\r
+    * @default null\r
+    * @type Object\r
     */\r
     value: null,\r
 \r
     /**\r
-    * Reference to the HTMLImageElement used to create the submenu\r
-    * indicator for a MenuModuleItem instance.\r
-    * @type {HTMLImageElement}\r
+    * @property submenuIndicator\r
+    * @description Object reference to the <code>&#60;img&#62;</code> element\r
+    * used to create the submenu indicator for the menu item.\r
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-17701901">HTMLImageElement</a>\r
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-17701901">HTMLImageElement</a>\r
     */\r
     submenuIndicator: null,\r
 \r
        /**\r
-       * String representing the browser\r
-       * @type string\r
+    * @property browser\r
+       * @description String representing the browser.\r
+       * @type String\r
        */\r
-       browser: YAHOO.widget.Module.prototype.browser,\r
+       browser: Module.prototype.browser,\r
 \r
     // Events\r
 \r
     /**\r
-    * Fires when a MenuModuleItem instances's HTMLLIElement is removed from\r
-    * it's parent HTMLUListElement node.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event destroyEvent\r
+    * @description Fires when the menu item's <code>&#60;li&#62;</code>\r
+    * element is removed from its parent <code>&#60;ul&#62;</code> element.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     destroyEvent: null,\r
 \r
     /**\r
-    * Fires when the mouse has entered a MenuModuleItem instance.  Passes\r
+    * @event mouseOverEvent\r
+    * @description Fires when the mouse has entered the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseOverEvent: null,\r
 \r
     /**\r
-    * Fires when the mouse has left a MenuModuleItem instance.  Passes back  \r
+    * @event mouseOutEvent\r
+    * @description Fires when the mouse has left the menu item.  Passes back\r
     * the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseOutEvent: null,\r
 \r
     /**\r
-    * Fires when the user mouses down on a MenuModuleItem instance.  Passes \r
+    * @event mouseDownEvent\r
+    * @description Fires when the user mouses down on the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseDownEvent: null,\r
 \r
     /**\r
-    * Fires when the user releases a mouse button while the mouse is \r
-    * over a MenuModuleItem instance.  Passes back the DOM Event object as\r
-    * an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event mouseUpEvent\r
+    * @description Fires when the user releases a mouse button while the mouse\r
+    * is over the menu item.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     mouseUpEvent: null,\r
 \r
     /**\r
-    * Fires when the user clicks the on a MenuModuleItem instance.  Passes \r
+    * @event clickEvent\r
+    * @description Fires when the user clicks the on the menu item.  Passes\r
     * back the DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     clickEvent: null,\r
 \r
     /**\r
-    * Fires when the user presses an alphanumeric key.  Passes back the \r
-    * DOM Event object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyPressEvent\r
+    * @description Fires when the user presses an alphanumeric key when the\r
+    * menu item has focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyPressEvent: null,\r
 \r
     /**\r
-    * Fires when the user presses a key.  Passes back the DOM Event \r
-    * object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyDownEvent\r
+    * @description Fires when the user presses a key when the menu item has\r
+    * focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyDownEvent: null,\r
 \r
     /**\r
-    * Fires when the user releases a key.  Passes back the DOM Event \r
-    * object as an argument.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event keyUpEvent\r
+    * @description Fires when the user releases a key when the menu item has\r
+    * focus.  Passes back the DOM Event object as an argument.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     keyUpEvent: null,\r
 \r
     /**\r
-    * Fires when a MenuModuleItem instance receives focus.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event focusEvent\r
+    * @description Fires when the menu item receives focus.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     focusEvent: null,\r
 \r
     /**\r
-    * Fires when a MenuModuleItem instance loses the input focus.\r
-    * @type {YAHOO.util.CustomEvent}\r
-    * @see YAHOO.util.CustomEvent\r
+    * @event blurEvent\r
+    * @description Fires when the menu item loses the input focus.\r
+    * @type YAHOO.util.CustomEvent\r
     */\r
     blurEvent: null,\r
 \r
     /**\r
-    * The MenuModuleItem class's initialization method. This method is \r
-    * automatically called by the constructor, and sets up all DOM references \r
+    * @method init\r
+    * @description The MenuItem class's initialization method. This method is\r
+    * automatically called by the constructor, and sets up all DOM references\r
     * for pre-existing markup, and creates required markup if it is not\r
     * already present.\r
-    * @param {String or HTMLElement} p_oObject String or HTMLElement \r
-    * (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-    * source HTMLElement node.\r
-    * @param {Object} p_oConfig The configuration object literal containing \r
-    * the configuration for a MenuModuleItem instance. See the configuration \r
-    * class documentation for more details.\r
+    * @param {String} p_oObject String specifying the text of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying\r
+    * the <code>&#60;li&#62;</code> element of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+    * specifying the <code>&#60;optgroup&#62;</code> element of the menu item.\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+    * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object\r
+    * specifying the <code>&#60;option&#62;</code> element of the menu item.\r
+    * @param {Object} p_oConfig Optional. Object literal specifying the\r
+    * configuration for the menu item. See configuration class documentation\r
+    * for more details.\r
     */\r
     init: function(p_oObject, p_oConfig) {\r
 \r
         this.imageRoot = (this.isSecure) ? this.IMG_ROOT_SSL : this.IMG_ROOT;\r
 \r
         if(!this.SUBMENU_TYPE) {\r
-    \r
-            this.SUBMENU_TYPE = YAHOO.widget.MenuModule;\r
-    \r
-        }\r
 \r
-        if(!this.SUBMENU_ITEM_TYPE) {\r
-    \r
-            this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuModuleItem;\r
-    \r
+            this.SUBMENU_TYPE = Menu;\r
+\r
         }\r
 \r
         // Create the config object\r
@@ -2681,7 +4333,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
         }\r
         else if(this._checkDOMNode(p_oObject)) {\r
 \r
-            switch(p_oObject.tagName) {\r
+            switch(p_oObject.tagName.toUpperCase()) {\r
 \r
                 case "OPTION":\r
 \r
@@ -2711,6 +4363,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                     var oAnchor = this._getFirstElement(p_oObject, "A");\r
                     var sURL = "#";\r
+                    var sTarget = null;\r
                     var sText = null;\r
 \r
                     // Capture the "text" and/or the "URL"\r
@@ -2718,20 +4371,21 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     if(oAnchor) {\r
 \r
                         sURL = oAnchor.getAttribute("href");\r
+                        sTarget = oAnchor.getAttribute("target");\r
 \r
                         if(oAnchor.innerText) {\r
-                \r
+\r
                             sText = oAnchor.innerText;\r
-                \r
+\r
                         }\r
                         else {\r
-                \r
+\r
                             var oRange = oAnchor.ownerDocument.createRange();\r
-                \r
+\r
                             oRange.selectNodeContents(oAnchor);\r
-                \r
-                            sText = oRange.toString();             \r
-                \r
+\r
+                            sText = oRange.toString();\r
+\r
                         }\r
 \r
                     }\r
@@ -2742,11 +4396,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
                         sText = oText.nodeValue;\r
 \r
                         oAnchor = document.createElement("a");\r
-                        \r
+\r
                         oAnchor.setAttribute("href", sURL);\r
 \r
                         p_oObject.replaceChild(oAnchor, oText);\r
-                        \r
+\r
                         oAnchor.appendChild(oText);\r
 \r
                     }\r
@@ -2754,9 +4408,9 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     this.srcElement = p_oObject;\r
                     this.element = p_oObject;\r
                     this._oAnchor = oAnchor;\r
-    \r
 \r
-                    // Check if emphasis has been applied to the MenuModuleItem\r
+\r
+                    // Check if emphasis has been applied to the MenuItem\r
 \r
                     var oEmphasisNode = this._getFirstElement(oAnchor);\r
                     var bEmphasis = false;\r
@@ -2764,11 +4418,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                     if(oEmphasisNode) {\r
 \r
-                        // Set a reference to the text node \r
+                        // Set a reference to the text node\r
 \r
                         this._oText = oEmphasisNode.firstChild;\r
 \r
-                        switch(oEmphasisNode.tagName) {\r
+                        switch(oEmphasisNode.tagName.toUpperCase()) {\r
 \r
                             case "EM":\r
 \r
@@ -2787,24 +4441,25 @@ YAHOO.widget.MenuModuleItem.prototype = {
                     }\r
                     else {\r
 \r
-                        // Set a reference to the text node \r
+                        // Set a reference to the text node\r
 \r
                         this._oText = oAnchor.firstChild;\r
 \r
                     }\r
 \r
                     /*\r
-                        Set these properties silently to sync up the \r
-                        configuration object without making changes to the \r
+                        Set these properties silently to sync up the\r
+                        configuration object without making changes to the\r
                         element's DOM\r
-                    */ \r
+                    */\r
 \r
                     oConfig.setProperty("text", sText, true);\r
                     oConfig.setProperty("url", sURL, true);\r
+                    oConfig.setProperty("target", sTarget, true);\r
                     oConfig.setProperty("emphasis", bEmphasis, true);\r
                     oConfig.setProperty(\r
-                        "strongemphasis", \r
-                        bStrongEmphasis, \r
+                        "strongemphasis",\r
+                        bStrongEmphasis,\r
                         true\r
                     );\r
 \r
@@ -2812,18 +4467,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                 break;\r
 \r
-            }            \r
+            }\r
 \r
         }\r
 \r
         if(this.element) {\r
 \r
-            this._oDom.addClass(this.element, this.CSS_CLASS_NAME);\r
+            Dom.addClass(this.element, this.CSS_CLASS_NAME);\r
 \r
             // Create custom events\r
-    \r
+\r
             var CustomEvent = YAHOO.util.CustomEvent;\r
-    \r
+\r
             this.destroyEvent = new CustomEvent("destroyEvent", this);\r
             this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
             this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
@@ -2837,10 +4492,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
             this.blurEvent = new CustomEvent("blurEvent", this);\r
 \r
             if(p_oConfig) {\r
-    \r
+\r
                 oConfig.applyConfig(p_oConfig);\r
-    \r
-            }        \r
+\r
+            }\r
 \r
             oConfig.fireQueue();\r
 \r
@@ -2851,12 +4506,16 @@ YAHOO.widget.MenuModuleItem.prototype = {
     // Private methods\r
 \r
     /**\r
-    * Returns an HTMLElement's first HTMLElement node\r
+    * @method _getFirstElement\r
+    * @description Returns an HTML element's first HTML element node.\r
     * @private\r
-    * @param {HTMLElement} p_oElement The element to be evaluated.\r
-    * @param {String} p_sTagName Optional. The tagname of the element.\r
-    * @return Returns an HTMLElement node.\r
-    * @type Boolean\r
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object\r
+    * reference specifying the element to be evaluated.\r
+    * @param {String} p_sTagName Optional. String specifying the tagname of\r
+    * the element to be retrieved.\r
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>}\r
     */\r
     _getFirstElement: function(p_oElement, p_sTagName) {\r
 \r
@@ -2868,8 +4527,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         }\r
         else if(\r
-            p_oElement.firstChild && \r
-            p_oElement.firstChild.nextSibling && \r
+            p_oElement.firstChild &&\r
+            p_oElement.firstChild.nextSibling &&\r
             p_oElement.firstChild.nextSibling.nodeType == 1\r
         ) {\r
 \r
@@ -2879,7 +4538,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         if(p_sTagName) {\r
 \r
-            return (oElement && oElement.tagName == p_sTagName) ? \r
+            return (oElement && oElement.tagName.toUpperCase() == p_sTagName) ?\r
                 oElement : false;\r
 \r
         }\r
@@ -2889,11 +4548,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Determines if an object is a string\r
+    * @method _checkString\r
+    * @description Determines if an object is a string.\r
     * @private\r
-    * @param {Object} p_oObject The object to be evaluated.\r
-    * @return Returns true if the object is a string.\r
-    * @type Boolean\r
+    * @param {Object} p_oObject Object to be evaluated.\r
+    * @return {Boolean}\r
     */\r
     _checkString: function(p_oObject) {\r
 \r
@@ -2902,11 +4561,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Determines if an object is an HTMLElement.\r
+    * @method _checkDOMNode\r
+    * @description Determines if an object is an HTML element.\r
     * @private\r
-    * @param {Object} p_oObject The object to be evaluated.\r
-    * @return Returns true if the object is an HTMLElement.\r
-    * @type Boolean\r
+    * @param {Object} p_oObject Object to be evaluated.\r
+    * @return {Boolean}\r
     */\r
     _checkDOMNode: function(p_oObject) {\r
 \r
@@ -2915,7 +4574,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Creates the core DOM structure for a MenuModuleItem instance.\r
+    * @method _createRootNodeStructure\r
+    * @description Creates the core DOM structure for the menu item.\r
     * @private\r
     */\r
     _createRootNodeStructure: function () {\r
@@ -2926,81 +4586,126 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         this._oAnchor = document.createElement("a");\r
         this._oAnchor.appendChild(this._oText);\r
-        \r
+\r
         this.cfg.refireEvent("url");\r
 \r
-        this.element.appendChild(this._oAnchor);            \r
+        this.element.appendChild(this._oAnchor);\r
 \r
     },\r
 \r
     /**\r
-    * Iterates the source element's childNodes collection and uses the  \r
-    * child nodes to instantiate other menus.\r
+    * @method _initSubTree\r
+    * @description Iterates the source element's childNodes collection and uses\r
+    * the child nodes to instantiate other menus.\r
     * @private\r
     */\r
     _initSubTree: function() {\r
 \r
-        var Menu = this.SUBMENU_TYPE;\r
-        var MenuModuleItem = this.SUBMENU_ITEM_TYPE;\r
         var oSrcEl = this.srcElement;\r
         var oConfig = this.cfg;\r
 \r
         if(oSrcEl.childNodes.length > 0) {\r
 \r
-            var oNode = oSrcEl.firstChild;\r
-            var aOptions = [];\r
+            if(\r
+                this.parent.lazyLoad &&\r
+                this.parent.srcElement &&\r
+                this.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
+            ) {\r
 \r
-            do {\r
+                oConfig.setProperty(\r
+                        "submenu",\r
+                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }\r
+                    );\r
 \r
-                switch(oNode.tagName) {\r
-        \r
-                    case "DIV":\r
-        \r
-                        oConfig.setProperty("submenu", (new Menu(oNode)));\r
-        \r
-                    break;\r
\r
-                    case "OPTION":\r
+            }\r
+            else {\r
 \r
-                        aOptions[aOptions.length] = oNode;\r
+                var oNode = oSrcEl.firstChild;\r
+                var aOptions = [];\r
+\r
+                do {\r
+\r
+                    if(oNode && oNode.tagName) {\r
+\r
+                        switch(oNode.tagName.toUpperCase()) {\r
+\r
+                            case "DIV":\r
+\r
+                                oConfig.setProperty("submenu", oNode);\r
+\r
+                            break;\r
+\r
+                            case "OPTION":\r
+\r
+                                aOptions[aOptions.length] = oNode;\r
+\r
+                            break;\r
+\r
+                        }\r
+\r
+                    }\r
 \r
-                    break;\r
-       \r
                 }\r
-            \r
-            }        \r
-            while((oNode = oNode.nextSibling));\r
+                while((oNode = oNode.nextSibling));\r
 \r
-            var nOptions = aOptions.length;\r
 \r
-            if(nOptions > 0) {\r
-    \r
-                oConfig.setProperty(\r
-                    "submenu", \r
-                    (new Menu(this._oDom.generateId()))\r
-                );\r
-    \r
-                for(var n=0; n<nOptions; n++) {\r
-    \r
-                    this._oSubmenu.addItem((new MenuModuleItem(aOptions[n])));\r
-    \r
+                var nOptions = aOptions.length;\r
+\r
+                if(nOptions > 0) {\r
+\r
+                    var oMenu = new this.SUBMENU_TYPE(Dom.generateId());\r
+\r
+                    oConfig.setProperty("submenu", oMenu);\r
+\r
+                    for(var n=0; n<nOptions; n++) {\r
+\r
+                        oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));\r
+\r
+                    }\r
+\r
                 }\r
-    \r
+\r
             }\r
 \r
         }\r
 \r
     },\r
 \r
+    /**\r
+    * @method _preloadImage\r
+    * @description Preloads an image by creating an image element from the\r
+    * specified path and appending the image to the body of the document.\r
+    * @private\r
+    * @param {String} p_sPath String specifying the path to the image.\r
+    */\r
+    _preloadImage: function(p_sPath) {\r
+\r
+        var sPath = this.imageRoot + p_sPath;\r
+\r
+        if(!document.images[sPath]) {\r
+\r
+            var oImage = document.createElement("img");\r
+            oImage.src = sPath;\r
+            oImage.name = sPath;\r
+            oImage.id = sPath;\r
+            oImage.style.display = "none";\r
+\r
+            document.body.appendChild(oImage);\r
+\r
+        }\r
+\r
+    },\r
+\r
     // Event handlers for configuration properties\r
 \r
     /**\r
-    * Event handler for when the "text" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configText\r
+    * @description Event handler for when the "text" configuration property of\r
+    * the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
     */\r
     configText: function(p_sType, p_aArgs, p_oItem) {\r
@@ -3016,18 +4721,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Event handler for when the "helptext" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configHelpText\r
+    * @description Event handler for when the "helptext" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var me = this;\r
-        var Dom = this._oDom;\r
         var oHelpText = p_aArgs[0];\r
         var oEl = this.element;\r
         var oConfig = this.cfg;\r
@@ -3035,11 +4740,11 @@ YAHOO.widget.MenuModuleItem.prototype = {
         var oImg = this.submenuIndicator;\r
 \r
         /**\r
-        * Adds the "hashelptext" class to the necessary nodes and refires the \r
-        * "selected" and "disabled" configuration events\r
-        * @ignore\r
+        * Adds the "hashelptext" class to the necessary nodes and refires the\r
+        * "selected" and "disabled" configuration events.\r
+        * @private\r
         */\r
-        function initHelpText() {\r
+        var initHelpText = function() {\r
 \r
             Dom.addClass(aNodes, "hashelptext");\r
 \r
@@ -3053,29 +4758,29 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
                 oConfig.refireEvent("selected");\r
 \r
-            }                \r
+            }\r
 \r
-        }\r
+        };\r
 \r
         /**\r
-        * Removes the "hashelptext" class and corresponding DOM element (EM)\r
-        * @ignore\r
+        * Removes the "hashelptext" class and corresponding DOM element (EM).\r
+        * @private\r
         */\r
-        function removeHelpText() {\r
+        var removeHelpText = function() {\r
 \r
             Dom.removeClass(aNodes, "hashelptext");\r
 \r
             oEl.removeChild(me._oHelpTextEM);\r
             me._oHelpTextEM = null;\r
 \r
-        }\r
+        };\r
 \r
         if(this._checkDOMNode(oHelpText)) {\r
 \r
             if(this._oHelpTextEM) {\r
 \r
                 this._oHelpTextEM.parentNode.replaceChild(\r
-                    oHelpText, \r
+                    oHelpText,\r
                     this._oHelpTextEM\r
                 );\r
 \r
@@ -3124,14 +4829,15 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Event handler for when the "url" configuration property of\r
-    * a MenuModuleItem instance changes.  \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configURL\r
+    * @description Event handler for when the "url" configuration property of\r
+    * the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configURL: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var sURL = p_aArgs[0];\r
@@ -3147,14 +4853,43 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Event handler for when the "emphasis" configuration property of\r
-    * a MenuModuleItem instance changes.  \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configTarget\r
+    * @description Event handler for when the "target" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    configTarget: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+        var sTarget = p_aArgs[0];\r
+        var oAnchor = this._oAnchor;\r
+\r
+        if(sTarget && sTarget.length > 0) {\r
+\r
+            oAnchor.setAttribute("target", sTarget);\r
+\r
+        }\r
+        else {\r
+\r
+            oAnchor.removeAttribute("target");\r
+\r
+        }\r
+\r
+    },\r
+\r
+    /**\r
+    * @method configEmphasis\r
+    * @description Event handler for when the "emphasis" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bEmphasis = p_aArgs[0];\r
@@ -3193,14 +4928,15 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Event handler for when the "strongemphasis" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configStrongEmphasis\r
+    * @description Event handler for when the "strongemphasis" configuration\r
+    * property of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bStrongEmphasis = p_aArgs[0];\r
@@ -3209,55 +4945,131 @@ YAHOO.widget.MenuModuleItem.prototype = {
         var oConfig = this.cfg;\r
         var oStrong;\r
 \r
-        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {\r
+        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {\r
+\r
+            oConfig.setProperty("emphasis", false);\r
+\r
+        }\r
+\r
+        if(oAnchor) {\r
+\r
+            if(bStrongEmphasis) {\r
+\r
+                oStrong = document.createElement("strong");\r
+                oStrong.appendChild(oText);\r
+\r
+                oAnchor.appendChild(oStrong);\r
+\r
+            }\r
+            else {\r
+\r
+                oStrong = this._getFirstElement(oAnchor, "STRONG");\r
+\r
+                oAnchor.removeChild(oStrong);\r
+                oAnchor.appendChild(oText);\r
+\r
+            }\r
+\r
+        }\r
+\r
+    },\r
+\r
+    /**\r
+    * @method configChecked\r
+    * @description Event handler for when the "checked" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
+    * that fired the event.\r
+    */\r
+    configChecked: function(p_sType, p_aArgs, p_oItem) {\r
+\r
+        var bChecked = p_aArgs[0];\r
+        var oEl = this.element;\r
+        var oConfig = this.cfg;\r
+        var oImg;\r
+\r
+\r
+        if(bChecked) {\r
+\r
+            this._preloadImage(this.CHECKED_IMAGE_PATH);\r
+            this._preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);\r
+            this._preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);\r
+\r
+            oImg = document.createElement("img");\r
+            oImg.src = (this.imageRoot + this.CHECKED_IMAGE_PATH);\r
+            oImg.alt = this.CHECKED_IMAGE_ALT_TEXT;\r
+\r
+            var oSubmenu = this.cfg.getProperty("submenu");\r
+\r
+            if(oSubmenu) {\r
+\r
+                oEl.insertBefore(oImg, oSubmenu.element);\r
+\r
+            }\r
+            else {\r
+\r
+                oEl.appendChild(oImg);\r
+\r
+            }\r
+\r
+            Dom.addClass([oEl, oImg], "checked");\r
+\r
+            this._checkImage = oImg;\r
+\r
+            if(oConfig.getProperty("disabled")) {\r
+\r
+                oConfig.refireEvent("disabled");\r
+\r
+            }\r
+\r
+            if(oConfig.getProperty("selected")) {\r
+\r
+                oConfig.refireEvent("selected");\r
 \r
-            oConfig.setProperty("emphasis", false);\r
+            }\r
 \r
         }\r
+        else {\r
 \r
-        if(oAnchor) {\r
+            oImg = this._checkImage;\r
 \r
-            if(bStrongEmphasis) {\r
+            Dom.removeClass([oEl, oImg], "checked");\r
 \r
-                oStrong = document.createElement("strong");\r
-                oStrong.appendChild(oText);\r
+            if(oImg) {\r
 \r
-                oAnchor.appendChild(oStrong);\r
+                oEl.removeChild(oImg);\r
 \r
             }\r
-            else {\r
-\r
-                oStrong = this._getFirstElement(oAnchor, "STRONG");\r
-\r
-                oAnchor.removeChild(oStrong);\r
-                oAnchor.appendChild(oText);\r
 \r
-            }\r
+            this._checkImage = null;\r
 \r
         }\r
 \r
     },\r
 \r
     /**\r
-    * Event handler for when the "disabled" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configDisabled\r
+    * @description Event handler for when the "disabled" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         var bDisabled = p_aArgs[0];\r
-        var Dom = this._oDom;\r
         var oAnchor = this._oAnchor;\r
         var aNodes = [this.element, oAnchor];\r
         var oEM = this._oHelpTextEM;\r
         var oConfig = this.cfg;\r
-        var oImg = this.submenuIndicator;\r
-        var sImageSrc;\r
-        var sImageAlt;\r
+        var oImg;\r
+        var sImgSrc;\r
+        var sImgAlt;\r
 \r
         if(oEM) {\r
 \r
@@ -3265,6 +5077,26 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         }\r
 \r
+        if(this.cfg.getProperty("checked")) {\r
+\r
+            sImgAlt = this.CHECKED_IMAGE_ALT_TEXT;\r
+            sImgSrc = this.CHECKED_IMAGE_PATH;\r
+            oImg = this._checkImage;\r
+\r
+            if(bDisabled) {\r
+\r
+                sImgAlt = this.DISABLED_CHECKED_IMAGE_ALT_TEXT;\r
+                sImgSrc = this.DISABLED_CHECKED_IMAGE_PATH;\r
+\r
+            }\r
+\r
+            oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
+            oImg.alt = sImgAlt;\r
+\r
+        }\r
+\r
+        oImg = this.submenuIndicator;\r
+\r
         if(bDisabled) {\r
 \r
             if(oConfig.getProperty("selected")) {\r
@@ -3277,8 +5109,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             Dom.addClass(aNodes, "disabled");\r
 \r
-            sImageSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImageAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
+            sImgSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
+            sImgAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
 \r
         }\r
         else {\r
@@ -3287,62 +5119,78 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             Dom.removeClass(aNodes, "disabled");\r
 \r
-            sImageSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImageAlt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+            sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
+            sImgAlt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
 \r
         }\r
 \r
         if(oImg) {\r
 \r
-            oImg.src = this.imageRoot + sImageSrc;\r
-            oImg.alt = sImageAlt;\r
+            oImg.src = this.imageRoot + sImgSrc;\r
+            oImg.alt = sImgAlt;\r
 \r
         }\r
 \r
     },\r
 \r
     /**\r
-    * Event handler for when the "selected" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configSelected\r
+    * @description Event handler for when the "selected" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
-    */    \r
+    */\r
     configSelected: function(p_sType, p_aArgs, p_oItem) {\r
 \r
         if(!this.cfg.getProperty("disabled")) {\r
 \r
-            var Dom = this._oDom;\r
             var bSelected = p_aArgs[0];\r
             var oEM = this._oHelpTextEM;\r
             var aNodes = [this.element, this._oAnchor];\r
             var oImg = this.submenuIndicator;\r
-            var sImageSrc;\r
+            var sImgSrc;\r
 \r
             if(oEM) {\r
-    \r
-                aNodes[2] = oEM;  \r
-    \r
+\r
+                aNodes[aNodes.length] = oEM;\r
+\r
+            }\r
+\r
+            if(oImg) {\r
+\r
+                aNodes[aNodes.length] = oImg;\r
+\r
+            }\r
+\r
+\r
+            if(this.cfg.getProperty("checked")) {\r
+\r
+                sImgSrc = this.imageRoot + (bSelected ?\r
+                    this.SELECTED_CHECKED_IMAGE_PATH : this.CHECKED_IMAGE_PATH);\r
+\r
+                this._checkImage.src = document.images[sImgSrc].src;\r
+\r
             }\r
-    \r
+\r
             if(bSelected) {\r
-    \r
+\r
                 Dom.addClass(aNodes, "selected");\r
-                sImageSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
+                sImgSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
+\r
             }\r
             else {\r
-    \r
+\r
                 Dom.removeClass(aNodes, "selected");\r
-                sImageSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
+                sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
+\r
             }\r
-    \r
+\r
             if(oImg) {\r
-    \r
-                oImg.src = document.images[(this.imageRoot + sImageSrc)].src;\r
+\r
+                oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
 \r
             }\r
 \r
@@ -3351,78 +5199,109 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Event handler for when the "submenu" configuration property of\r
-    * a MenuModuleItem instance changes. \r
-    * @param {String} p_sType The name of the event that was fired.\r
-    * @param {Array} p_aArgs Collection of arguments sent when the \r
-    * event was fired.\r
-    * @param {YAHOO.widget.MenuModuleItem} p_oItem The MenuModuleItem instance \r
+    * @method configSubmenu\r
+    * @description Event handler for when the "submenu" configuration property\r
+    * of the menu item changes.\r
+    * @param {String} p_sType String representing the name of the event that\r
+    * was fired.\r
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
     * that fired the event.\r
     */\r
     configSubmenu: function(p_sType, p_aArgs, p_oItem) {\r
 \r
-        var Dom = this._oDom;\r
         var oEl = this.element;\r
         var oSubmenu = p_aArgs[0];\r
         var oImg = this.submenuIndicator;\r
         var oConfig = this.cfg;\r
         var aNodes = [this.element, this._oAnchor];\r
+        var oMenu;\r
+        var bLazyLoad = this.parent && this.parent.lazyLoad;\r
 \r
         if(oSubmenu) {\r
 \r
-            // Set the submenu's parent to this MenuModuleItem instance\r
+            if(oSubmenu instanceof Menu) {\r
 \r
-            oSubmenu.parent = this;\r
+                oMenu = oSubmenu;\r
+                oMenu.parent = this;\r
+                oMenu.lazyLoad = bLazyLoad;\r
 \r
-            this._oSubmenu = oSubmenu;\r
+            }\r
+            else if(\r
+                typeof oSubmenu == "object" &&\r
+                oSubmenu.id &&\r
+                !oSubmenu.nodeType\r
+            ) {\r
 \r
-            if(!oImg) { \r
+                var sSubmenuId = oSubmenu.id;\r
+                var oSubmenuConfig = oSubmenu;\r
 \r
-                var me = this;\r
+                delete oSubmenu["id"];\r
 \r
-                function preloadImage(p_sPath) {\r
+                oSubmenuConfig.lazyload = bLazyLoad;\r
+                oSubmenuConfig.parent = this;\r
 \r
-                    var sPath = me.imageRoot + p_sPath;\r
+                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);\r
 \r
-                    if(!document.images[sPath]) {\r
+                // Set the value of the property to the Menu instance\r
 \r
-                        var oImg = document.createElement("img");\r
-                        oImg.src = sPath;\r
-                        oImg.name = sPath;\r
-                        oImg.id = sPath;\r
-                        oImg.style.display = "none";\r
-                        \r
-                        document.body.appendChild(oImg);\r
+                this.cfg.setProperty("submenu", oMenu, true);\r
 \r
-                    }\r
-                \r
-                }\r
+            }\r
+            else {\r
+\r
+                oMenu = new this.SUBMENU_TYPE(\r
+                                oSubmenu,\r
+                                { lazyload: bLazyLoad, parent: this }\r
+                            );\r
 \r
-                preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);\r
-                preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);\r
-                preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);\r
+                // Set the value of the property to the Menu instance\r
 \r
-                oImg = document.createElement("img");\r
-                oImg.src = (this.imageRoot + this.SUBMENU_INDICATOR_IMAGE_PATH);\r
-                oImg.alt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+                this.cfg.setProperty("submenu", oMenu, true);\r
 \r
-                oEl.appendChild(oImg);\r
+            }\r
 \r
-                this.submenuIndicator = oImg;\r
+            if(oMenu) {\r
 \r
-                Dom.addClass(aNodes, "hassubmenu");\r
+                this._oSubmenu = oMenu;\r
 \r
-                if(oConfig.getProperty("disabled")) {\r
+                if(!oImg) {\r
 \r
-                    oConfig.refireEvent("disabled");\r
+                    this._preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);\r
+                    this._preloadImage(\r
+                            this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+                        );\r
 \r
-                }\r
+                    this._preloadImage(\r
+                            this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+                        );\r
+\r
+                    oImg = document.createElement("img");\r
+\r
+                    oImg.src =\r
+                        (this.imageRoot + this.SUBMENU_INDICATOR_IMAGE_PATH);\r
+\r
+                    oImg.alt = this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
+\r
+                    oEl.appendChild(oImg);\r
+\r
+                    this.submenuIndicator = oImg;\r
+\r
+                    Dom.addClass(aNodes, "hassubmenu");\r
+\r
+                    if(oConfig.getProperty("disabled")) {\r
+\r
+                        oConfig.refireEvent("disabled");\r
 \r
-                if(oConfig.getProperty("selected")) {\r
+                    }\r
+\r
+                    if(oConfig.getProperty("selected")) {\r
 \r
-                    oConfig.refireEvent("selected");\r
+                        oConfig.refireEvent("selected");\r
+\r
+                    }\r
 \r
-                }                \r
+                }\r
 \r
             }\r
 \r
@@ -3450,7 +5329,8 @@ YAHOO.widget.MenuModuleItem.prototype = {
     // Public methods\r
 \r
        /**\r
-       * Initializes an item's configurable properties.\r
+    * @method initDefaultConfig\r
+       * @description Initializes an item's configurable properties.\r
        */\r
        initDefaultConfig : function() {\r
 \r
@@ -3459,33 +5339,92 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
         // Define the config properties\r
 \r
+        /**\r
+        * @config text\r
+        * @description String specifying the text label for the menu item.\r
+        * When building a menu from existing HTML the value of this property\r
+        * will be interpreted from the menu's markup.\r
+        * @default ""\r
+        * @type String\r
+        */\r
         oConfig.addProperty(\r
-            "text", \r
-            { \r
-                value: "", \r
-                handler: this.configText, \r
-                validator: this._checkString, \r
-                suppressEvent: true \r
+            "text",\r
+            {\r
+                value: "",\r
+                handler: this.configText,\r
+                validator: this._checkString,\r
+                suppressEvent: true\r
             }\r
         );\r
-        \r
+\r
+\r
+        /**\r
+        * @config helptext\r
+        * @description String specifying additional instructional text to\r
+        * accompany the text for the nenu item.\r
+        * @default null\r
+        * @type String|<a href="http://www.w3.org/TR/\r
+        * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">\r
+        * HTMLElement</a>\r
+        */\r
         oConfig.addProperty("helptext", { handler: this.configHelpText });\r
-        \r
+\r
+        /**\r
+        * @config url\r
+        * @description String specifying the URL for the menu item's anchor's\r
+        * "href" attribute.  When building a menu from existing HTML the value\r
+        * of this property will be interpreted from the menu's markup.\r
+        * @default "#"\r
+        * @type String\r
+        */\r
         oConfig.addProperty(\r
-            "url", \r
+            "url",\r
             { value: "#", handler: this.configURL, suppressEvent: true }\r
         );\r
-        \r
+\r
+        /**\r
+        * @config target\r
+        * @description String specifying the value for the "target" attribute\r
+        * of the menu item's anchor element. <strong>Specifying a target will\r
+        * require the user to click directly on the menu item's anchor node in\r
+        * order to cause the browser to navigate to the specified URL.</strong>\r
+        * When building a menu from existing HTML the value of this property\r
+        * will be interpreted from the menu's markup.\r
+        * @default null\r
+        * @type String\r
+        */\r
+        oConfig.addProperty(\r
+            "target",\r
+            { handler: this.configTarget, suppressEvent: true }\r
+        );\r
+\r
+        /**\r
+        * @config emphasis\r
+        * @description Boolean indicating if the text of the menu item will be\r
+        * rendered with emphasis.  When building a menu from existing HTML the\r
+        * value of this property will be interpreted from the menu's markup.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
-            "emphasis", \r
-            { \r
-                value: false, \r
-                handler: this.configEmphasis, \r
-                validator: CheckBoolean, \r
-                suppressEvent: true \r
+            "emphasis",\r
+            {\r
+                value: false,\r
+                handler: this.configEmphasis,\r
+                validator: CheckBoolean,\r
+                suppressEvent: true\r
             }\r
         );\r
 \r
+        /**\r
+        * @config strongemphasis\r
+        * @description Boolean indicating if the text of the menu item will be\r
+        * rendered with strong emphasis.  When building a menu from existing\r
+        * HTML the value of this property will be interpreted from the\r
+        * menu's markup.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "strongemphasis",\r
             {\r
@@ -3496,6 +5435,32 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+        /**\r
+        * @config checked\r
+        * @description Boolean indicating if the menu item should be rendered\r
+        * with a checkmark.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
+        oConfig.addProperty(\r
+            "checked",\r
+            {\r
+                value: false,\r
+                handler: this.configChecked,\r
+                validator: this.cfg.checkBoolean,\r
+                suppressEvent: true,\r
+                supercedes:["disabled"]\r
+            }\r
+        );\r
+\r
+        /**\r
+        * @config disabled\r
+        * @description Boolean indicating if the menu item should be disabled.\r
+        * (Disabled menu items are  dimmed and will not respond to user input\r
+        * or fire events.)\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "disabled",\r
             {\r
@@ -3506,6 +5471,13 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+        /**\r
+        * @config selected\r
+        * @description Boolean indicating if the menu item should\r
+        * be highlighted.\r
+        * @default false\r
+        * @type Boolean\r
+        */\r
         oConfig.addProperty(\r
             "selected",\r
             {\r
@@ -3516,171 +5488,193 @@ YAHOO.widget.MenuModuleItem.prototype = {
             }\r
         );\r
 \r
+        /**\r
+        * @config submenu\r
+        * @description Object specifying the submenu to be appended to the\r
+        * menu item.  The value can be one of the following: <ul><li>Object\r
+        * specifying a Menu instance.</li><li>Object literal specifying the\r
+        * menu to be created.  Format: <code>{ id: [menu id], itemdata:\r
+        * [<a href="YAHOO.widget.Menu.html#itemData">array of values for\r
+        * items</a>] }</code>.</li><li>String specifying the id attribute\r
+        * of the <code>&#60;div&#62;</code> element of the menu.</li><li>\r
+        * Object specifying the <code>&#60;div&#62;</code> element of the\r
+        * menu.</li></ul>\r
+        * @default null\r
+        * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/\r
+        * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">\r
+        * HTMLElement</a>\r
+        */\r
         oConfig.addProperty("submenu", { handler: this.configSubmenu });\r
 \r
        },\r
 \r
     /**\r
-    * Finds the next enabled MenuModuleItem instance in a MenuModule instance \r
-    * @return Returns a MenuModuleItem instance.\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @method getNextEnabledSibling\r
+    * @description Finds the menu item's next enabled sibling.\r
+    * @return YAHOO.widget.MenuItem\r
     */\r
     getNextEnabledSibling: function() {\r
 \r
-        if(this.parent instanceof YAHOO.widget.MenuModule) {\r
+        if(this.parent instanceof Menu) {\r
 \r
             var nGroupIndex = this.groupIndex;\r
 \r
             /**\r
-            * Returns the next item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
+            * Finds the next item in an array.\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
             */\r
-            function getNextArrayItem(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] || \r
+            var getNextArrayItem = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ||\r
                     getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
-    \r
+\r
+            };\r
+\r
+\r
             var aItemGroups = this.parent.getItemGroups();\r
             var oNextItem;\r
-    \r
-    \r
+\r
+\r
             if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
-    \r
+\r
                 oNextItem = getNextArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
+                        aItemGroups[nGroupIndex],\r
                         (this.index+1)\r
                     );\r
-    \r
+\r
             }\r
             else {\r
-    \r
+\r
                 var nNextGroupIndex;\r
-    \r
+\r
                 if(nGroupIndex < (aItemGroups.length - 1)) {\r
-    \r
+\r
                     nNextGroupIndex = nGroupIndex + 1;\r
-    \r
+\r
                 }\r
                 else {\r
-    \r
+\r
                     nNextGroupIndex = 0;\r
-    \r
+\r
                 }\r
-    \r
+\r
                 var aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);\r
-    \r
-                // Retrieve the first MenuModuleItem instance in the next group\r
-    \r
+\r
+                // Retrieve the first menu item in the next group\r
+\r
                 oNextItem = getNextArrayItem(aNextGroup, 0);\r
-    \r
+\r
             }\r
-    \r
-            return oNextItem.cfg.getProperty("disabled") ? \r
-                        oNextItem.getNextEnabledSibling() : oNextItem;\r
+\r
+            return (\r
+                oNextItem.cfg.getProperty("disabled") ||\r
+                oNextItem.element.style.display == "none"\r
+            ) ?\r
+            oNextItem.getNextEnabledSibling() : oNextItem;\r
 \r
         }\r
 \r
     },\r
 \r
     /**\r
-    * Finds the previous enabled MenuModuleItem instance in a \r
-    * MenuModule instance \r
-    * @return Returns a MenuModuleItem instance.\r
-    * @type YAHOO.widget.MenuModuleItem\r
+    * @method getPreviousEnabledSibling\r
+    * @description Finds the menu item's previous enabled sibling.\r
+    * @return {YAHOO.widget.MenuItem}\r
     */\r
     getPreviousEnabledSibling: function() {\r
 \r
-        if(this.parent instanceof YAHOO.widget.MenuModule) {\r
+        if(this.parent instanceof Menu) {\r
 \r
             var nGroupIndex = this.groupIndex;\r
 \r
             /**\r
-            * Returns the previous item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
+            * Returns the previous item in an array\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
             */\r
-            function getPreviousArrayItem(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] || \r
+            var getPreviousArrayItem = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ||\r
                     getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
-    \r
-            }\r
+\r
+            };\r
 \r
             /**\r
-            * Get the index of the first item in an array \r
-            * @param {p_aArray} An array\r
-            * @param {p_nStartIndex} The index to start searching the array \r
-            * @ignore\r
-            * @return Returns an item in an array\r
-            * @type Object \r
-            */    \r
-            function getFirstItemIndex(p_aArray, p_nStartIndex) {\r
-    \r
-                return p_aArray[p_nStartIndex] ? \r
-                    p_nStartIndex : \r
+            * Get the index of the first item in an array\r
+            * @private\r
+            * @param {p_aArray} Array to search.\r
+            * @param {p_nStartIndex} Number indicating the index to\r
+            * start searching the array.\r
+            * @return {Object}\r
+            */\r
+            var getFirstItemIndex = function(p_aArray, p_nStartIndex) {\r
+\r
+                return p_aArray[p_nStartIndex] ?\r
+                    p_nStartIndex :\r
                     getFirstItemIndex(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
+\r
+            };\r
+\r
             var aItemGroups = this.parent.getItemGroups();\r
             var oPreviousItem;\r
-    \r
+\r
             if(\r
                 this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
             ) {\r
-    \r
-                oPreviousItem = \r
+\r
+                oPreviousItem =\r
                     getPreviousArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
+                        aItemGroups[nGroupIndex],\r
                         (this.index-1)\r
                     );\r
-    \r
+\r
             }\r
             else {\r
-    \r
+\r
                 var nPreviousGroupIndex;\r
-    \r
+\r
                 if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {\r
-    \r
+\r
                     nPreviousGroupIndex = nGroupIndex - 1;\r
-    \r
+\r
                 }\r
                 else {\r
-    \r
+\r
                     nPreviousGroupIndex = aItemGroups.length - 1;\r
-    \r
+\r
                 }\r
-    \r
-                var aPreviousGroup = \r
+\r
+                var aPreviousGroup =\r
                         getPreviousArrayItem(aItemGroups, nPreviousGroupIndex);\r
-    \r
-                oPreviousItem = \r
+\r
+                oPreviousItem =\r
                     getPreviousArrayItem(\r
-                        aPreviousGroup, \r
+                        aPreviousGroup,\r
                         (aPreviousGroup.length - 1)\r
                     );\r
-    \r
+\r
             }\r
-    \r
-            return oPreviousItem.cfg.getProperty("disabled") ? \r
-                    oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;\r
+\r
+            return (\r
+                oPreviousItem.cfg.getProperty("disabled") ||\r
+                oPreviousItem.element.style.display == "none"\r
+            ) ?\r
+            oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;\r
 \r
         }\r
 \r
     },\r
 \r
     /**\r
-    * Causes a MenuModuleItem instance to receive the focus and fires the\r
+    * @method focus\r
+    * @description Causes the menu item to receive the focus and fires the\r
     * focus event.\r
     */\r
     focus: function() {\r
@@ -3690,9 +5684,10 @@ YAHOO.widget.MenuModuleItem.prototype = {
         var oActiveItem = oParent.activeItem;\r
 \r
         if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            oParent.cfg.getProperty("visible")\r
+            !this.cfg.getProperty("disabled") &&\r
+            oParent &&\r
+            oParent.cfg.getProperty("visible") &&\r
+            this.element.style.display != "none"\r
         ) {\r
 \r
             if(oActiveItem) {\r
@@ -3701,17 +5696,13 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             }\r
 \r
-            oAnchor.focus();\r
-\r
-            /*\r
-                Opera 8.5 doesn't always focus the anchor if a MenuModuleItem\r
-                instance has a submenu, this is fixed by calling "focus"\r
-                twice.\r
-            */\r
-            if(oParent && this.browser == "opera" && this._oSubmenu) {\r
+            try {\r
 \r
                 oAnchor.focus();\r
 \r
+            }\r
+            catch(e) {\r
+\r
             }\r
 \r
             this.focusEvent.fire();\r
@@ -3721,16 +5712,18 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
     /**\r
-    * Causes a MenuModuleItem instance to lose focus and fires the onblur event.\r
-    */    \r
+    * @method blur\r
+    * @description Causes the menu item to lose focus and fires the\r
+    * onblur event.\r
+    */\r
     blur: function() {\r
 \r
         var oParent = this.parent;\r
 \r
         if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            this._oDom.getStyle(oParent.element, "visibility") == "visible"\r
+            !this.cfg.getProperty("disabled") &&\r
+            oParent &&\r
+            Dom.getStyle(oParent.element, "visibility") == "visible"\r
         ) {\r
 \r
             this._oAnchor.blur();\r
@@ -3742,8 +5735,9 @@ YAHOO.widget.MenuModuleItem.prototype = {
     },\r
 \r
        /**\r
-       * Removes a MenuModuleItem instance's HTMLLIElement from it's parent\r
-    * HTMLUListElement node.\r
+    * @method destroy\r
+       * @description Removes the menu item's <code>&#60;li&#62;</code> element\r
+       * from its parent <code>&#60;ul&#62;</code> element.\r
        */\r
     destroy: function() {\r
 \r
@@ -3752,7 +5746,7 @@ YAHOO.widget.MenuModuleItem.prototype = {
         if(oEl) {\r
 \r
             // Remove CustomEvent listeners\r
-    \r
+\r
             this.mouseOverEvent.unsubscribeAll();\r
             this.mouseOutEvent.unsubscribeAll();\r
             this.mouseDownEvent.unsubscribeAll();\r
@@ -3777,282 +5771,456 @@ YAHOO.widget.MenuModuleItem.prototype = {
 \r
             }\r
 \r
-            this.destroyEvent.unsubscribeAll();\r
+            this.destroyEvent.unsubscribeAll();\r
+\r
+        }\r
+\r
+    },\r
+\r
+    /**\r
+    * @method toString\r
+    * @description Returns a string representing the menu item.\r
+    * @return {String}\r
+    */\r
+    toString: function() {\r
+\r
+        return ("MenuItem: " + this.cfg.getProperty("text"));\r
+\r
+    }\r
+\r
+};\r
+\r
+})();\r
+\r
+/**\r
+* Creates an item for a menu module.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object specifying\r
+* the <code>&#60;optgroup&#62;</code> element of the menu module item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying the\r
+* <code>&#60;option&#62;</code> element of the menu module item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu module item. See configuration class documentation\r
+* for more details.\r
+* @class MenuModuleItem\r
+* @constructor\r
+* @deprecated As of version 0.12, all MenuModuleItem functionality has been\r
+* implemented directly in YAHOO.widget.MenuItem, making YAHOO.widget.MenuItem\r
+* the base class for all menu items.\r
+*/\r
+YAHOO.widget.MenuModuleItem = YAHOO.widget.MenuItem;\r
+\r
+/**\r
+* Creates a list of options or commands which are made visible in response to\r
+* an HTML element's "contextmenu" event ("mousedown" for Opera).\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying\r
+* the <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu. See configuration class documentation\r
+* for more details.\r
+* @class ContextMenu\r
+* @constructor\r
+* @extends YAHOO.widget.Menu\r
+* @namespace YAHOO.widget\r
+*/\r
+YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {\r
+\r
+    YAHOO.widget.ContextMenu.superclass.constructor.call(\r
+            this,\r
+            p_oElement,\r
+            p_oConfig\r
+        );\r
+\r
+};\r
+\r
+YAHOO.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu, {\r
+\r
+// Private properties\r
+\r
+/**\r
+* @property _oTrigger\r
+* @description Object reference to the current value of the "trigger"\r
+* configuration property.\r
+* @default null\r
+* @private\r
+* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve\r
+* l-one-html.html#ID-58190037">HTMLElement</a>|Array\r
+*/\r
+_oTrigger: null,\r
+\r
+// Public properties\r
+\r
+/**\r
+* @property contextEventTarget\r
+* @description Object reference for the HTML element that was the target of the\r
+* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of\r
+* the context menu.\r
+* @default null\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-58190037">HTMLElement</a>\r
+*/\r
+contextEventTarget: null,\r
+\r
+/**\r
+* @method init\r
+* @description The ContextMenu class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the\r
+* <code>&#60;div&#62;</code> element of the context menu.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-\r
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying\r
+* the <code>&#60;select&#62;</code> element to be used as the data source for\r
+* the context menu.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu. See configuration class documentation\r
+* for more details.\r
+*/\r
+init: function(p_oElement, p_oConfig) {\r
+\r
+    if(!this.ITEM_TYPE) {\r
+\r
+        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
+\r
+    }\r
+\r
+    // Call the init of the superclass (YAHOO.widget.Menu)\r
+\r
+    YAHOO.widget.ContextMenu.superclass.init.call(this, p_oElement);\r
+\r
+    this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);\r
+\r
+    if(p_oConfig) {\r
+\r
+        this.cfg.applyConfig(p_oConfig, true);\r
+\r
+    }\r
+\r
+\r
+    this.initEvent.fire(YAHOO.widget.ContextMenu);\r
+\r
+},\r
+\r
+// Private methods\r
+\r
+/**\r
+* @method _removeEventHandlers\r
+* @description Removes all of the DOM event handlers from the HTML element(s)\r
+* whose "context menu" event ("click" for Opera) trigger the display of\r
+* the context menu.\r
+* @private\r
+*/\r
+_removeEventHandlers: function() {\r
+\r
+    var Event = YAHOO.util.Event;\r
+    var oTrigger = this._oTrigger;\r
+    var bOpera = (this.browser == "opera");\r
+\r
+    // Remove the event handlers from the trigger(s)\r
+\r
+    Event.removeListener(\r
+        oTrigger,\r
+        (bOpera ? "mousedown" : "contextmenu"),\r
+        this._onTriggerContextMenu\r
+    );\r
+\r
+    if(bOpera) {\r
 \r
-        }\r
+        Event.removeListener(oTrigger, "click", this._onTriggerClick);\r
 \r
     }\r
 \r
-};\r
+},\r
+\r
+// Private event handlers\r
 \r
 /**\r
-* @class Extends YAHOO.widget.MenuModule to provide a set of default mouse and \r
-* key event behaviors.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuModule\r
-* @base YAHOO.widget.MenuModule\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a Menu instance. See \r
-* configuration class documentation for more details.\r
+* @method _onTriggerClick\r
+* @description "click" event handler for the HTML element(s) identified as the\r
+* "trigger" for the context menu.  Used to cancel default behaviors in Opera.\r
+* @private\r
+* @param {Event} p_oEvent Object representing the DOM event object passed back\r
+* by the event utility (YAHOO.util.Event).\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that is handling the event.\r
 */\r
-YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
+_onTriggerClick: function(p_oEvent, p_oMenu) {\r
 \r
-    YAHOO.widget.Menu.superclass.constructor.call(\r
-            this, \r
-            p_oElement,\r
-            p_oConfig\r
-        );\r
+    if(p_oEvent.ctrlKey) {\r
 \r
-};\r
+        YAHOO.util.Event.stopEvent(p_oEvent);\r
+\r
+    }\r
 \r
-YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.MenuModule);\r
+},\r
 \r
 /**\r
-* The Menu class's initialization method. This method is automatically \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a Menu instance. See \r
-* configuration class documentation for more details.\r
+* @method _onTriggerContextMenu\r
+* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML\r
+* element(s) that trigger the display of the context menu.\r
+* @private\r
+* @param {Event} p_oEvent Object representing the DOM event object passed back\r
+* by the event utility (YAHOO.util.Event).\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that is handling the event.\r
 */\r
-YAHOO.widget.Menu.prototype.init = function(p_oElement, p_oConfig) {\r
+_onTriggerContextMenu: function(p_oEvent, p_oMenu) {\r
 \r
-    if(!this.ITEM_TYPE) {\r
+    // Hide any other ContextMenu instances that might be visible\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
+    YAHOO.widget.MenuManager.hideVisible();\r
 \r
-    }\r
+    var Event = YAHOO.util.Event;\r
+    var oConfig = this.cfg;\r
 \r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
+    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
 \r
-    YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
+        return;\r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
+    }\r
 \r
-    // Add event handlers\r
+    this.contextEventTarget = Event.getTarget(p_oEvent);\r
 \r
-    this.showEvent.subscribe(this._onMenuShow, this, true);\r
-    this.mouseOverEvent.subscribe(this._onMenuMouseOver, this, true);\r
-    this.keyDownEvent.subscribe(this._onMenuKeyDown, this, true);\r
+    // Position and display the context menu\r
 \r
-    if(p_oConfig) {\r
+    var nX = Event.getPageX(p_oEvent);\r
+    var nY = Event.getPageY(p_oEvent);\r
 \r
-        this.cfg.applyConfig(p_oConfig, true);\r
+    oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
+    oConfig.fireQueue();\r
 \r
-    }\r
-    \r
-    this.initEvent.fire(YAHOO.widget.Menu);\r
+    /*\r
+        Prevent the browser's default context menu from appearing and\r
+        stop the propagation of the "contextmenu" event so that\r
+        other ContextMenu instances are not displayed.\r
+    */\r
 \r
-};\r
+    Event.stopEvent(p_oEvent);\r
 \r
-// Private event handlers\r
+},\r
+\r
+// Public methods\r
 \r
 /**\r
-* "show" Custom Event handler for a menu.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event.\r
+* @method toString\r
+* @description Returns a string representing the context menu.\r
+* @return {String}\r
 */\r
-YAHOO.widget.Menu.prototype._onMenuShow = \r
+toString: function() {\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
+    return ("ContextMenu " + this.id);\r
 \r
-        var oParent = this.parent;\r
+},\r
 \r
-        if(oParent && oParent.parent instanceof YAHOO.widget.Menu) {\r
+/**\r
+* @method initDefaultConfig\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the context menu's Config object ("cfg").\r
+*/\r
+initDefaultConfig: function() {\r
 \r
-            var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-    \r
-            this.cfg.setProperty(\r
-                "submenualignment", \r
-                [ aAlignment[0], aAlignment[1] ]\r
-            );\r
-        \r
-        }\r
+    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\r
 \r
-    };\r
+    /**\r
+    * @config trigger\r
+    * @description The HTML element(s) whose "contextmenu" event ("mousedown"\r
+    * for Opera) trigger the display of the context menu.  Can be a string\r
+    * representing the id attribute of the HTML element, an object reference\r
+    * for the HTML element, or an array of strings or HTML element references.\r
+    * @default null\r
+    * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
+    * level-one-html.html#ID-58190037">HTMLElement</a>|Array\r
+    */\r
+    this.cfg.addProperty("trigger", { handler: this.configTrigger });\r
+\r
+},\r
 \r
 /**\r
-* "mouseover" Custom Event handler for a Menu instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance that fired the event.\r
+* @method destroy\r
+* @description Removes the context menu's <code>&#60;div&#62;</code> element\r
+* (and accompanying child nodes) from the document.\r
 */\r
-YAHOO.widget.Menu.prototype._onMenuMouseOver = \r
+destroy: function() {\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        /*\r
-            If the menu is a submenu, then select the menu's parent\r
-            MenuItem instance\r
-        */\r
-    \r
-        if(this.parent) {\r
-    \r
-            this.parent.cfg.setProperty("selected", true);\r
-    \r
-        }\r
-    \r
-    };\r
+    // Remove the DOM event handlers from the current trigger(s)\r
+\r
+    this._removeEventHandlers();\r
+\r
+\r
+    // Continue with the superclass implementation of this method\r
+\r
+    YAHOO.widget.ContextMenu.superclass.destroy.call(this);\r
+\r
+},\r
+\r
+// Public event handlers for configuration properties\r
 \r
 /**\r
-* "mouseover" Custom Event handler for a Menu instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @method configTrigger\r
+* @description Event handler for when the value of the "trigger" configuration\r
+* property changes.\r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance that fired the event.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context\r
+* menu that fired the event.\r
 */\r
-YAHOO.widget.Menu.prototype._onMenuKeyDown = \r
+configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        if(this.cfg.getProperty("position") == "dynamic") {\r
-    \r
-            var oDOMEvent = p_aArgs[0];\r
-            var oParent = this.parent;\r
-        \r
-            if(oDOMEvent.keyCode == 27) { // Esc key\r
-        \r
-                this.hide();\r
-        \r
-                // Set focus to the parent MenuItem if one exists\r
-        \r
-                if(oParent) {\r
-        \r
-                    oParent.focus();\r
+    var Event = YAHOO.util.Event;\r
+    var oTrigger = p_aArgs[0];\r
 \r
-                    if(oParent.parent instanceof YAHOO.widget.Menu) {\r
+    if(oTrigger) {\r
 \r
-                        oParent.cfg.setProperty("selected", true);\r
-        \r
-                    }\r
+        /*\r
+            If there is a current "trigger" - remove the event handlers\r
+            from that element(s) before assigning new ones\r
+        */\r
 \r
-                    YAHOO.util.Event.preventDefault(oDOMEvent);\r
-        \r
-                }\r
-            \r
-            }\r
-        \r
-        }\r
-    \r
-    };\r
-    \r
+        if(this._oTrigger) {\r
 \r
-// Public event handlers\r
+            this._removeEventHandlers();\r
 \r
-/**\r
-* Event handler fired when the resize monitor element is resized.\r
-*/\r
-YAHOO.widget.Menu.prototype.onDomResize = function(e, obj) {\r
+        }\r
 \r
-    if(!this._handleResize) {\r
-    \r
-        this._handleResize = true;\r
-        return;\r
-    \r
-    }\r
+        this._oTrigger = oTrigger;\r
 \r
+        /*\r
+            Listen for the "mousedown" event in Opera b/c it does not\r
+            support the "contextmenu" event\r
+        */\r
 \r
-    var me = this;\r
-    var oConfig = this.cfg;\r
+        var bOpera = (this.browser == "opera");\r
 \r
-    if(oConfig.getProperty("position") == "dynamic") {\r
+        Event.addListener(\r
+            oTrigger,\r
+            (bOpera ? "mousedown" : "contextmenu"),\r
+            this._onTriggerContextMenu,\r
+            this,\r
+            true\r
+        );\r
 \r
-        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
-        \r
-        if(this.parent && oConfig.getProperty("visible")) {\r
+        /*\r
+            Assign a "click" event handler to the trigger element(s) for\r
+            Opera to prevent default browser behaviors.\r
+        */\r
 \r
-            function align() {\r
+        if(bOpera) {\r
 \r
-                me.align();\r
-            \r
-            }\r
+            Event.addListener(\r
+                oTrigger,\r
+                "click",\r
+                this._onTriggerClick,\r
+                this,\r
+                true\r
+            );\r
 \r
-            window.setTimeout(align, 0);\r
-            \r
         }\r
 \r
     }\r
+    else {\r
 \r
-    YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
+        this._removeEventHandlers();\r
+\r
+    }\r
 \r
-};    \r
+}\r
+\r
+}); // END YAHOO.extend\r
 \r
 /**\r
-* @class The MenuItem class allows you to create and modify an item for a\r
-* Menu instance.  MenuItem extends YAHOO.widget.MenuModuleItem to provide a \r
-* set of default mouse and key event behaviors.\r
+* Creates an item for a context menu.\r
+*\r
+* @param {String} p_oObject String specifying the text of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the context\r
+* menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the context menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu item. See configuration class\r
+* documentation for more details.\r
+* @class ContextMenuItem\r
 * @constructor\r
-* @extends YAHOO.widget.MenuModuleItem\r
-* @base YAHOO.widget.MenuModuleItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuItem instance. See the configuration \r
-* class documentation for more details.\r
+* @extends YAHOO.widget.MenuItem\r
 */\r
-YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {\r
+YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {\r
 \r
-    YAHOO.widget.MenuItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
+    YAHOO.widget.ContextMenuItem.superclass.constructor.call(\r
+        this,\r
+        p_oObject,\r
         p_oConfig\r
     );\r
 \r
 };\r
 \r
-YAHOO.extend(YAHOO.widget.MenuItem, YAHOO.widget.MenuModuleItem);\r
+YAHOO.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {\r
 \r
 /**\r
-* The MenuItem class's initialization method. This method is automatically\r
-* called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
+* @method init\r
+* @description The ContextMenuItem class's initialization method. This method\r
+* is automatically called by the constructor, and sets up all DOM references\r
+* for pre-existing markup, and creates required markup if it is not\r
 * already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuItem instance. See the configuration \r
-* class documentation for more details.\r
+* @param {String} p_oObject String specifying the text of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the context menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the context\r
+* menu item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the context menu item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the context menu item. See configuration class\r
+* documentation for more details.\r
 */\r
-YAHOO.widget.MenuItem.prototype.init = function(p_oObject, p_oConfig) {\r
+init: function(p_oObject, p_oConfig) {\r
 \r
     if(!this.SUBMENU_TYPE) {\r
 \r
-        this.SUBMENU_TYPE = YAHOO.widget.Menu;\r
-\r
-    }\r
-\r
-    if(!this.SUBMENU_ITEM_TYPE) {\r
-\r
-        this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuItem;\r
+        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\r
 \r
     }\r
 \r
-    /* \r
-        Call the init of the superclass (YAHOO.widget.MenuModuleItem)\r
-        Note: We don't pass the user config in here yet \r
-        because we only want it executed once, at the lowest \r
+    /*\r
+        Call the init of the superclass (YAHOO.widget.MenuItem)\r
+        Note: We don't pass the user config in here yet\r
+        because we only want it executed once, at the lowest\r
         subclass level.\r
-    */ \r
-\r
-    YAHOO.widget.MenuItem.superclass.init.call(this, p_oObject);  \r
-\r
-    // Add event handlers to each "MenuItem" instance\r
+    */\r
 \r
-    this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
-    this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
-    this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
+    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);\r
 \r
     var oConfig = this.cfg;\r
 \r
@@ -4064,938 +6232,467 @@ YAHOO.widget.MenuItem.prototype.init = function(p_oObject, p_oConfig) {
 \r
     oConfig.fireQueue();\r
 \r
-};\r
+},\r
 \r
-// Constants\r
+// Public methods\r
 \r
 /**\r
-* Constant representing the path to the image to be used for the checked state.\r
-* @final\r
-* @type String\r
+* @method toString\r
+* @description Returns a string representing the context menu item.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_nrm_1.gif";\r
+toString: function() {\r
 \r
-/**\r
-* Constant representing the path to the image to be used for the selected \r
-* checked state.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.SELECTED_CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_hov_1.gif";\r
+    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
 \r
-/**\r
-* Constant representing the path to the image to be used for the disabled \r
-* checked state.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_PATH = \r
-    "nt/ic/ut/bsc/menuchk8_dim_1.gif";\r
+}\r
 \r
-/**\r
-* Constant representing the alt text for the image to be used for the \r
-* checked image.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuItem.prototype.CHECKED_IMAGE_ALT_TEXT = "Checked.";\r
+}); // END YAHOO.extend\r
 \r
 /**\r
-* Constant representing the alt text for the image to be used for the \r
-* checked image when the item is disabled.\r
-* @final\r
-* @type String\r
+* Horizontal collection of items, each of which can contain a submenu.\r
+*\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying\r
+* the <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu bar.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar. See configuration class documentation for\r
+* more details.\r
+* @class Menubar\r
+* @constructor\r
+* @extends YAHOO.widget.Menu\r
+* @namespace YAHOO.widget\r
 */\r
-YAHOO.widget.MenuItem.prototype.DISABLED_CHECKED_IMAGE_ALT_TEXT = \r
-    "Checked. (Item disabled.)";\r
+YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {\r
 \r
-// Private properties\r
+    YAHOO.widget.MenuBar.superclass.constructor.call(\r
+            this,\r
+            p_oElement,\r
+            p_oConfig\r
+        );\r
 \r
-/**\r
-* Reference to the HTMLImageElement used to create the checked\r
-* indicator for a MenuItem instance.\r
-* @private\r
-* @type {HTMLImageElement}\r
-*/\r
-YAHOO.widget.MenuItem.prototype._checkImage = null;\r
+};\r
 \r
-// Private event handlers\r
+YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.Menu, {\r
 \r
 /**\r
-* "keydown" Custom Event handler for a MenuItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* @method init\r
+* @description The MenuBar class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {String} p_oElement String specifying the id attribute of the\r
+* <code>&#60;select&#62;</code> element to be used as the data source for the\r
+* menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying\r
+* the <code>&#60;div&#62;</code> element of the menu bar.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object\r
+* specifying the <code>&#60;select&#62;</code> element to be used as the data\r
+* source for the menu bar.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar. See configuration class documentation for\r
+* more details.\r
 */\r
-YAHOO.widget.MenuItem.prototype._onKeyDown = \r
-\r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
+init: function(p_oElement, p_oConfig) {\r
 \r
-        var Event = YAHOO.util.Event;\r
-        var oDOMEvent = p_aArgs[0];\r
-        var oParent = this.parent;\r
-        var oConfig = this.cfg;\r
-        var oMenuItem;\r
-    \r
+    if(!this.ITEM_TYPE) {\r
 \r
-        switch(oDOMEvent.keyCode) {\r
-    \r
-            case 38:    // Up arrow\r
-            case 40:    // Down arrow\r
-    \r
-                if(\r
-                    this == oParent.activeItem && \r
-                    !oConfig.getProperty("selected")\r
-                ) {\r
-    \r
-                    oConfig.setProperty("selected", true);\r
-    \r
-                }\r
-                else {\r
-    \r
-                    var oNextItem = (oDOMEvent.keyCode == 38) ? \r
-                            this.getPreviousEnabledSibling() : \r
-                            this.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
+        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
 \r
-                        oParent.clearActiveItem();\r
+    }\r
 \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-            \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oDOMEvent);\r
+    // Call the init of the superclass (YAHOO.widget.Menu)\r
 \r
-            break;\r
-            \r
-    \r
-            case 39:    // Right arrow\r
+    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
 \r
-                oParent.clearActiveItem();\r
+    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
 \r
-                oConfig.setProperty("selected", true);\r
-                \r
-                this.focus();\r
+    if(p_oConfig) {\r
 \r
-                var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
+        this.cfg.applyConfig(p_oConfig, true);\r
 \r
-                    oSubmenu.show();\r
-                    oSubmenu.setInitialSelection();                    \r
-    \r
-                }\r
-                else if(\r
-                    YAHOO.widget.MenuBarItem && \r
-                    oParent.parent && \r
-                    oParent.parent instanceof YAHOO.widget.MenuBarItem\r
-                ) {\r
+    }\r
 \r
-                    oParent.hide();\r
-    \r
-                    // Set focus to the parent MenuItem if one exists\r
-    \r
-                    oMenuItem = oParent.parent;\r
-    \r
-                    if(oMenuItem) {\r
-    \r
-                        oMenuItem.focus();\r
-                        oMenuItem.cfg.setProperty("selected", true);\r
-    \r
-                    }                    \r
-                \r
-                }\r
-    \r
-                Event.preventDefault(oDOMEvent);\r
+    this.initEvent.fire(YAHOO.widget.MenuBar);\r
 \r
-            break;\r
-    \r
-    \r
-            case 37:    // Left arrow\r
-    \r
-                // Only hide if this this is a MenuItem of a submenu\r
-    \r
-                if(oParent.parent) {\r
-    \r
-                    oParent.hide();\r
-    \r
-                    // Set focus to the parent MenuItem if one exists\r
-    \r
-                    oMenuItem = oParent.parent;\r
-    \r
-                    if(oMenuItem) {\r
-    \r
-                        oMenuItem.focus();\r
-                        oMenuItem.cfg.setProperty("selected", true);\r
-    \r
-                    }\r
-    \r
-                }\r
+},\r
 \r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;        \r
-    \r
-        }\r
-    \r
-    };\r
+// Constants\r
 \r
 /**\r
-* "mouseover" Custom Event handler for a MenuItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the menu\r
+* bar's <code>&#60;div&#62;</code> element.\r
+* @default "yuimenubar"\r
+* @final\r
+* @type String\r
 */\r
-YAHOO.widget.MenuItem.prototype._onMouseOver = \r
+CSS_CLASS_NAME: "yuimenubar",\r
 \r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
-\r
-        var oParent = this.parent;\r
-        var oConfig = this.cfg;\r
-        var oActiveItem = oParent.activeItem;\r
-    \r
-    \r
-        // Hide any other submenus that might be visible\r
-    \r
-        if(oActiveItem && oActiveItem != this) {\r
-    \r
-            oParent.clearActiveItem();\r
-    \r
-        }\r
-    \r
-    \r
-        // Select and focus the current MenuItem instance\r
-    \r
-        oConfig.setProperty("selected", true);\r
-        this.focus();\r
-    \r
-    \r
-        // Show the submenu for this instance\r
-    \r
-        var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            oSubmenu.show();\r
-    \r
-        }\r
-    \r
-    };\r
+// Protected event handlers\r
 \r
 /**\r
-* "mouseout" Custom Event handler for a MenuItem instance.\r
+* @method _onKeyDown\r
+* @description "keydown" Custom Event handler for the menu bar.\r
 * @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
+* @param {String} p_sType String representing the name of the event that\r
 * was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
-*/\r
-YAHOO.widget.MenuItem.prototype._onMouseOut = \r
-\r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
-    \r
-        var oConfig = this.cfg;\r
-        var oSubmenu = oConfig.getProperty("submenu");\r
-\r
-        oConfig.setProperty("selected", false);\r
-    \r
-        if(oSubmenu) {\r
-    \r
-            var oDOMEvent = p_aArgs[0];\r
-            var oRelatedTarget = YAHOO.util.Event.getRelatedTarget(oDOMEvent);\r
-    \r
-            if(\r
-                !(\r
-                    oRelatedTarget == oSubmenu.element || \r
-                    YAHOO.util.Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
-                )\r
-            ) {\r
-    \r
-                oSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\r
-    \r
-    };\r
-\r
-// Event handlers for configuration properties\r
-\r
-/**\r
-* Event handler for when the "checked" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar\r
 * that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configChecked =\r
+*/\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
 \r
-    function(p_sType, p_aArgs, p_oItem) {\r
-    \r
-        var Dom = YAHOO.util.Dom;\r
-        var bChecked = p_aArgs[0];\r
-        var oEl = this.element;\r
-        var oConfig = this.cfg;\r
-        var oImg;\r
-        \r
+    var Event = YAHOO.util.Event;\r
+    var oEvent = p_aArgs[0];\r
+    var oItem = p_aArgs[1];\r
+    var oItemCfg = oItem.cfg;\r
+    var oSubmenu;\r
 \r
-        if(bChecked) {\r
+    switch(oEvent.keyCode) {\r
 \r
-            var me = this;\r
+        case 27:    // Esc key\r
 \r
-            function preloadImage(p_sPath) {\r
+            if(this.cfg.getProperty("position") == "dynamic") {\r
 \r
-                var sPath = me.imageRoot + p_sPath;\r
+                this.hide();\r
 \r
-                if(!document.images[sPath]) {\r
+                if(this.parent) {\r
 \r
-                    var oImg = document.createElement("img");\r
-                    oImg.src = sPath;\r
-                    oImg.name = sPath;\r
-                    oImg.id = sPath;\r
-                    oImg.style.display = "none";\r
-                    \r
-                    document.body.appendChild(oImg);\r
+                    this.parent.focus();\r
 \r
                 }\r
-            \r
-            }\r
-\r
-            preloadImage(this.CHECKED_IMAGE_PATH);\r
-            preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);\r
-            preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);\r
-\r
-            oImg = document.createElement("img");\r
-            oImg.src = (this.imageRoot + this.CHECKED_IMAGE_PATH);\r
-            oImg.alt = this.CHECKED_IMAGE_ALT_TEXT;\r
-\r
-            var oSubmenu = this.cfg.getProperty("submenu");\r
-\r
-            if(oSubmenu) {\r
-\r
-                oEl.insertBefore(oImg, oSubmenu.element);\r
 \r
             }\r
-            else {\r
+            else if(this.activeItem) {\r
 \r
-                oEl.appendChild(oImg);            \r
+                oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
 \r
-            }\r
+                if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
 \r
-            Dom.addClass([oEl, oImg], "checked");\r
+                    oSubmenu.hide();\r
+                    this.activeItem.focus();\r
 \r
-            this._checkImage = oImg;\r
+                }\r
+                else {\r
 \r
-            if(oConfig.getProperty("disabled")) {\r
+                    this.activeItem.cfg.setProperty("selected", false);\r
+                    this.activeItem.blur();\r
 \r
-                oConfig.refireEvent("disabled");\r
+                }\r
 \r
             }\r
 \r
-            if(oConfig.getProperty("selected")) {\r
-\r
-                oConfig.refireEvent("selected");\r
 \r
-            }\r
-        \r
-        }\r
-        else {\r
+            Event.preventDefault(oEvent);\r
 \r
-            oImg = this._checkImage;\r
+        break;\r
 \r
-            Dom.removeClass([oEl, oImg], "checked");\r
+        case 37:    // Left arrow\r
+        case 39:    // Right arrow\r
 \r
-            if(oImg) {\r
+            if(\r
+                oItem == this.activeItem &&\r
+                !oItemCfg.getProperty("selected")\r
+            ) {\r
 \r
-                oEl.removeChild(oImg);\r
+                oItemCfg.setProperty("selected", true);\r
 \r
             }\r
+            else {\r
 \r
-            this._checkImage = null;\r
-        \r
-        }\r
+                var oNextItem = (oEvent.keyCode == 37) ?\r
+                        oItem.getPreviousEnabledSibling() :\r
+                        oItem.getNextEnabledSibling();\r
 \r
-    };\r
-    \r
+                if(oNextItem) {\r
 \r
-/**\r
-* Event handler for when the "selected" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
-* that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configSelected = \r
+                    this.clearActiveItem();\r
 \r
-    function(p_sType, p_aArgs, p_oItem) {\r
+                    oNextItem.cfg.setProperty("selected", true);\r
 \r
-        YAHOO.widget.MenuItem.superclass.configSelected.call(\r
-                this, p_sType, p_aArgs, p_oItem\r
-            );        \r
-    \r
-        var oConfig = this.cfg;\r
+                    if(this.cfg.getProperty("autosubmenudisplay")) {\r
 \r
-        if(!oConfig.getProperty("disabled") && oConfig.getProperty("checked")) {\r
+                        oSubmenu = oNextItem.cfg.getProperty("submenu");\r
 \r
-            var bSelected = p_aArgs[0];\r
+                        if(oSubmenu) {\r
 \r
-            var sSrc = this.imageRoot + (bSelected ? \r
-                this.SELECTED_CHECKED_IMAGE_PATH : this.CHECKED_IMAGE_PATH);\r
+                            oSubmenu.show();\r
+                            oSubmenu.activeItem.blur();\r
+                            oSubmenu.activeItem = null;\r
 \r
-            this._checkImage.src = document.images[sSrc].src;\r
-            \r
-        }            \r
-    \r
-    };\r
+                        }\r
 \r
-/**\r
-* Event handler for when the "disabled" configuration property of\r
-* a MenuItem instance changes. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem The MenuItem instance \r
-* that fired the event.\r
-*/    \r
-YAHOO.widget.MenuItem.prototype.configDisabled = \r
-\r
-    function(p_sType, p_aArgs, p_oItem) {\r
-    \r
-        YAHOO.widget.MenuItem.superclass.configDisabled.call(\r
-                this, p_sType, p_aArgs, p_oItem\r
-            );        \r
-    \r
-        if(this.cfg.getProperty("checked")) {\r
-    \r
-            var bDisabled = p_aArgs[0];\r
-            var sAlt = this.CHECKED_IMAGE_ALT_TEXT;\r
-            var sSrc = this.CHECKED_IMAGE_PATH;\r
-            var oImg = this._checkImage;\r
-            \r
-            if(bDisabled) {\r
-    \r
-                sAlt = this.DISABLED_CHECKED_IMAGE_ALT_TEXT;\r
-                sSrc = this.DISABLED_CHECKED_IMAGE_PATH;\r
-            \r
-            }\r
+                    }\r
 \r
-            oImg.src = document.images[(this.imageRoot + sSrc)].src;\r
-            oImg.alt = sAlt;\r
-            \r
-        }    \r
-            \r
-    };\r
+                    oNextItem.focus();\r
 \r
-// Public methods\r
-    \r
-/**\r
-* Initializes the class's configurable properties which can be changed using \r
-* the MenuModule's Config object (cfg).\r
-*/\r
-YAHOO.widget.MenuItem.prototype.initDefaultConfig = function() {\r
+                }\r
 \r
-    YAHOO.widget.MenuItem.superclass.initDefaultConfig.call(this);\r
+            }\r
 \r
-       // Add configuration properties\r
+            Event.preventDefault(oEvent);\r
 \r
-    this.cfg.addProperty(\r
-        "checked", \r
-        {\r
-            value: false, \r
-            handler: this.configChecked, \r
-            validator: this.cfg.checkBoolean, \r
-            suppressEvent: true \r
-        } \r
-    );\r
+        break;\r
 \r
-};\r
+        case 40:    // Down arrow\r
 \r
-/**\r
-* @class Creates a list of options which vary depending on the context in \r
-* which the menu is invoked.\r
-* @constructor\r
-* @extends YAHOO.widget.Menu\r
-* @base YAHOO.widget.Menu\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a ContextMenu instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {\r
+            if(this.activeItem != oItem) {\r
 \r
-    YAHOO.widget.ContextMenu.superclass.constructor.call(\r
-            this, \r
-            p_oElement,\r
-            p_oConfig\r
-        );\r
+                this.clearActiveItem();\r
 \r
-};\r
+                oItemCfg.setProperty("selected", true);\r
+                oItem.focus();\r
 \r
-YAHOO.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu);\r
+            }\r
 \r
-YAHOO.widget.ContextMenu.prototype._oTrigger = null;\r
+            oSubmenu = oItemCfg.getProperty("submenu");\r
 \r
-/**\r
-* The ContextMenu class's initialization method. This method is automatically  \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a ContextMenu instance. See \r
-* configuration class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.init = function(p_oElement, p_oConfig) {\r
+            if(oSubmenu) {\r
 \r
-    if(!this.ITEM_TYPE) {\r
+                if(oSubmenu.cfg.getProperty("visible")) {\r
 \r
-        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
+                    oSubmenu.setInitialSelection();\r
+                    oSubmenu.setInitialFocus();\r
 \r
-    }\r
+                }\r
+                else {\r
 \r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
+                    oSubmenu.show();\r
 \r
-    YAHOO.widget.ContextMenu.superclass.init.call(this, p_oElement);\r
+                }\r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);\r
+            }\r
 \r
-    if(p_oConfig) {\r
+            Event.preventDefault(oEvent);\r
 \r
-        this.cfg.applyConfig(p_oConfig, true);\r
+        break;\r
 \r
     }\r
-    \r
-    \r
-    this.initEvent.fire(YAHOO.widget.ContextMenu);\r
-\r
-};\r
 \r
-// Private event handlers\r
+},\r
 \r
 /**\r
-* "mousedown" event handler for the document object.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
+* @method _onClick\r
+* @description "click" event handler for the menu bar.\r
+* @protected\r
+* @param {String} p_sType String representing the name of the event that\r
+* was fired.\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar\r
+* that fired the event.\r
 */\r
-YAHOO.widget.ContextMenu.prototype._onDocumentMouseDown = \r
-\r
-    function(p_oEvent, p_oMenu) {\r
-    \r
-        var oTarget = YAHOO.util.Event.getTarget(p_oEvent);\r
-        var oTargetEl = this._oTargetElement;\r
-    \r
-        if(\r
-            oTarget != oTargetEl || \r
-            !YAHOO.util.Dom.isAncestor(oTargetEl, oTarget)\r
-        ) {\r
-    \r
-            this.hide();\r
-        \r
-        }\r
-    \r
-    };\r
+_onClick: function(p_sType, p_aArgs, p_oMenuBar) {\r
 \r
-/**\r
-* "click" event handler for the HTMLElement node that triggered the event. \r
-* Used to cancel default behaviors in Opera.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype._onTriggerClick = \r
+    YAHOO.widget.MenuBar.superclass._onClick.call(\r
+        this,\r
+        p_sType,\r
+        p_aArgs,\r
+        p_oMenuBar\r
+    );\r
 \r
-    function(p_oEvent, p_oMenu) {\r
+    var oItem = p_aArgs[1];\r
 \r
-        if(p_oEvent.ctrlKey) {\r
-        \r
-            YAHOO.util.Event.stopEvent(p_oEvent);\r
-    \r
-        }\r
-        \r
-    };\r
+    if(oItem) {\r
 \r
-/**\r
-* "contextmenu" event handler ("mousedown" for Opera) for the HTMLElement \r
-* node that triggered the event.\r
-* @private\r
-* @param {Event} p_oEvent Event object passed back by the \r
-* event utility (YAHOO.util.Event).\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu instance \r
-* handling the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype._onTriggerContextMenu = \r
+        var Event = YAHOO.util.Event;\r
+        var Dom = YAHOO.util.Dom;\r
 \r
-    function(p_oEvent, p_oMenu) {\r
+        var oEvent = p_aArgs[0];\r
+        var oTarget = Event.getTarget(oEvent);\r
 \r
-        var Event = YAHOO.util.Event;\r
+        var oActiveItem = this.activeItem;\r
         var oConfig = this.cfg;\r
 \r
-        if(p_oEvent.type == "mousedown") {\r
-        \r
-            if(!p_oEvent.ctrlKey) {\r
-    \r
-                return;\r
-            \r
-            }\r
-        \r
-            Event.stopEvent(p_oEvent);\r
-    \r
-        }\r
-    \r
-    \r
-        this.contextEventTarget = Event.getTarget(p_oEvent);\r
-    \r
-    \r
-        // Position and display the context menu\r
-    \r
-        var nX = Event.getPageX(p_oEvent);\r
-        var nY = Event.getPageY(p_oEvent);\r
-    \r
-    \r
-        oConfig.applyConfig( { x:nX, y:nY, visible:true } );\r
-        oConfig.fireQueue();\r
-    \r
-    \r
-        // Prevent the browser's default context menu from appearing\r
-    \r
-        Event.preventDefault(p_oEvent);\r
-    \r
-    };\r
+        // Hide any other submenus that might be visible\r
 \r
-// Public properties\r
+        if(oActiveItem && oActiveItem != oItem) {\r
 \r
-/**\r
-* Returns the HTMLElement node that was the target of the "contextmenu" \r
-* DOM event.\r
-* @type HTMLElement\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.contextEventTarget = null;\r
+            this.clearActiveItem();\r
 \r
-// Public methods\r
+        }\r
 \r
-/**\r
-* Initializes the class's configurable properties which can be changed using \r
-* a ContextMenu instance's Config object (cfg).\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.initDefaultConfig = function() {\r
 \r
-    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\r
+        // Select and focus the current item\r
 \r
-       // Add a configuration property\r
+        oItem.cfg.setProperty("selected", true);\r
+        oItem.focus();\r
 \r
-    this.cfg.addProperty("trigger", { handler: this.configTrigger });\r
 \r
-};\r
+        // Show the submenu for the item\r
 \r
-// Event handlers for configuration properties\r
+        var oSubmenu = oItem.cfg.getProperty("submenu");\r
 \r
-/**\r
-* Event handler for when the "trigger" configuration property of\r
-* a MenuItem instance. \r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the \r
-* event was fired.\r
-* @param {YAHOO.widget.ContextMenu} p_oMenu The ContextMenu that instance fired\r
-* the event.\r
-*/\r
-YAHOO.widget.ContextMenu.prototype.configTrigger = \r
+        if(oSubmenu && oTarget != oItem.submenuIndicator) {\r
 \r
-    function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-        var Event = YAHOO.util.Event;\r
-        var oTrigger = p_aArgs[0];\r
-    \r
-        if(oTrigger) {\r
-    \r
+            if(oSubmenu.cfg.getProperty("visible")) {\r
 \r
-            /*\r
-                If there is a current "trigger" - remove the event handlers \r
-                from that element(s) before assigning new ones\r
-            */\r
-            if(this._oTrigger) {\r
-            \r
-                Event.purgeElement(this._oTrigger);\r
+                oSubmenu.hide();\r
 \r
             }\r
+            else {\r
 \r
-            this._oTrigger = oTrigger;\r
+                oSubmenu.show();\r
 \r
-            /*\r
-                Listen for the "mousedown" event in Opera b/c it does not \r
-                support the "contextmenu" event\r
-            */ \r
-      \r
-            var bOpera = (this.browser == "opera");\r
-    \r
-            Event.addListener(\r
-                oTrigger, \r
-                (bOpera ? "mousedown" : "contextmenu"), \r
-                this._onTriggerContextMenu,\r
-                this,\r
-                true\r
-            );\r
-    \r
-    \r
-            /*\r
-                Assign a "click" event handler to the trigger element(s) for\r
-                Opera to prevent default browser behaviors.\r
-            */\r
-    \r
-            if(bOpera) {\r
-            \r
-                Event.addListener(\r
-                    oTrigger, \r
-                    "click", \r
-                    this._onTriggerClick,\r
-                    this,\r
-                    true\r
-                );\r
-    \r
             }\r
-    \r
-    \r
-            // Assign a "mousedown" event handler to the document\r
-        \r
-            Event.addListener(\r
-                document, \r
-                "mousedown", \r
-                this._onDocumentMouseDown,\r
-                this,\r
-                true\r
-            );        \r
-    \r
-        }\r
-        \r
-    };\r
-\r
-/**\r
-* @class Creates an item for a context menu instance.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuItem\r
-* @base YAHOO.widget.MenuItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a ContextMenuItem instance. See the configuration \r
-* class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {\r
-\r
-    YAHOO.widget.ContextMenuItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
-        p_oConfig\r
-    );\r
-\r
-};\r
 \r
-YAHOO.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem);\r
+        }\r
 \r
-/**\r
-* The ContextMenuItem class's initialization method. This method is\r
-* automatically called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a ContextMenuItem instance. See the configuration \r
-* class documentation for more details.\r
-*/\r
-YAHOO.widget.ContextMenuItem.prototype.init = \r
+    }\r
 \r
-    function(p_oObject, p_oConfig) {\r
-    \r
-        if(!this.SUBMENU_TYPE) {\r
-    \r
-            this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\r
-    \r
-        }\r
-    \r
-        if(!this.SUBMENU_ITEM_TYPE) {\r
-    \r
-            this.SUBMENU_ITEM_TYPE = YAHOO.widget.ContextMenuItem;\r
-    \r
-        }\r
-    \r
-    \r
-        /* \r
-            Call the init of the superclass (YAHOO.widget.MenuItem)\r
-            Note: We don't pass the user config in here yet \r
-            because we only want it executed once, at the lowest \r
-            subclass level.\r
-        */ \r
-    \r
-        YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);\r
+},\r
 \r
-        var oConfig = this.cfg;\r
-    \r
-        if(p_oConfig) {\r
-    \r
-            oConfig.applyConfig(p_oConfig, true);\r
-    \r
-        }\r
-    \r
-        oConfig.fireQueue();\r
-    \r
-    };\r
+// Public methods\r
 \r
 /**\r
-* @class Horizontal collection of items, each of which can contain a submenu.\r
-* Extends YAHOO.widget.MenuModule to provide a set of default mouse and \r
-* key event behaviors.\r
-* @constructor\r
-* @extends YAHOO.widget.MenuModule\r
-* @base YAHOO.widget.MenuModule\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuBar instance. See \r
-* configuration class documentation for more details.\r
+* @method toString\r
+* @description Returns a string representing the menu bar.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {\r
-\r
-    YAHOO.widget.MenuBar.superclass.constructor.call(\r
-            this, \r
-            p_oElement,\r
-            p_oConfig\r
-        );\r
+toString: function() {\r
 \r
-};\r
+    return ("MenuBar " + this.id);\r
 \r
-YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.MenuModule);\r
+},\r
 \r
 /**\r
-* The MenuBar class's initialization method. This method is automatically \r
-* called by the constructor, and sets up all DOM references for pre-existing \r
-* markup, and creates required markup if it is not already present.\r
-* @param {String or HTMLElement} p_oElement String id or HTMLElement \r
-* (either HTMLSelectElement or HTMLDivElement) of the source HTMLElement node.\r
-* @param {Object} p_oConfig Optional. The configuration object literal \r
-* containing the configuration for a MenuBar instance. See \r
-* configuration class documentation for more details.\r
+* @description Initializes the class's configurable properties which can be\r
+* changed using the menu bar's Config object ("cfg").\r
+* @method initDefaultConfig\r
 */\r
-YAHOO.widget.MenuBar.prototype.init = function(p_oElement, p_oConfig) {\r
-\r
-    if(!this.ITEM_TYPE) {\r
-\r
-        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
-\r
-    }\r
-\r
-    // Call the init of the superclass (YAHOO.widget.MenuModule)\r
-\r
-    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
+initDefaultConfig: function() {\r
 \r
-    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
+    YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);\r
 \r
     var oConfig = this.cfg;\r
 \r
+       // Add configuration properties\r
+\r
     /*\r
         Set the default value for the "position" configuration property\r
-        to "static" \r
+        to "static" by re-adding the property.\r
     */\r
-    if(!p_oConfig || (p_oConfig && !p_oConfig.position)) {\r
-\r
-        oConfig.queueProperty("position", "static");\r
 \r
-    }\r
+    /**\r
+    * @config position\r
+    * @description String indicating how a menu bar should be positioned on the\r
+    * screen.  Possible values are "static" and "dynamic."  Static menu bars\r
+    * are visible by default and reside in the normal flow of the document\r
+    * (CSS position: static).  Dynamic menu bars are hidden by default, reside\r
+    * out of the normal flow of the document (CSS position: absolute), and can\r
+    * overlay other elements on the screen.\r
+    * @default static\r
+    * @type String\r
+    */\r
+    oConfig.addProperty(\r
+        "position",\r
+        {\r
+            value: "static",\r
+            handler: this.configPosition,\r
+            validator: this._checkPosition,\r
+            supercedes: ["visible"]\r
+        }\r
+    );\r
 \r
     /*\r
         Set the default value for the "submenualignment" configuration property\r
-        to "tl" and "bl" \r
+        to ["tl","bl"] by re-adding the property.\r
     */\r
-    if(!p_oConfig || (p_oConfig && !p_oConfig.submenualignment)) {\r
-\r
-        oConfig.queueProperty("submenualignment", ["tl","bl"]);\r
-\r
-    }\r
-\r
-    if(p_oConfig) {\r
 \r
-        oConfig.applyConfig(p_oConfig, true);\r
+    /**\r
+    * @config submenualignment\r
+    * @description Array defining how submenus should be aligned to their\r
+    * parent menu bar item. The format is: [itemCorner, submenuCorner].\r
+    * @default ["tl","bl"]\r
+    * @type Array\r
+    */\r
+    oConfig.addProperty("submenualignment", { value: ["tl","bl"] } );\r
 \r
-    }\r
-    \r
-    this.initEvent.fire(YAHOO.widget.MenuBar);\r
+    /*\r
+        Change the default value for the "autosubmenudisplay" configuration\r
+        property to "false" by re-adding the property.\r
+    */\r
 \r
-};\r
+    /**\r
+    * @config autosubmenudisplay\r
+    * @description Boolean indicating if submenus are automatically made\r
+    * visible when the user mouses over the menu bar's items.\r
+    * @default false\r
+    * @type Boolean\r
+    */\r
+       oConfig.addProperty(\r
+          "autosubmenudisplay",\r
+          { value: false, validator: oConfig.checkBoolean }\r
+    );\r
 \r
-// Constants\r
+}\r
 \r
-/**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLDivElement of the MenuBar instance.\r
-* @final\r
-* @type String\r
-*/\r
-YAHOO.widget.MenuBar.prototype.CSS_CLASS_NAME = "yuimenubar";\r
+}); // END YAHOO.extend\r
 \r
 /**\r
-* @class The MenuBarItem class allows you to create and modify an item for a\r
-* MenuBar instance.  MenuBarItem extends YAHOO.widget.MenuModuleItem to provide \r
-* a set of default mouse and key event behaviors.\r
+* Creates an item for a menu bar.\r
+*\r
+* @param {String} p_oObject String specifying the text of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the menu bar item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar item. See configuration class documentation\r
+* for more details.\r
+* @class MenuBarItem\r
 * @constructor\r
-* @extends YAHOO.widget.MenuModuleItem\r
-* @base YAHOO.widget.MenuModuleItem\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuBarItem instance. See the configuration \r
-* class documentation for more details.\r
+* @extends YAHOO.widget.MenuItem\r
 */\r
 YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) {\r
 \r
     YAHOO.widget.MenuBarItem.superclass.constructor.call(\r
-        this, \r
-        p_oObject, \r
+        this,\r
+        p_oObject,\r
         p_oConfig\r
     );\r
 \r
 };\r
 \r
-YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuModuleItem);\r
+YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {\r
 \r
 /**\r
-* The MenuBarItem class's initialization method. This method is automatically\r
-* called by the constructor, and sets up all DOM references for\r
-* pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String or HTMLElement} p_oObject String or HTMLElement \r
-* (either HTMLLIElement, HTMLOptGroupElement or HTMLOptionElement) of the \r
-* source HTMLElement node.\r
-* @param {Object} p_oConfig The configuration object literal containing \r
-* the configuration for a MenuBarItem instance. See the configuration \r
-* class documentation for more details.\r
+* @method init\r
+* @description The MenuBarItem class's initialization method. This method is\r
+* automatically called by the constructor, and sets up all DOM references for\r
+* pre-existing markup, and creates required markup if it is not already present.\r
+* @param {String} p_oObject String specifying the text of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object\r
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying\r
+* the <code>&#60;option&#62;</code> element of the menu bar item.\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r
+* configuration for the menu bar item. See configuration class documentation\r
+* for more details.\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {\r
+init: function(p_oObject, p_oConfig) {\r
 \r
     if(!this.SUBMENU_TYPE) {\r
 \r
@@ -5003,24 +6700,14 @@ YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {
 \r
     }\r
 \r
-    if(!this.SUBMENU_ITEM_TYPE) {\r
-\r
-        this.SUBMENU_ITEM_TYPE = YAHOO.widget.MenuItem;\r
-\r
-    }\r
-\r
-    /* \r
-        Call the init of the superclass (YAHOO.widget.MenuModuleItem)\r
-        Note: We don't pass the user config in here yet \r
-        because we only want it executed once, at the lowest \r
+    /*\r
+        Call the init of the superclass (YAHOO.widget.MenuItem)\r
+        Note: We don't pass the user config in here yet\r
+        because we only want it executed once, at the lowest\r
         subclass level.\r
-    */ \r
-\r
-    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);  \r
-\r
-    // Add event handlers to each "MenuBarItem" instance\r
+    */\r
 \r
-    this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
+    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);\r
 \r
     var oConfig = this.cfg;\r
 \r
@@ -5032,121 +6719,61 @@ YAHOO.widget.MenuBarItem.prototype.init = function(p_oObject, p_oConfig) {
 \r
     oConfig.fireQueue();\r
 \r
-};\r
+},\r
 \r
 // Constants\r
 \r
 /**\r
-* Constant representing the CSS class(es) to be applied to the root \r
-* HTMLLIElement of the MenuBarItem.\r
+* @property CSS_CLASS_NAME\r
+* @description String representing the CSS class(es) to be applied to the\r
+* <code>&#60;li&#62;</code> element of the menu bar item.\r
+* @default "yuimenubaritem"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.CSS_CLASS_NAME = "yuimenubaritem";\r
+CSS_CLASS_NAME: "yuimenubaritem",\r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator.\r
+* @property SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* menu bar item's submenu arrow indicator.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.SUBMENU_INDICATOR_IMAGE_PATH =\r
-    "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif";\r
+SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",\r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator when a MenuBarItem instance is selected.\r
+* @property SELECTED_SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* submenu arrow indicator when the menu bar item is selected.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_hov_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH =\r
-    "nt/ic/ut/alt1/menuarodwn8_hov_1.gif";\r
+SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_hov_1.gif",\r
 \r
 /**\r
-* Constant representing the path to the image to be used for the submenu\r
-* arrow indicator when a MenuBarItem instance is disabled.\r
+* @property DISABLED_SUBMENU_INDICATOR_IMAGE_PATH\r
+* @description String representing the path to the image to be used for the\r
+* submenu arrow indicator when the menu bar item is disabled.\r
+* @default "nt/ic/ut/alt1/menuarodwn8_dim_1.gif"\r
 * @final\r
 * @type String\r
 */\r
-YAHOO.widget.MenuBarItem.prototype.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH = \r
-    "nt/ic/ut/alt1/menuarodwn8_dim_1.gif";\r
+DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_dim_1.gif",\r
 \r
-// Private event handlers\r
+// Public methods\r
 \r
 /**\r
-* "keydown" Custom Event handler for a MenuBarItem instance.\r
-* @private\r
-* @param {String} p_sType The name of the event that was fired.\r
-* @param {Array} p_aArgs Collection of arguments sent when the event \r
-* was fired.\r
-* @param {YAHOO.widget.MenuModule} p_oMenuModule The MenuModule instance that \r
-* fired the event.\r
+* @method toString\r
+* @description Returns a string representing the menu bar item.\r
+* @return {String}\r
 */\r
-YAHOO.widget.MenuBarItem.prototype._onKeyDown =\r
-\r
-    function(p_sType, p_aArgs, p_oMenuItem) {\r
-\r
-        var Event = YAHOO.util.Event;\r
-        var oDOMEvent = p_aArgs[0];\r
-        var oConfig = this.cfg;\r
-        var oParent = this.parent;\r
-    \r
-        switch(oDOMEvent.keyCode) {\r
-    \r
-            case 37:    // Left arrow\r
-            case 39:    // Right arrow\r
-    \r
-                if(\r
-                    this == oParent.activeItem && \r
-                    !oConfig.getProperty("selected")\r
-                ) {\r
-    \r
-                    oConfig.setProperty("selected", true);\r
-    \r
-                }\r
-                else {\r
-    \r
-                    var oNextItem = (oDOMEvent.keyCode == 37) ? \r
-                            this.getPreviousEnabledSibling() : \r
-                            this.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
+toString: function() {\r
 \r
-                        oParent.clearActiveItem();\r
+    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
 \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-            \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
-\r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;\r
-    \r
-            case 40:    // Down arrow\r
-\r
-                oParent.clearActiveItem();\r
-                        \r
-                oConfig.setProperty("selected", true);\r
-                \r
-                this.focus();\r
+}\r
 \r
-                var oSubmenu = oConfig.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
-        \r
-                    oSubmenu.show();\r
-                    oSubmenu.setInitialSelection();\r
-    \r
-                }\r
-\r
-                Event.preventDefault(oDOMEvent);\r
-    \r
-            break;\r
-    \r
-        }\r
-    \r
-    };\r
+}); // END YAHOO.extend
\ No newline at end of file
diff --git a/lib/yui/reset-fonts-grids/README b/lib/yui/reset-fonts-grids/README
new file mode 100755 (executable)
index 0000000..d8e7eeb
--- /dev/null
@@ -0,0 +1,8 @@
+YUI Library - Reset+Fonts+Grids (RFG) - Release Notes\r
+\r
+Version 0.12.0\r
+\r
+  * Initial release.\r
+  \r
+  * This file is a convenience file containing an in-order \r
+    concatenation of Reset, Fonts, and Grids.
\ No newline at end of file
diff --git a/lib/yui/reset-fonts-grids/reset-fonts-grids-min.css b/lib/yui/reset-fonts-grids/reset-fonts-grids-min.css
new file mode 100755 (executable)
index 0000000..bf76e56
--- /dev/null
@@ -0,0 +1,4 @@
+/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,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;}ol,ul {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;}\r
+/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
+/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.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-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.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-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#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-grids/reset-fonts-grids.css b/lib/yui/reset-fonts-grids/reset-fonts-grids.css
new file mode 100755 (executable)
index 0000000..507ed66
--- /dev/null
@@ -0,0 +1,174 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+\r
+/*=============*/\r
+/*  reset.css  */\r
+/*=============*/\r
+\r
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}\r
+table{border-collapse:collapse;border-spacing:0;}\r
+fieldset,img{border:0;}\r
+address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}\r
+ol,ul {list-style:none;}\r
+caption,th {text-align:left;}\r
+h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}\r
+q:before,q:after{content:'';}\r
+abbr,acronym {border:0;}\r
+\r
+/*=============*/\r
+/*  fonts.css  */\r
+/*=============*/\r
+\r
+/**\r
+ * 84.5% for !IE, keywords for IE to preserve user font-size adjustment\r
+ * Percents could work for IE, but for backCompat purposes, we are using keywords.\r
+ * x-small is for IE6/7 quirks mode.\r
+ *\r
+ */\r
+body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}\r
+table {font-size:inherit;font:100%;}\r
+/**\r
+ * 99% for safari; 100% is too large\r
+ */\r
+select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}\r
+/**\r
+ * Bump up !IE to get to 13px equivalent\r
+ */\r
+pre, code {font:115% monospace;*font-size:100%;}\r
+/**\r
+ * Default line-height based on font-size rather than "computed-value"\r
+ * see: http://www.w3.org/TR/CSS21/visudet.html#line-height\r
+ */\r
+body * {line-height:1.22em;}\r
+\r
+/*=============*/\r
+/*  grids.css  */\r
+/*=============*/\r
+\r
+/* for all templates and grids */\r
+body{text-align:center;}\r
+#ft{clear:both;}\r
+/**/\r
+/* 750 centered, and backward compatibility */\r
+#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {\r
+       margin:auto;text-align:left;\r
+       width:57.69em;*width:56.3em;min-width:750px;}\r
+/* 950 centered */\r
+#doc2 {\r
+       width:73.074em;*width:71.313em;min-width:950px;}\r
+/* 100% with 10px viewport side matting */\r
+#doc3 {\r
+       margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */\r
+       width:auto;}\r
+\r
+/* below required for all fluid grids; adjust widths and margins above accordingly */\r
+\r
+       /* to preserve source-order independence for Gecko */\r
+       .yui-b{position:relative;}\r
+       .yui-b{_position:static;} /* for IE < 7 */\r
+       #yui-main .yui-b{position:static;}\r
+\r
+#yui-main {width:100%;}\r
+.yui-t1 #yui-main,\r
+.yui-t2 #yui-main,\r
+.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}\r
+\r
+.yui-t4 #yui-main,\r
+.yui-t5 #yui-main,\r
+.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}\r
+\r
+.yui-t1 .yui-b {\r
+       float:left;\r
+    width:12.3207em;*width:12.0106em;}\r
+.yui-t1 #yui-main .yui-b{\r
+    margin-left:13.3207em;*margin-left:13.0106em;\r
+}\r
+\r
+.yui-t2 .yui-b {\r
+       float:left;\r
+    width:13.8456em;*width:13.512em;}\r
+.yui-t2 #yui-main .yui-b {\r
+    margin-left:14.8456em;*margin-left:14.512em;\r
+}\r
+\r
+.yui-t3 .yui-b {\r
+       float:left;\r
+    width:23.0759em;*width:22.52em;}\r
+.yui-t3 #yui-main .yui-b {\r
+    margin-left:24.0759em;*margin-left:23.52em;\r
+}\r
+\r
+.yui-t4 .yui-b {\r
+       float:right;\r
+    width:13.8456em;*width:13.512em;}\r
+.yui-t4 #yui-main .yui-b {\r
+    margin-right:14.8456em;*margin-right:14.512em;\r
+}\r
+\r
+.yui-t5 .yui-b {\r
+       float:right;\r
+    width:18.4608em;*width:18.016em;}\r
+.yui-t5 #yui-main .yui-b {\r
+    margin-right:19.4608em;*margin-right:19.016em;\r
+}\r
+\r
+.yui-t6 .yui-b {\r
+       float:right;\r
+    width:23.0759em;*width:22.52em;}\r
+.yui-t6 #yui-main .yui-b {\r
+    margin-right:24.0759em;*margin-right:23.52em;\r
+}\r
+\r
+.yui-t7 #yui-main .yui-b {\r
+       display:block;margin:0 0 1em 0;\r
+}\r
+#yui-main .yui-b {float:none;width:auto;}\r
+/* GRIDS (not TEMPLATES) */\r
+.yui-g .yui-u,\r
+.yui-g .yui-g,\r
+.yui-gc .yui-u,\r
+.yui-gc .yui-g .yui-u,\r
+.yui-ge .yui-u,\r
+.yui-gf .yui-u{float:right;display:inline;}\r
+.yui-g div.first,\r
+.yui-gc div.first,\r
+.yui-gc div.first div.first,\r
+.yui-gd div.first,\r
+.yui-ge div.first,\r
+.yui-gf div.first{float:left;}\r
+.yui-g .yui-u,\r
+.yui-g .yui-g{width:49.1%;}\r
+.yui-g .yui-g .yui-u,\r
+.yui-gc .yui-g .yui-u {width:48.1%;}\r
+.yui-gb .yui-u,\r
+.yui-gc .yui-u,\r
+.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}\r
+.yui-gb div.first,\r
+.yui-gc div.first,\r
+.yui-gd div.first{margin-left:0;}\r
+.yui-gc div.first,\r
+.yui-gd .yui-u{width:66%;}\r
+.yui-gd div.first{width:32%;}\r
+.yui-ge .yui-u{width:24%;}\r
+.yui-ge div.first,\r
+.yui-gf .yui-u{width:74.2%;}\r
+.yui-gf div.first{width:24%;}\r
+.yui-ge div.first{width:74.2%;}\r
+#bd:after,\r
+.yui-g:after,\r
+.yui-gb:after,\r
+.yui-gc:after,\r
+.yui-gd:after,\r
+.yui-ge:after,\r
+.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}\r
+#bd,\r
+.yui-g,\r
+.yui-gb,\r
+.yui-gc,\r
+.yui-gd,\r
+.yui-ge,\r
+.yui-gf{zoom:1;}
\ No newline at end of file
index f593c8fad47a561c1bcf69a1ec0fa5efcbef31fc..990e8ccffa69ab48a26ff1b658ee11cb9a719e2e 100755 (executable)
@@ -1,9 +1,17 @@
-CSS Reset Release Notes\r
+YUI Library - Reset - Release Notes\r
 \r
-*** version 0.11.0 ***\r
+Version 0.12.0\r
 \r
-* No changes.\r
+  * Added: h1,h2,h3,h4,h5,h6{font-weight:normal;}\r
 \r
-*** version 0.10.0 ***\r
+  * Added: abbr,acronym {border:0;}\r
+  \r
+  * Added: textarea {padding:0;margin:0;}\r
 \r
-* Initial release
\ No newline at end of file
+Version 0.11.0\r
+\r
+  * No changes.\r
+\r
+Version 0.10.0\r
+\r
+  * Initial release.
\ No newline at end of file
index b8203312acd1e178ab3924af79c0f3a847c9d419..d7e15333554b5a590e7fd70e3f563069bbde861a 100755 (executable)
@@ -1,7 +1 @@
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
-*/\r
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,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;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,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;}ol,ul {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;}
\ No newline at end of file
index b1e706eafd5db1c71121c86a2daa2ecbeec990a1..c48881114710bf2860a758807d7ab8d4a63f0952 100755 (executable)
@@ -2,13 +2,14 @@
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
 Code licensed under the BSD License:\r
 http://developer.yahoo.net/yui/license.txt\r
-version: 0.11.0\r
+version: 0.12.0\r
 */\r
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}\r
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}\r
 table{border-collapse:collapse;border-spacing:0;}\r
 fieldset,img{border:0;}\r
 address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}\r
 ol,ul {list-style:none;}\r
 caption,th {text-align:left;}\r
-h1,h2,h3,h4,h5,h6{font-size:100%;}\r
-q:before,q:after{content:'';}
\ No newline at end of file
+h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}\r
+q:before,q:after{content:'';}\r
+abbr,acronym {border:0;}
\ No newline at end of file
index bde704ebbe95a07cc6a6ec3726ca3ddcccc6195d..dc317b469039ebb681c5cb21d93a596f1a3144c6 100755 (executable)
@@ -1,5 +1,30 @@
 Slider - Release Notes\r
 \r
+0.12.0\r
+\r
+   * Added "slideStart", "slideEnd", and "change" custom events.  The abstract\r
+     methods these will eventually replace still work.\r
+\r
+   * The default animation duration is 0.2 seconds (reduced from 0.4 seconds),\r
+     and is configurable via the animationDuration property.\r
+\r
+   * Keyboard navigation is now built in.  The background needs a tabindex for\r
+     keyboard nav to work.  Keyboard nav can be disabled by setting enableKeys\r
+     to false.  The number of pixels the slider moves when the arrow keys\r
+     are pressed is controlled by keyIncrement, and defaults to 20.  Note, \r
+     Safari support limited to background element types that support focus\r
+     in that browser. http://bugs.webkit.org/show_bug.cgi?id=7138\r
+\r
+   * Fixed broken doctype in examples/index.html\r
+\r
+   * Catching an unhandled script exception in FF that could occur when\r
+     attempting to focus the slider background while a text field without\r
+     autocomplete="false" has focus\r
+\r
+0.11.3\r
+\r
+   * No change\r
+\r
 0.11.0\r
 \r
    * When the thumb is clicked and dragged, the click position delta is properly\r
index dacc3808d526d1f47b7c9a994eef8703a1e6f29f..af921eed599dd30efa2cefe5c41a9648fa6f3485 100755 (executable)
@@ -1,18 +1,33 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
 \r
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+/**\r
+ * The Slider component is a UI control that enables the user to adjust\r
+ * values in a finite range along one or two axes. Typically, the Slider\r
+ * control is used in a web application as a rich, visual replacement\r
+ * for an input box that takes a number as input. The Slider control can\r
+ * also easily accommodate a second dimension, providing x,y output for\r
+ * a selection point chosen from a rectangular region.\r
+ *\r
+ * @module    slider\r
+ * @title     Slider Widget\r
+ * @namespace YAHOO.widget\r
+ * @requires  yahoo,dom,dragdrop,event\r
+ * @optional  animation\r
+ */\r
 \r
 /**\r
  * A DragDrop implementation that can be used as a background for a\r
- * slider.  It takes a reference to the thumb instance \r
- * so it can delegate some of the events to it.  The goal is to make the \r
- * thumb jump to the location on the background when the background is \r
- * clicked.  \r
+ * slider.  It takes a reference to the thumb instance\r
+ * so it can delegate some of the events to it.  The goal is to make the\r
+ * thumb jump to the location on the background when the background is\r
+ * clicked.\r
  *\r
+ * @class Slider\r
  * @extends YAHOO.util.DragDrop\r
  * @constructor\r
  * @param {String} id     The id of the element linked to this instance\r
@@ -20,723 +35,911 @@ version: 0.11.0
  * @param {String} sType  The type of slider (horiz, vert, region)\r
  */\r
 YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {\r
-       if (sElementId) {\r
+    if (sElementId) {\r
 \r
         /**\r
          * The type of the slider (horiz, vert, region)\r
+         * @property type\r
          * @type string\r
          */\r
         this.type = sType;\r
 \r
-               this.init(sElementId, sGroup, true);\r
+        this.init(sElementId, sGroup, true);\r
+\r
+        //this.removeInvalidHandleType("A");\r
 \r
         this.logger = new YAHOO.widget.LogWriter(this.toString());\r
 \r
-               var self = this;\r
-\r
-               /**\r
-                * a YAHOO.widget.SliderThumb instance that we will use to \r
-                * reposition the thumb when the background is clicked\r
-                *\r
-                * @type Slider \r
-                */\r
-               this.thumb = oThumb;\r
-\r
-               // add handler for the handle onchange event\r
-               oThumb.onChange = function() { \r
-                       self.onThumbChange(); \r
-               };\r
-\r
-\r
-               /**\r
-                * Overrides the isTarget property in YAHOO.util.DragDrop\r
-                * @private\r
-                */\r
-               this.isTarget = false;\r
-       \r
-               /**\r
-                * Flag that determines if the thumb will animate when moved\r
-                * @type boolean\r
-                */\r
-               this.animate = YAHOO.widget.Slider.ANIM_AVAIL;\r
+        var self = this;\r
+\r
+        /**\r
+         * Event the fires when the value of the control changes.  If\r
+         * the control is animated the event will fire every point\r
+         * along the way.\r
+         * @event change\r
+         * @param {int} new\r
+         * @param {int} firstOffset the number of pixels the thumb has moved\r
+         * from its start position. Normal horizontal and vertical sliders will only\r
+         * have the firstOffset.  Regions will have both, the first is the horizontal\r
+         * offset, the second the vertical.\r
+         * @param {int} secondOffset the y offset for region sliders\r
+         */\r
+        this.createEvent("change", this);\r
+\r
+        /**\r
+         * Event that fires at the end of a slider thumb move.\r
+         * @event slideStart\r
+         */\r
+        this.createEvent("slideStart", this);\r
+\r
+        /**\r
+         * Event that fires at the end of a slider thumb move\r
+         * @event slideEnd\r
+         */\r
+        this.createEvent("slideEnd", this);\r
+\r
+        /**\r
+         * A YAHOO.widget.SliderThumb instance that we will use to\r
+         * reposition the thumb when the background is clicked\r
+         * @property thumb\r
+         * @type YAHOO.widget.SliderThumb\r
+         */\r
+        this.thumb = oThumb;\r
+\r
+        // add handler for the handle onchange event\r
+        oThumb.onChange = function() {\r
+            self.handleThumbChange();\r
+        };\r
+\r
+        /**\r
+         * Overrides the isTarget property in YAHOO.util.DragDrop\r
+         * @property isTarget\r
+         * @private\r
+         */\r
+        this.isTarget = false;\r
+\r
+        /**\r
+         * Flag that determines if the thumb will animate when moved\r
+         * @property animate\r
+         * @type boolean\r
+         */\r
+        this.animate = YAHOO.widget.Slider.ANIM_AVAIL;\r
 \r
         /**\r
          * Set to false to disable a background click thumb move\r
+         * @property backgroundEnabled\r
+         * @type boolean\r
          */\r
         this.backgroundEnabled = true;\r
 \r
-               /**\r
-                * Adjustment factor for tick animation, the more ticks, the\r
-                * faster the animation (by default)\r
-                *\r
-                * @type int\r
-                */\r
-               this.tickPause = 40;\r
-               if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
-                       this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
-               } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
-                       this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
-               }\r
+        /**\r
+         * Adjustment factor for tick animation, the more ticks, the\r
+         * faster the animation (by default)\r
+         * @property tickPause\r
+         * @type int\r
+         */\r
+        this.tickPause = 40;\r
 \r
-        this.logger.log("tickPause: " + this.tickPause);\r
+        /**\r
+         * Enables the arrow, home and end keys, defaults to true.\r
+         * @property enableKeys\r
+         * @type boolean\r
+         */\r
+        this.enableKeys = true;\r
 \r
-               // delegate thumb methods\r
-               oThumb.onMouseDown = function () { return self.focus(); };\r
-               //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
-               // oThumb.lock = function() { self.lock(); };\r
-               // oThumb.unlock = function() { self.unlock(); };\r
-               oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
-               oThumb.onDrag = function() { self.fireEvents(); };\r
-               oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
-       }\r
-};\r
+        /**\r
+         * Specifies the number of pixels the arrow keys will move the slider.\r
+         * Default is 25.\r
+         * @property keyIncrement\r
+         * @type int\r
+         */\r
+        this.keyIncrement = 20;\r
 \r
-//YAHOO.widget.Slider.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop);\r
+        /**\r
+         * moveComplete is set to true when the slider has moved to its final\r
+         * destination.  For animated slider, this value can be checked in\r
+         * the onChange handler to make it possible to execute logic only\r
+         * when the move is complete rather than at all points along the way.\r
+         *\r
+         * @property moveComplete\r
+         * @type Boolean\r
+         */\r
+        this.moveComplete = true;\r
 \r
-// YAHOO.widget.Slider.prototype.onAvailable = function() {\r
-    // this.logger.log("bg avail");\r
-// };\r
+        /**\r
+         * If animation is configured, specifies the length of the animation\r
+         * in seconds.\r
+         * @property animationDuration\r
+         * @type int\r
+         * @default 0.2\r
+         */\r
+        this.animationDuration = 0.2;\r
+\r
+        if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
+            this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
+        } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
+            this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
+        }\r
+\r
+        this.logger.log("tickPause: " + this.tickPause);\r
+\r
+        // delegate thumb methods\r
+        oThumb.onMouseDown = function () { return self.focus(); };\r
+        //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
+        // oThumb.lock = function() { self.lock(); };\r
+        // oThumb.unlock = function() { self.unlock(); };\r
+        oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
+        oThumb.onDrag = function() { self.fireEvents(); };\r
+        oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
+    }\r
+};\r
 \r
 /**\r
  * Factory method for creating a horizontal slider\r
- *\r
+ * @method YAHOO.widget.Slider.getHorizSlider\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iLeft the number of pixels the element can move left\r
  * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
+ * @param {int} iTickSize optional parameter for specifying that the element\r
  * should move a certain number pixels at a time.\r
  * @return {Slider} a horizontal slider control\r
  */\r
-YAHOO.widget.Slider.getHorizSlider = \r
-       function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
-                                                          iLeft, iRight, 0, 0, iTickSize), "horiz");\r
+YAHOO.widget.Slider.getHorizSlider =\r
+    function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId,\r
+                               iLeft, iRight, 0, 0, iTickSize), "horiz");\r
 };\r
 \r
 /**\r
  * Factory method for creating a vertical slider\r
- *\r
+ * @method YAHOO.widget.Slider.getVertSlider\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iUp the number of pixels the element can move up\r
  * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
+ * @param {int} iTickSize optional parameter for specifying that the element\r
  * should move a certain number pixels at a time.\r
  * @return {Slider} a vertical slider control\r
  */\r
-YAHOO.widget.Slider.getVertSlider = \r
-       function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
-                                                          iUp, iDown, iTickSize), "vert");\r
+YAHOO.widget.Slider.getVertSlider =\r
+    function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0,\r
+                               iUp, iDown, iTickSize), "vert");\r
 };\r
 \r
 /**\r
  * Factory method for creating a slider region like the one in the color\r
  * picker example\r
- *\r
+ * @method YAHOO.widget.Slider.getSliderRegion\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iLeft the number of pixels the element can move left\r
  * @param {int} iRight the number of pixels the element can move right\r
  * @param {int} iUp the number of pixels the element can move up\r
  * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
+ * @param {int} iTickSize optional parameter for specifying that the element\r
  * should move a certain number pixels at a time.\r
  * @return {Slider} a slider region control\r
  */\r
-YAHOO.widget.Slider.getSliderRegion = \r
-       function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
-                                                          iUp, iDown, iTickSize), "region");\r
+YAHOO.widget.Slider.getSliderRegion =\r
+    function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight,\r
+                               iUp, iDown, iTickSize), "region");\r
 };\r
 \r
 /**\r
  * By default, animation is available if the animation library is detected.\r
+ * @property YAHOO.widget.Slider.ANIM_AVAIL\r
+ * @static\r
  * @type boolean\r
  */\r
 YAHOO.widget.Slider.ANIM_AVAIL = true;\r
 \r
-YAHOO.widget.Slider.prototype.setStartSliderState = function() {\r
+YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+\r
+    onAvailable: function() {\r
+        var Event = YAHOO.util.Event;\r
+        Event.on(this.id, "keydown",  this.handleKeyDown,  this, true);\r
+        Event.on(this.id, "keypress", this.handleKeyPress, this, true);\r
+    },\r
+\r
+    handleKeyPress: function(e) {\r
+        if (this.enableKeys) {\r
+            var Event = YAHOO.util.Event;\r
+            var kc = Event.getCharCode(e);\r
+            switch (kc) {\r
+                case 0x25: // left\r
+                case 0x26: // up\r
+                case 0x27: // right\r
+                case 0x28: // down\r
+                case 0x24: // home\r
+                case 0x23: // end\r
+                    Event.preventDefault(e);\r
+                    break;\r
+                default:\r
+            }\r
+        }\r
+   },\r
+\r
+    handleKeyDown: function(e) {\r
+        if (this.enableKeys) {\r
+            var Event = YAHOO.util.Event;\r
+\r
+            var kc = Event.getCharCode(e), t=this.thumb;\r
+            var h=this.getXValue(),v=this.getYValue();\r
+\r
+            var horiz = false;\r
+            var changeValue = true;\r
+            switch (kc) {\r
+\r
+                // left\r
+                case 0x25: h -= this.keyIncrement; break;\r
+\r
+                // up\r
+                case 0x26: v -= this.keyIncrement; break;\r
 \r
-    this.logger.log("Fixing state");\r
+                // right\r
+                case 0x27: h += this.keyIncrement; break;\r
 \r
-    this.setThumbCenterPoint();\r
+                // down\r
+                case 0x28: v += this.keyIncrement; break;\r
+\r
+                // home\r
+                case 0x24: h = t.leftConstraint;\r
+                           v = t.topConstraint;\r
+                           break;\r
+\r
+                // end\r
+                case 0x23: h = t.rightConstraint;\r
+                           v = t.bottomConstraint;\r
+                           break;\r
+\r
+                default:   changeValue = false;\r
+            }\r
+\r
+            if (changeValue) {\r
+                if (t._isRegion) {\r
+                    this.setRegionValue(h, v, true);\r
+                } else {\r
+                    var newVal = (t._isHoriz) ? h : v;\r
+                    this.setValue(newVal, true);\r
+                }\r
+                Event.stopEvent(e);\r
+            }\r
+\r
+        }\r
+    },\r
 \r
     /**\r
-     * The basline position of the background element, used\r
-     * to determine if the background has moved since the last\r
-     * operation.\r
-     * @type int[]\r
+     * Initialization that sets up the value offsets once the elements are ready\r
+     * @method setSliderStartState\r
      */\r
-    this.baselinePos = YAHOO.util.Dom.getXY(this.getEl());\r
+    setStartSliderState: function() {\r
 \r
-    this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos);\r
+        this.logger.log("Fixing state");\r
 \r
-    if (this.thumb._isRegion) {\r
-        if (this.deferredSetRegionValue) {\r
-            this.setRegionValue.apply(this, this.deferredSetRegionValue, true);\r
+        this.setThumbCenterPoint();\r
+\r
+        /**\r
+         * The basline position of the background element, used\r
+         * to determine if the background has moved since the last\r
+         * operation.\r
+         * @property baselinePos\r
+         * @type [int, int]\r
+         */\r
+        this.baselinePos = YAHOO.util.Dom.getXY(this.getEl());\r
+\r
+        this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos);\r
+\r
+        if (this.thumb._isRegion) {\r
+            if (this.deferredSetRegionValue) {\r
+                this.setRegionValue.apply(this, this.deferredSetRegionValue, true);\r
+                this.deferredSetRegionValue = null;\r
+            } else {\r
+                this.setRegionValue(0, 0, true);\r
+            }\r
         } else {\r
-            this.setRegionValue(0, 0, true);\r
+            if (this.deferredSetValue) {\r
+                this.setValue.apply(this, this.deferredSetValue, true);\r
+                this.deferredSetValue = null;\r
+            } else {\r
+                this.setValue(0, true, true);\r
+            }\r
         }\r
-    } else {\r
-        if (this.deferredSetValue) {\r
-            this.setValue.apply(this, this.deferredSetValue, true);\r
-        } else {\r
-            this.setValue(0, true, true);\r
+    },\r
+\r
+    /**\r
+     * When the thumb is available, we cache the centerpoint of the element so\r
+     * we can position the element correctly when the background is clicked\r
+     * @method setThumbCenterPoint\r
+     */\r
+    setThumbCenterPoint: function() {\r
+\r
+        var el = this.thumb.getEl();\r
+\r
+        if (el) {\r
+            /**\r
+             * The center of the slider element is stored so we can position\r
+             * place it in the correct position when the background is clicked\r
+             * @property thumbCenterPoint\r
+             * @type {"x": int, "y": int}\r
+             */\r
+            this.thumbCenterPoint = {\r
+                    x: parseInt(el.offsetWidth/2, 10),\r
+                    y: parseInt(el.offsetHeight/2, 10)\r
+            };\r
         }\r
-    }\r
-};\r
 \r
-YAHOO.widget.Slider.prototype.setThumbCenterPoint = function() {\r
+    },\r
 \r
-    var el = this.thumb.getEl();\r
+    /**\r
+     * Locks the slider, overrides YAHOO.util.DragDrop\r
+     * @method lock\r
+     */\r
+    lock: function() {\r
+        this.logger.log("locking");\r
+        this.thumb.lock();\r
+        this.locked = true;\r
+    },\r
 \r
-    if (el) {\r
-        /**\r
-         * the center of the slider element is stored so we can position \r
-         * place it in the correct position when the background is clicked\r
-         *\r
-         * @type Coordinate\r
-         */\r
-        this.thumbCenterPoint = { \r
-                x: parseInt(el.offsetWidth/2, 10), \r
-                y: parseInt(el.offsetHeight/2, 10) \r
-        };\r
-    }\r
+    /**\r
+     * Unlocks the slider, overrides YAHOO.util.DragDrop\r
+     * @method unlock\r
+     */\r
+    unlock: function() {\r
+        this.logger.log("unlocking");\r
+        this.thumb.unlock();\r
+        this.locked = false;\r
+    },\r
 \r
-};\r
+    /**\r
+     * Handles mouseup event on the slider background\r
+     * @method thumbMouseUp\r
+     * @private\r
+     */\r
+    thumbMouseUp: function() {\r
+        this.logger.log("bg mouseup");\r
+        if (!this.isLocked() && !this.moveComplete) {\r
+            this.endMove();\r
+        }\r
 \r
-/**\r
- * Lock the slider, overrides YAHOO.util.DragDrop\r
- */\r
-YAHOO.widget.Slider.prototype.lock = function() {\r
-       this.logger.log("locking");\r
-       this.thumb.lock();\r
-       this.locked = true;\r
-};\r
+    },\r
 \r
-/**\r
- * Unlock the slider, overrides YAHOO.util.DragDrop\r
- */\r
-YAHOO.widget.Slider.prototype.unlock = function() {\r
-       this.logger.log("unlocking");\r
-       this.thumb.unlock();\r
-       this.locked = false;\r
-};\r
+    /**\r
+     * Returns a reference to this slider's thumb\r
+     * @method getThumb\r
+     * @return {SliderThumb} this slider's thumb\r
+     */\r
+    getThumb: function() {\r
+        return this.thumb;\r
+    },\r
 \r
-/**\r
- * handles mouseup event on the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.thumbMouseUp = function() {\r
-       this.logger.log("bg mouseup");\r
-    if (!this.isLocked() && !this.moveComplete) {\r
-           this.endMove();\r
-    }\r
+    /**\r
+     * Try to focus the element when clicked so we can add\r
+     * accessibility features\r
+     * @method focus\r
+     * @private\r
+     */\r
+    focus: function() {\r
+        this.logger.log("focus");\r
+\r
+        // Focus the background element if possible\r
+        var el = this.getEl();\r
+\r
+        if (el.focus) {\r
+            try {\r
+                el.focus();\r
+            } catch(e) {\r
+                // Prevent permission denied unhandled exception in FF that can\r
+                // happen when setting focus while another element is handling\r
+                // the blur.  @TODO this is still writing to the error log\r
+                // (unhandled error) in FF1.5 with strict error checking on.\r
+            }\r
+        }\r
 \r
-};\r
+        this.verifyOffset();\r
 \r
-/**\r
- * Returns a reference to this slider's thumb\r
- */\r
-YAHOO.widget.Slider.prototype.getThumb = function() {\r
-    return this.thumb;\r
-};\r
+        if (this.isLocked()) {\r
+            return false;\r
+        } else {\r
+            this.onSlideStart();\r
+            return true;\r
+        }\r
+    },\r
 \r
-/**\r
- * Try to focus the element when clicked so we can add\r
- * accessibility features\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.focus = function() {\r
-    this.logger.log("focus");\r
+    /**\r
+     * Event that fires when the value of the slider has changed\r
+     * @method onChange\r
+     * @param {int} firstOffset the number of pixels the thumb has moved\r
+     * from its start position. Normal horizontal and vertical sliders will only\r
+     * have the firstOffset.  Regions will have both, the first is the horizontal\r
+     * offset, the second the vertical.\r
+     * @param {int} secondOffset the y offset for region sliders\r
+     * @deprecated use instance.subscribe("change") instead\r
+     */\r
+    onChange: function (firstOffset, secondOffset) {\r
+        /* override me */\r
+        this.logger.log("onChange: " + firstOffset + ", " + secondOffset);\r
+    },\r
 \r
-    // Focus the background element if possible\r
-    var el = this.getEl();\r
+    /**\r
+     * Event that fires when the at the beginning of the slider thumb move\r
+     * @method onSlideStart\r
+     * @deprecated use instance.subscribe("slideStart") instead\r
+     */\r
+    onSlideStart: function () {\r
+        /* override me */\r
+        this.logger.log("onSlideStart");\r
+    },\r
 \r
-    if (el.focus) {\r
-        el.focus();\r
-    }\r
+    /**\r
+     * Event that fires at the end of a slider thumb move\r
+     * @method onSliderEnd\r
+     * @deprecated use instance.subscribe("slideEnd") instead\r
+     */\r
+    onSlideEnd: function () {\r
+        /* override me */\r
+        this.logger.log("onSlideEnd");\r
+    },\r
 \r
-    this.verifyOffset();\r
+    /**\r
+     * Returns the slider's thumb offset from the start position\r
+     * @method getValue\r
+     * @return {int} the current value\r
+     */\r
+    getValue: function () {\r
+        return this.thumb.getValue();\r
+    },\r
 \r
-    if (this.isLocked()) {\r
-        return false;\r
-    } else {\r
-        this.onSlideStart();\r
-           return true;\r
-    }\r
-};\r
+    /**\r
+     * Returns the slider's thumb X offset from the start position\r
+     * @method getXValue\r
+     * @return {int} the current horizontal offset\r
+     */\r
+    getXValue: function () {\r
+        return this.thumb.getXValue();\r
+    },\r
 \r
-/**\r
- * Event that fires when the value of the slider has changed\r
- *\r
- * @param {int} offsetFromStart the number of pixels the thumb has moved\r
- * from its start position. Normal horizontal and vertical sliders will only\r
- * have the firstOffset.  Regions will have both, the first is the horizontal\r
- * offset, the second the vertical.\r
- */\r
-YAHOO.widget.Slider.prototype.onChange = function (firstOffset, secondOffset) { \r
-       /* override me */ \r
-       this.logger.log("onChange: " + firstOffset + ", " + secondOffset);\r
-};\r
+    /**\r
+     * Returns the slider's thumb Y offset from the start position\r
+     * @method getYValue\r
+     * @return {int} the current vertical offset\r
+     */\r
+    getYValue: function () {\r
+        return this.thumb.getYValue();\r
+    },\r
 \r
-/**\r
- * Event that fires when the at the beginning of the slider thumb move\r
- */\r
-YAHOO.widget.Slider.prototype.onSlideStart = function () { \r
-       /* override me */ \r
-       this.logger.log("onSlideStart");\r
-};\r
+    /**\r
+     * Internal handler for the slider thumb's onChange event\r
+     * @method handleThumbChange\r
+     * @private\r
+     */\r
+    handleThumbChange: function () {\r
+        var t = this.thumb;\r
+        if (t._isRegion) {\r
+            t.onChange(t.getXValue(), t.getYValue());\r
+            this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );\r
+        } else {\r
+            t.onChange(t.getValue());\r
+            this.fireEvent("change", t.getValue());\r
+        }\r
 \r
-/**\r
- * Event that fires at the end of a slider thumb move\r
- */\r
-YAHOO.widget.Slider.prototype.onSlideEnd = function () { \r
-       /* override me */ \r
-       this.logger.log("onSlideEnd");\r
-};\r
+    },\r
 \r
-/**\r
- * Returns the slider's thumb offset from the start position\r
- *\r
- * @return {int} the current value\r
- */\r
-YAHOO.widget.Slider.prototype.getValue = function () { \r
-       return this.thumb.getValue();\r
-};\r
+    /**\r
+     * Provides a way to set the value of the slider in code.\r
+     * @method setValue\r
+     * @param {int} newOffset the number of pixels the thumb should be\r
+     * positioned away from the initial start point\r
+     * @param {boolean} skipAnim set to true to disable the animation\r
+     * for this move action (but not others).\r
+     * @param {boolean} force ignore the locked setting and set value anyway\r
+     * @return {boolean} true if the move was performed, false if it failed\r
+     */\r
+    setValue: function(newOffset, skipAnim, force) {\r
+        this.logger.log("setValue " + newOffset);\r
 \r
-/**\r
- * Returns the slider's thumb X offset from the start position\r
- *\r
- * @return {int} the current horizontal offset\r
- */\r
-YAHOO.widget.Slider.prototype.getXValue = function () { \r
-       return this.thumb.getXValue();\r
-};\r
+        if (!this.thumb.available) {\r
+            this.logger.log("defer setValue until after onAvailble");\r
+            this.deferredSetValue = arguments;\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Returns the slider's thumb Y offset from the start position\r
- *\r
- * @return {int} the current vertical offset\r
- */\r
-YAHOO.widget.Slider.prototype.getYValue = function () { \r
-       return this.thumb.getYValue();\r
-};\r
+        if (this.isLocked() && !force) {\r
+            this.logger.log("Can't set the value, the control is locked");\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Internal handler for the slider thumb's onChange event\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onThumbChange = function () { \r
-       var t = this.thumb;\r
-       if (t._isRegion) {\r
-               t.onChange(t.getXValue(), t.getYValue());\r
-       } else {\r
-               t.onChange(t.getValue());\r
-       }\r
+        if ( isNaN(newOffset) ) {\r
+            this.logger.log("setValue, Illegal argument: " + newOffset);\r
+            return false;\r
+        }\r
 \r
-};\r
+        var t = this.thumb;\r
+        var newX, newY;\r
+        this.verifyOffset();\r
+        if (t._isRegion) {\r
+            return false;\r
+        } else if (t._isHoriz) {\r
+            this.onSlideStart();\r
+            // this.fireEvent("slideStart");\r
+            newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
+            this.moveThumb(newX, t.initPageY, skipAnim);\r
+        } else {\r
+            this.onSlideStart();\r
+            // this.fireEvent("slideStart");\r
+            newY = t.initPageY + newOffset + this.thumbCenterPoint.y;\r
+            this.moveThumb(t.initPageX, newY, skipAnim);\r
+        }\r
 \r
-/**\r
- * Provides a way to set the value of the slider in code.\r
- *\r
- * @param {int} newOffset the number of pixels the thumb should be\r
- * positioned away from the initial start point \r
- * @param {boolean} skipAnim set to true to disable the animation\r
- * for this move action (but not others).\r
- * @param {boolean} force ignore the locked setting and set value anyway\r
- * @return {boolean} true if the move was performed, false if it failed\r
- */\r
-YAHOO.widget.Slider.prototype.setValue = function(newOffset, skipAnim, force) {\r
-    this.logger.log("setValue " + newOffset);\r
+        return true;\r
+    },\r
 \r
-    if (!this.thumb.available) {\r
-        this.logger.log("defer setValue until after onAvailble");\r
-        this.deferredSetValue = arguments;\r
-        return false;\r
-    }\r
+    /**\r
+     * Provides a way to set the value of the region slider in code.\r
+     * @method setRegionValue\r
+     * @param {int} newOffset the number of pixels the thumb should be\r
+     * positioned away from the initial start point (x axis for region)\r
+     * @param {int} newOffset2 the number of pixels the thumb should be\r
+     * positioned away from the initial start point (y axis for region)\r
+     * @param {boolean} skipAnim set to true to disable the animation\r
+     * for this move action (but not others).\r
+     * @param {boolean} force ignore the locked setting and set value anyway\r
+     * @return {boolean} true if the move was performed, false if it failed\r
+     */\r
+    setRegionValue: function(newOffset, newOffset2, skipAnim) {\r
 \r
-    if (this.isLocked() && !force) {\r
-        this.logger.log("Can't set the value, the control is locked");\r
-        return false;\r
-    }\r
+        if (!this.thumb.available) {\r
+            this.logger.log("defer setRegionValue until after onAvailble");\r
+            this.deferredSetRegionValue = arguments;\r
+            return false;\r
+        }\r
 \r
-       if ( isNaN(newOffset) ) {\r
-               this.logger.log("setValue, Illegal argument: " + newOffset);\r
-               return false;\r
-       }\r
+        if (this.isLocked() && !force) {\r
+            this.logger.log("Can't set the value, the control is locked");\r
+            return false;\r
+        }\r
 \r
-       var t = this.thumb;\r
-       var newX, newY;\r
-    this.verifyOffset();\r
-       if (t._isRegion) {\r
-        return false;\r
-       } else if (t._isHoriz) {\r
-        this.onSlideStart();\r
-               newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
-               this.moveThumb(newX, t.initPageY, skipAnim);\r
-       } else {\r
-        this.onSlideStart();\r
-               newY = t.initPageY + newOffset + this.thumbCenterPoint.y;\r
-               this.moveThumb(t.initPageX, newY, skipAnim);\r
-       }\r
-\r
-       return true;\r
-};\r
+        if ( isNaN(newOffset) ) {\r
+            this.logger.log("setRegionValue, Illegal argument: " + newOffset);\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Provides a way to set the value of the region slider in code.\r
- *\r
- * @param {int} newOffset the number of pixels the thumb should be\r
- * positioned away from the initial start point \r
- * @param {int} newOffset2 the number of pixels the thumb should be\r
- * positioned away from the initial start point (y axis for region)\r
- * @param {boolean} skipAnim set to true to disable the animation\r
- * for this move action (but not others).\r
- * @param {boolean} force ignore the locked setting and set value anyway\r
- * @return {boolean} true if the move was performed, false if it failed\r
- */\r
-YAHOO.widget.Slider.prototype.setRegionValue = function(newOffset, newOffset2, skipAnim) {\r
+        var t = this.thumb;\r
+        if (t._isRegion) {\r
+            this.onSlideStart();\r
+            var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
+            var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;\r
+            this.moveThumb(newX, newY, skipAnim);\r
+            return true;\r
+        }\r
 \r
-    if (!this.thumb.available) {\r
-        this.logger.log("defer setRegionValue until after onAvailble");\r
-        this.deferredSetRegionValue = arguments;\r
         return false;\r
-    }\r
 \r
-    if (this.isLocked() && !force) {\r
-        this.logger.log("Can't set the value, the control is locked");\r
-        return false;\r
-    }\r
+    },\r
 \r
-       if ( isNaN(newOffset) ) {\r
-               this.logger.log("setRegionValue, Illegal argument: " + newOffset);\r
-               return false;\r
-       }\r
+    /**\r
+     * Checks the background position element position.  If it has moved from the\r
+     * baseline position, the constraints for the thumb are reset\r
+     * @method verifyOffset\r
+     * @return {boolean} True if the offset is the same as the baseline.\r
+     */\r
+    verifyOffset: function() {\r
 \r
-       var t = this.thumb;\r
-       if (t._isRegion) {\r
-        this.onSlideStart();\r
-               var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
-               var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;\r
-               this.moveThumb(newX, newY, skipAnim);\r
-           return true;\r
-       }\r
+        var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
+        this.logger.log("newPos: " + newPos);\r
 \r
-    return false;\r
+        if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
+            this.logger.log("background moved, resetting constraints");\r
+            this.thumb.resetConstraints();\r
+            this.baselinePos = newPos;\r
+            return false;\r
+        }\r
 \r
-};\r
+        return true;\r
+    },\r
 \r
-/**\r
- * Checks the background position element position.  If it has moved from the\r
- * baseline position, the constraints for the thumb are reset\r
- * @return {boolean} True if the offset is the same as the baseline.\r
- */\r
-YAHOO.widget.Slider.prototype.verifyOffset = function() {\r
+    /**\r
+     * Move the associated slider moved to a timeout to try to get around the\r
+     * mousedown stealing moz does when I move the slider element between the\r
+     * cursor and the background during the mouseup event\r
+     * @method moveThumb\r
+     * @param {int} x the X coordinate of the click\r
+     * @param {int} y the Y coordinate of the click\r
+     * @param {boolean} skipAnim don't animate if the move happend onDrag\r
+     * @private\r
+     */\r
+    moveThumb: function(x, y, skipAnim) {\r
 \r
-    var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
-    this.logger.log("newPos: " + newPos);\r
+        // this.logger.log("move thumb", "warn");\r
 \r
-    if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
-        this.logger.log("background moved, resetting constraints");\r
-        this.thumb.resetConstraints();\r
-        this.baselinePos = newPos;\r
-        return false;\r
-    }\r
+        var t = this.thumb;\r
+        var self = this;\r
 \r
-    return true;\r
-};\r
+        if (!t.available) {\r
+            this.logger.log("thumb is not available yet, aborting move");\r
+            return;\r
+        }\r
 \r
-/**\r
- * Move the associated slider moved to a timeout to try to get around the \r
- * mousedown stealing moz does when I move the slider element between the \r
- * cursor and the background during the mouseup event\r
- *\r
- * @param {int} x the X coordinate of the click\r
- * @param {int} y the Y coordinate of the click\r
- * @param {boolean} skipAnim don't animate if the move happend onDrag\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.moveThumb = function(x, y, skipAnim) {\r
+        this.logger.log("move thumb, x: "  + x + ", y: " + y);\r
 \r
-        this.logger.log("move thumb", "warn");\r
+        // this.verifyOffset();\r
 \r
-       var t = this.thumb;\r
-       var self = this;\r
+        t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);\r
 \r
-    if (!t.available) {\r
-        this.logger.log("thumb is not available yet, aborting move");\r
-        return;\r
-    }\r
+        var _p = t.getTargetCoord(x, y);\r
+        var p = [_p.x, _p.y];\r
 \r
-       this.logger.log("move thumb, x: "  + x + ", y: " + y);\r
 \r
-    // this.verifyOffset();\r
+        this.fireEvent("slideStart");\r
 \r
-       t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);\r
+        if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {\r
+            this.logger.log("graduated");\r
+            // this.thumb._animating = true;\r
+            this.lock();\r
 \r
-       var _p = t.getTargetCoord(x, y);\r
-    var p = [_p.x, _p.y];\r
+            setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
 \r
+        } else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
+            this.logger.log("animating to " + p);\r
 \r
-       if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {\r
-               this.logger.log("graduated");\r
-               // this.thumb._animating = true;\r
-               this.lock();\r
-               \r
-               setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
+            // this.thumb._animating = true;\r
+            this.lock();\r
 \r
-       } else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
-               this.logger.log("animating to " + p);\r
+            var oAnim = new YAHOO.util.Motion(\r
+                    t.id, { points: { to: p } },\r
+                    this.animationDuration,\r
+                    YAHOO.util.Easing.easeOut );\r
 \r
-               // this.thumb._animating = true;\r
-               this.lock();\r
+            oAnim.onComplete.subscribe( function() { self.endMove(); } );\r
+            oAnim.animate();\r
+        } else {\r
+            t.setDragElPos(x, y);\r
+            // this.fireEvents();\r
+            this.endMove();\r
+        }\r
+    },\r
 \r
-               var oAnim = new YAHOO.util.Motion( \r
-                t.id, { points: { to: p } }, 0.4, YAHOO.util.Easing.easeOut );\r
+    /**\r
+     * Move the slider one tick mark towards its final coordinate.  Used\r
+     * for the animation when tick marks are defined\r
+     * @method moveOneTick\r
+     * @param {int[]} the destination coordinate\r
+     * @private\r
+     */\r
+    moveOneTick: function(finalCoord) {\r
 \r
-               oAnim.onComplete.subscribe( function() { self.endMove(); } );\r
-               oAnim.animate();\r
-       } else {\r
-               t.setDragElPos(x, y);\r
-               // this.fireEvents();\r
-               this.endMove();\r
-       }\r
-};\r
+        var t = this.thumb;\r
+        var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
+        var tmp;\r
 \r
-/**\r
- * Move the slider one tick mark towards its final coordinate.  Used\r
- * for the animation when tick marks are defined\r
- *\r
- * @param {int[]} the destination coordinate\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.moveOneTick = function(finalCoord) {\r
-\r
-       var t = this.thumb;\r
-       var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
-       var tmp;\r
-\r
-    // var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
-    // var thresh = 10;\r
-    // var thresh = t.tickSize + (Math.floor(t.tickSize/2));\r
-\r
-       var nextCoord = null;\r
-\r
-       if (t._isRegion) {\r
-        nextCoord = this._getNextX(curCoord, finalCoord);\r
-               var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
-        nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
-\r
-       } else if (t._isHoriz) {\r
-        nextCoord = this._getNextX(curCoord, finalCoord);\r
-       } else {\r
-        nextCoord = this._getNextY(curCoord, finalCoord);\r
-       }\r
-\r
-       this.logger.log("moveOneTick: " + \r
-                       " finalCoord: " + finalCoord +\r
-                       " curCoord: " + curCoord +\r
-                       " nextCoord: " + nextCoord);\r
-\r
-       if (nextCoord) {\r
-\r
-               // move to the next coord\r
-               // YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
-\r
-        // var el = t.getEl();\r
-        // YAHOO.util.Dom.setStyle(el, "left", (nextCoord[0] + this.thumb.deltaSetXY[0]) + "px");\r
-        // YAHOO.util.Dom.setStyle(el, "top",  (nextCoord[1] + this.thumb.deltaSetXY[1]) + "px");\r
-\r
-        this.thumb.alignElWithMouse(t.getEl(), nextCoord[0], nextCoord[1]);\r
-               \r
-               // check if we are in the final position, if not make a recursive call\r
-               if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) {\r
-                       var self = this;\r
-                       setTimeout(function() { self.moveOneTick(finalCoord); }, \r
-                                       this.tickPause);\r
-               } else {\r
+        // var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
+        // var thresh = 10;\r
+        // var thresh = t.tickSize + (Math.floor(t.tickSize/2));\r
+\r
+        var nextCoord = null;\r
+\r
+        if (t._isRegion) {\r
+            nextCoord = this._getNextX(curCoord, finalCoord);\r
+            var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
+            nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
+\r
+        } else if (t._isHoriz) {\r
+            nextCoord = this._getNextX(curCoord, finalCoord);\r
+        } else {\r
+            nextCoord = this._getNextY(curCoord, finalCoord);\r
+        }\r
+\r
+        this.logger.log("moveOneTick: " +\r
+                " finalCoord: " + finalCoord +\r
+                " curCoord: " + curCoord +\r
+                " nextCoord: " + nextCoord);\r
+\r
+        if (nextCoord) {\r
+\r
+            // move to the next coord\r
+            // YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
+\r
+            // var el = t.getEl();\r
+            // YAHOO.util.Dom.setStyle(el, "left", (nextCoord[0] + this.thumb.deltaSetXY[0]) + "px");\r
+            // YAHOO.util.Dom.setStyle(el, "top",  (nextCoord[1] + this.thumb.deltaSetXY[1]) + "px");\r
+\r
+            this.thumb.alignElWithMouse(t.getEl(), nextCoord[0], nextCoord[1]);\r
+\r
+            // check if we are in the final position, if not make a recursive call\r
+            if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) {\r
+                var self = this;\r
+                setTimeout(function() { self.moveOneTick(finalCoord); },\r
+                        this.tickPause);\r
+            } else {\r
+                this.endMove();\r
+            }\r
+        } else {\r
             this.endMove();\r
-               }\r
-       } else {\r
-        this.endMove();\r
-       }\r
+        }\r
 \r
-       //this.tickPause = Math.round(this.tickPause/2);\r
-};\r
+        //this.tickPause = Math.round(this.tickPause/2);\r
+    },\r
 \r
-/**\r
- * Returns the next X tick value based on the current coord and the target coord.\r
- * @private/\r
- */\r
-YAHOO.widget.Slider.prototype._getNextX = function(curCoord, finalCoord) {\r
-    this.logger.log("getNextX: " + curCoord + ", " + finalCoord);\r
-    var t = this.thumb;\r
-    var thresh;\r
-    var tmp = [];\r
-    var nextCoord = null;\r
-    if (curCoord[0] > finalCoord[0]) {\r
-        thresh = t.tickSize - this.thumbCenterPoint.x;\r
-        tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else if (curCoord[0] < finalCoord[0]) {\r
-        thresh = t.tickSize + this.thumbCenterPoint.x;\r
-        tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else {\r
-        // equal, do nothing\r
-    }\r
+    /**\r
+     * Returns the next X tick value based on the current coord and the target coord.\r
+     * @method _getNextX\r
+     * @private\r
+     */\r
+    _getNextX: function(curCoord, finalCoord) {\r
+        this.logger.log("getNextX: " + curCoord + ", " + finalCoord);\r
+        var t = this.thumb;\r
+        var thresh;\r
+        var tmp = [];\r
+        var nextCoord = null;\r
+        if (curCoord[0] > finalCoord[0]) {\r
+            thresh = t.tickSize - this.thumbCenterPoint.x;\r
+            tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else if (curCoord[0] < finalCoord[0]) {\r
+            thresh = t.tickSize + this.thumbCenterPoint.x;\r
+            tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else {\r
+            // equal, do nothing\r
+        }\r
 \r
-    return nextCoord;\r
-};\r
+        return nextCoord;\r
+    },\r
 \r
-/**\r
- * Returns the next Y tick value based on the current coord and the target coord.\r
- * @private/\r
- */\r
-YAHOO.widget.Slider.prototype._getNextY = function(curCoord, finalCoord) {\r
-    var t = this.thumb;\r
-    // var thresh = t.tickSize;\r
-    // var thresh = t.tickSize + this.thumbCenterPoint.y;\r
-    var thresh;\r
-    var tmp = [];\r
-    var nextCoord = null;\r
-\r
-    if (curCoord[1] > finalCoord[1]) {\r
-        thresh = t.tickSize - this.thumbCenterPoint.y;\r
-        tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else if (curCoord[1] < finalCoord[1]) {\r
-        thresh = t.tickSize + this.thumbCenterPoint.y;\r
-        tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else {\r
-        // equal, do nothing\r
-    }\r
+    /**\r
+     * Returns the next Y tick value based on the current coord and the target coord.\r
+     * @method _getNextY\r
+     * @private\r
+     */\r
+    _getNextY: function(curCoord, finalCoord) {\r
+        var t = this.thumb;\r
+        var thresh;\r
+        var tmp = [];\r
+        var nextCoord = null;\r
+\r
+        if (curCoord[1] > finalCoord[1]) {\r
+            thresh = t.tickSize - this.thumbCenterPoint.y;\r
+            tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else if (curCoord[1] < finalCoord[1]) {\r
+            thresh = t.tickSize + this.thumbCenterPoint.y;\r
+            tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else {\r
+            // equal, do nothing\r
+        }\r
 \r
-    return nextCoord;\r
-};\r
+        return nextCoord;\r
+    },\r
 \r
-/**\r
- * Resets the constraints before moving the thumb.\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.b4MouseDown = function(e) {\r
-    this.thumb.autoOffset();\r
-    this.thumb.resetConstraints();\r
-};\r
+    /**\r
+     * Resets the constraints before moving the thumb.\r
+     * @method b4MouseDown\r
+     * @private\r
+     */\r
+    b4MouseDown: function(e) {\r
+        this.thumb.autoOffset();\r
+        this.thumb.resetConstraints();\r
+    },\r
 \r
 \r
-/**\r
- * Handles the mousedown event for the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onMouseDown = function(e) {\r
-    // this.resetConstraints(true);\r
-    // this.thumb.resetConstraints(true);\r
-\r
-       if (! this.isLocked() && this.backgroundEnabled) {\r
-               var x = YAHOO.util.Event.getPageX(e);\r
-               var y = YAHOO.util.Event.getPageY(e);\r
-               this.logger.log("bg mousedown: " + x + "," + y);\r
-\r
-               this.focus();\r
-               this.moveThumb(x, y);\r
-       }\r
-       \r
-};\r
+    /**\r
+     * Handles the mousedown event for the slider background\r
+     * @method onMouseDown\r
+     * @private\r
+     */\r
+    onMouseDown: function(e) {\r
+        // this.resetConstraints(true);\r
+        // this.thumb.resetConstraints(true);\r
 \r
-/**\r
- * Handles the onDrag event for the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onDrag = function(e) {\r
-       if (! this.isLocked()) {\r
-               var x = YAHOO.util.Event.getPageX(e);\r
-               var y = YAHOO.util.Event.getPageY(e);\r
-               this.moveThumb(x, y, true);\r
-       }\r
-};\r
+        if (! this.isLocked() && this.backgroundEnabled) {\r
+            var x = YAHOO.util.Event.getPageX(e);\r
+            var y = YAHOO.util.Event.getPageY(e);\r
+            this.logger.log("bg mousedown: " + x + "," + y);\r
 \r
-/**\r
- * Fired when the slider movement ends\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.endMove = function () {\r
-       // this._animating = false;\r
-       this.unlock();\r
-       this.moveComplete = true;\r
-       this.fireEvents();\r
-       \r
-};\r
+            this.focus();\r
+            this.moveThumb(x, y);\r
+        }\r
 \r
-/**\r
- * Fires the change event if the value has been changed.  Ignored if we are in\r
- * the middle of an animation as the event will fire when the animation is\r
- * complete\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.fireEvents = function () {\r
-\r
-       var t = this.thumb;\r
-       // this.logger.log("FireEvents: " + t._isRegion);\r
-\r
-       t.cachePosition();\r
-\r
-       if (! this.isLocked()) {\r
-               if (t._isRegion) {\r
-                       this.logger.log("region");\r
-                       var newX = t.getXValue();\r
-                       var newY = t.getYValue();\r
-\r
-                       if (newX != this.previousX || newY != this.previousY) {\r
-                               // this.logger.log("Firing onchange");\r
-                               this.onChange( newX, newY );\r
-                       }\r
-\r
-                       this.previousX = newX;\r
-                       this.previousY = newY;\r
-\r
-               } else {\r
-                       var newVal = t.getValue();\r
-                       if (newVal != this.previousVal) {\r
-                               this.logger.log("Firing onchange: " + newVal);\r
-                               this.onChange( newVal );\r
-                       }\r
-                       this.previousVal = newVal;\r
-               }\r
-\r
-               if (this.moveComplete) {\r
-                       this.onSlideEnd();\r
-                       this.moveComplete = false;\r
-               }\r
-\r
-       }\r
-};\r
+    },\r
 \r
-/**\r
- * toString\r
- * @return {string} string representation of the instance\r
- */\r
-YAHOO.widget.Slider.prototype.toString = function () { \r
-    return ("Slider (" + this.type +") " + this.id);\r
-};\r
+    /**\r
+     * Handles the onDrag event for the slider background\r
+     * @method onDrag\r
+     * @private\r
+     */\r
+    onDrag: function(e) {\r
+        if (! this.isLocked()) {\r
+            var x = YAHOO.util.Event.getPageX(e);\r
+            var y = YAHOO.util.Event.getPageY(e);\r
+            this.moveThumb(x, y, true);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Fired when the slider movement ends\r
+     * @method endMove\r
+     * @private\r
+     */\r
+    endMove: function () {\r
+        // this._animating = false;\r
+        this.unlock();\r
+        this.moveComplete = true;\r
+        this.fireEvents();\r
+    },\r
+\r
+    /**\r
+     * Fires the change event if the value has been changed.  Ignored if we are in\r
+     * the middle of an animation as the event will fire when the animation is\r
+     * complete\r
+     * @method fireEvents\r
+     * @private\r
+     */\r
+    fireEvents: function () {\r
+\r
+        var t = this.thumb;\r
+        // this.logger.log("FireEvents: " + t._isRegion);\r
+\r
+        t.cachePosition();\r
+\r
+        if (! this.isLocked()) {\r
+            if (t._isRegion) {\r
+                this.logger.log("region");\r
+                var newX = t.getXValue();\r
+                var newY = t.getYValue();\r
+\r
+                if (newX != this.previousX || newY != this.previousY) {\r
+                    // this.logger.log("Firing onchange");\r
+                    this.onChange(newX, newY);\r
+                    this.fireEvent("change", { x: newX, y: newY });\r
+                }\r
+\r
+                this.previousX = newX;\r
+                this.previousY = newY;\r
+\r
+            } else {\r
+                var newVal = t.getValue();\r
+                if (newVal != this.previousVal) {\r
+                    this.logger.log("Firing onchange: " + newVal);\r
+                    this.onChange( newVal );\r
+                    this.fireEvent("change", newVal);\r
+                }\r
+                this.previousVal = newVal;\r
+            }\r
+\r
+            if (this.moveComplete) {\r
+                this.onSlideEnd();\r
+                this.fireEvent("slideEnd");\r
+                this.moveComplete = false;\r
+            }\r
+\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Slider toString\r
+     * @method toString\r
+     * @return {string} string representation of the instance\r
+     */\r
+    toString: function () {\r
+        return ("Slider (" + this.type +") " + this.id);\r
+    }\r
+\r
+});\r
+\r
+YAHOO.augment(YAHOO.widget.Slider, YAHOO.util.EventProvider);\r
 \r
 /**\r
  * A drag and drop implementation to be used as the thumb of a slider.\r
- *\r
+ * @class SliderThumb\r
  * @extends YAHOO.util.DD\r
  * @constructor\r
  * @param {String} id the id of the slider html element\r
@@ -745,201 +948,205 @@ YAHOO.widget.Slider.prototype.toString = function () {
  * @param {int} iRight the number of pixels the element can move right\r
  * @param {int} iUp the number of pixels the element can move up\r
  * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
+ * @param {int} iTickSize optional parameter for specifying that the element\r
  * should move a certain number pixels at a time.\r
  */\r
 YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) {\r
 \r
-       if (id) {\r
-               this.init(id, sGroup);\r
+    if (id) {\r
+        this.init(id, sGroup);\r
 \r
         /**\r
-         * The id of the thumbs parent HTML element (the slider background element).\r
+         * The id of the thumbs parent HTML element (the slider background\r
+         * element).\r
+         * @property parentElId\r
          * @type string\r
          */\r
         this.parentElId = sGroup;\r
-       }\r
+    }\r
+\r
+\r
+    //this.removeInvalidHandleType("A");\r
 \r
     this.logger = new YAHOO.widget.LogWriter(this.toString());\r
 \r
-       /**\r
-        * Overrides the isTarget property in YAHOO.util.DragDrop\r
-        * @private\r
-        */\r
-       this.isTarget = false;\r
+    /**\r
+     * Overrides the isTarget property in YAHOO.util.DragDrop\r
+     * @property isTarget\r
+     * @private\r
+     */\r
+    this.isTarget = false;\r
 \r
     /**\r
      * The tick size for this slider\r
+     * @property tickSize\r
      * @type int\r
+     * @private\r
      */\r
-       this.tickSize = iTickSize;\r
+    this.tickSize = iTickSize;\r
 \r
     /**\r
      * Informs the drag and drop util that the offsets should remain when\r
      * resetting the constraints.  This preserves the slider value when\r
      * the constraints are reset\r
+     * @property maintainOffset\r
      * @type boolean\r
+     * @private\r
      */\r
     this.maintainOffset = true;\r
 \r
-       this.initSlider(iLeft, iRight, iUp, iDown, iTickSize);\r
+    this.initSlider(iLeft, iRight, iUp, iDown, iTickSize);\r
 \r
+    /**\r
+     * Turns off the autoscroll feature in drag and drop\r
+     * @property scroll\r
+     * @private\r
+     */\r
     this.scroll = false;\r
 \r
 };\r
 \r
-// YAHOO.widget.SliderThumb.prototype = new YAHOO.util.DD();\r
-YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD);\r
+YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {\r
 \r
-/**\r
- * Returns the difference between the location of the thumb and its parent.\r
- * @param {Array} Optionally accepts the position of the parent\r
- * @type int[]\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getOffsetFromParent = function(parentPos) {\r
-    var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
-    var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
-\r
-    return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
-};\r
+    /**\r
+     * The (X and Y) difference between the thumb location and its parent\r
+     * (the slider background) when the control is instantiated.\r
+     * @property startOffset\r
+     * @type [int, int]\r
+     */\r
+    startOffset: null,\r
 \r
-/**\r
- * The (X and Y) difference between the thumb location and its parent \r
- * (the slider background) when the control is instantiated.  \r
- * @type int[]\r
- */\r
-YAHOO.widget.SliderThumb.prototype.startOffset = null;\r
+    /**\r
+     * Flag used to figure out if this is a horizontal or vertical slider\r
+     * @property _isHoriz\r
+     * @type boolean\r
+     * @private\r
+     */\r
+    _isHoriz: false,\r
 \r
-/**\r
- * Flag used to figure out if this is a horizontal or vertical slider\r
- *\r
- * @type boolean\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._isHoriz = false;\r
+    /**\r
+     * Cache the last value so we can check for change\r
+     * @property _prevVal\r
+     * @type int\r
    * @private\r
    */\r
+    _prevVal: 0,\r
 \r
-/**\r
- * Cache the last value so we can check for change\r
- *\r
- * @type int\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._prevVal = 0;\r
+    /**\r
+     * The slider is _graduated if there is a tick interval defined\r
+     * @property _graduated\r
+     * @type boolean\r
    * @private\r
    */\r
+    _graduated: false,\r
 \r
-/**\r
- * initial element X\r
- *\r
- * @type int\r
- * @private\r
- */\r
-// YAHOO.widget.SliderThumb.prototype._initX = 0;\r
+    /**\r
+     * Returns the difference between the location of the thumb and its parent.\r
+     * @method getOffsetFromParent\r
+     * @param {[int, int]} parentPos Optionally accepts the position of the parent\r
+     * @type [int, int]\r
+     */\r
+    getOffsetFromParent: function(parentPos) {\r
+        var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
+        var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
 \r
-/**\r
- * initial element Y\r
- *\r
- * @type int\r
- * @private\r
- */\r
-// YAHOO.widget.SliderThumb.prototype._initY = 0;\r
+        return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+    },\r
 \r
-/**\r
- * The slider is _graduated if there is a tick interval defined\r
- *\r
- * @type boolean\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._graduated = false;\r
+    /**\r
+     * Set up the slider, must be called in the constructor of all subclasses\r
+     * @method initSlider\r
+     * @param {int} iLeft the number of pixels the element can move left\r
+     * @param {int} iRight the number of pixels the element can move right\r
+     * @param {int} iUp the number of pixels the element can move up\r
+     * @param {int} iDown the number of pixels the element can move down\r
+     * @param {int} iTickSize the width of the tick interval.\r
+     */\r
+    initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) {\r
 \r
-/**\r
- * Set up the slider, must be called in the constructor of all subclasses\r
- *\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize the width of the tick interval.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.initSlider = function (iLeft, iRight, iUp, iDown, \r
-               iTickSize) {\r
+        this.setXConstraint(iLeft, iRight, iTickSize);\r
+        this.setYConstraint(iUp, iDown, iTickSize);\r
 \r
-       this.setXConstraint(iLeft, iRight, iTickSize);\r
-       this.setYConstraint(iUp, iDown, iTickSize);\r
+        if (iTickSize && iTickSize > 1) {\r
+            this._graduated = true;\r
+        }\r
 \r
-       if (iTickSize && iTickSize > 1) {\r
-               this._graduated = true;\r
-       }\r
+        this._isHoriz  = (iLeft || iRight);\r
+        this._isVert   = (iUp   || iDown);\r
+        this._isRegion = (this._isHoriz && this._isVert);\r
 \r
-       this._isHoriz = (iLeft > 0 || iRight > 0); \r
-       this._isVert   = (iUp > 0 ||  iDown > 0);\r
-       this._isRegion = (this._isHoriz && this._isVert); \r
+    },\r
 \r
-};\r
+    /**\r
+     * Clear's the slider's ticks\r
+     * @method clearTicks\r
+     */\r
+    clearTicks: function () {\r
+        YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
+        this._graduated = false;\r
+    },\r
 \r
-/**\r
- * Clear's the slider's ticks\r
- */\r
-YAHOO.widget.SliderThumb.prototype.clearTicks = function () {\r
-    YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
-    this._graduated = false;\r
-};\r
+    /**\r
+     * Gets the current offset from the element's start position in\r
+     * pixels.\r
+     * @method getValue\r
+     * @return {int} the number of pixels (positive or negative) the\r
+     * slider has moved from the start position.\r
+     */\r
+    getValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var val = (this._isHoriz) ? this.getXValue() : this.getYValue();\r
+        this.logger.log("getVal: " + val);\r
+        return val;\r
+    },\r
 \r
-/**\r
- * Gets the current offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
- * slider has moved from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var val = (this._isHoriz) ? this.getXValue() : this.getYValue();\r
-    this.logger.log("getVal: " + val);\r
-    return val;\r
-};\r
+    /**\r
+     * Gets the current X offset from the element's start position in\r
+     * pixels.\r
+     * @method getXValue\r
+     * @return {int} the number of pixels (positive or negative) the\r
+     * slider has moved horizontally from the start position.\r
+     */\r
+    getXValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var newOffset = this.getOffsetFromParent();\r
+        return (newOffset[0] - this.startOffset[0]);\r
+    },\r
 \r
-/**\r
* Gets the current X offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
* slider has moved horizontally from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getXValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var newOffset = this.getOffsetFromParent();\r
-       return (newOffset[0] - this.startOffset[0]);\r
-};\r
+    /**\r
    * Gets the current Y offset from the element's start position in\r
    * pixels.\r
+     * @method getYValue\r
    * @return {int} the number of pixels (positive or negative) the\r
    * slider has moved vertically from the start position.\r
    */\r
+    getYValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var newOffset = this.getOffsetFromParent();\r
+        return (newOffset[1] - this.startOffset[1]);\r
+    },\r
 \r
-/**\r
- * Gets the current Y offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
- * slider has moved vertically from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getYValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var newOffset = this.getOffsetFromParent();\r
-       return (newOffset[1] - this.startOffset[1]);\r
-};\r
+    /**\r
+     * Thumb toString\r
+     * @method toString\r
+     * @return {string} string representation of the instance\r
+     */\r
+    toString: function () {\r
+        return "SliderThumb " + this.id;\r
+    },\r
 \r
-/**\r
- * toString\r
- * @return {string} string representation of the instance\r
- */\r
-YAHOO.widget.SliderThumb.prototype.toString = function () { \r
-    return "SliderThumb " + this.id;\r
-};\r
+    /**\r
+     * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider\r
+     * instance it belongs to.\r
+     * @method onChange\r
+     * @private\r
+     */\r
+    onChange: function (x, y) {\r
+    }\r
 \r
-/**\r
- * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider\r
- * instance it belongs to.\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype.onChange = function (x, y) { };\r
+});\r
 \r
 if ("undefined" == typeof YAHOO.util.Anim) {\r
-       YAHOO.widget.Slider.ANIM_AVAIL = false;\r
+    YAHOO.widget.Slider.ANIM_AVAIL = false;\r
 }\r
 \r
index 10a6c0b387ce847a62a26ffb4eba67051d4c85c4..a872cf568342015772e8d720ee505c1aaf54c402 100755 (executable)
@@ -1 +1 @@
-/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ YAHOO.widget.Slider=function(_1,_2,_3,_4){if(_1){this.type=_4;this.init(_1,_2,true);var _5=this;this.thumb=_3;_3.onChange=function(){_5.onThumbChange();};this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;if(_3._isHoriz&&_3.xTicks&&_3.xTicks.length){this.tickPause=Math.round(360/_3.xTicks.length);}else{if(_3.yTicks&&_3.yTicks.length){this.tickPause=Math.round(360/_3.yTicks.length);}}_3.onMouseDown=function(){return _5.focus();};_3.onMouseUp=function(){_5.thumbMouseUp();};_3.onDrag=function(){_5.fireEvents();};_3.onAvailable=function(){return _5.setStartSliderState();};}};YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop);YAHOO.widget.Slider.getHorizSlider=function(_6,_7,_8,_9,_10){return new YAHOO.widget.Slider(_6,_6,new YAHOO.widget.SliderThumb(_7,_6,_8,_9,0,0,_10),"horiz");};YAHOO.widget.Slider.getVertSlider=function(_11,_12,iUp,_14,_15){return new YAHOO.widget.Slider(_11,_11,new YAHOO.widget.SliderThumb(_12,_11,0,0,iUp,_14,_15),"vert");};YAHOO.widget.Slider.getSliderRegion=function(_16,_17,_18,_19,iUp,_20,_21){return new YAHOO.widget.Slider(_16,_16,new YAHOO.widget.SliderThumb(_17,_16,_18,_19,iUp,_20,_21),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.widget.Slider.prototype.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);}else{this.setRegionValue(0,0,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);}else{this.setValue(0,true,true);}}};YAHOO.widget.Slider.prototype.setThumbCenterPoint=function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}};YAHOO.widget.Slider.prototype.lock=function(){this.thumb.lock();this.locked=true;};YAHOO.widget.Slider.prototype.unlock=function(){this.thumb.unlock();this.locked=false;};YAHOO.widget.Slider.prototype.thumbMouseUp=function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}};YAHOO.widget.Slider.prototype.getThumb=function(){return this.thumb;};YAHOO.widget.Slider.prototype.focus=function(){var el=this.getEl();if(el.focus){el.focus();}this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}};YAHOO.widget.Slider.prototype.onChange=function(_23,_24){};YAHOO.widget.Slider.prototype.onSlideStart=function(){};YAHOO.widget.Slider.prototype.onSlideEnd=function(){};YAHOO.widget.Slider.prototype.getValue=function(){return this.thumb.getValue();};YAHOO.widget.Slider.prototype.getXValue=function(){return this.thumb.getXValue();};YAHOO.widget.Slider.prototype.getYValue=function(){return this.thumb.getYValue();};YAHOO.widget.Slider.prototype.onThumbChange=function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());}else{t.onChange(t.getValue());}};YAHOO.widget.Slider.prototype.setValue=function(_26,_27,_28){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!_28){return false;}if(isNaN(_26)){return false;}var t=this.thumb;var _29,newY;this.verifyOffset();if(t._isRegion){return false;}else{if(t._isHoriz){this.onSlideStart();_29=t.initPageX+_26+this.thumbCenterPoint.x;this.moveThumb(_29,t.initPageY,_27);}else{this.onSlideStart();newY=t.initPageY+_26+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,_27);}}return true;};YAHOO.widget.Slider.prototype.setRegionValue=function(_30,_31,_32){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!force){return false;}if(isNaN(_30)){return false;}var t=this.thumb;if(t._isRegion){this.onSlideStart();var _33=t.initPageX+_30+this.thumbCenterPoint.x;var _34=t.initPageY+_31+this.thumbCenterPoint.y;this.moveThumb(_33,_34,_32);return true;}return false;};YAHOO.widget.Slider.prototype.verifyOffset=function(){var _35=YAHOO.util.Dom.getXY(this.getEl());if(_35[0]!=this.baselinePos[0]||_35[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=_35;return false;}return true;};YAHOO.widget.Slider.prototype.moveThumb=function(x,y,_38){var t=this.thumb;var _39=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];if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!_38){this.lock();setTimeout(function(){_39.moveOneTick(p);},this.tickPause);}else{if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!_38){this.lock();var _42=new YAHOO.util.Motion(t.id,{points:{to:p}},0.4,YAHOO.util.Easing.easeOut);_42.onComplete.subscribe(function(){_39.endMove();});_42.animate();}else{t.setDragElPos(x,y);this.endMove();}}};YAHOO.widget.Slider.prototype.moveOneTick=function(_43){var t=this.thumb;var _44=YAHOO.util.Dom.getXY(t.getEl());var tmp;var _46=null;if(t._isRegion){_46=this._getNextX(_44,_43);var _47=(_46)?_46[0]:_44[0];_46=this._getNextY([_47,_44[1]],_43);}else{if(t._isHoriz){_46=this._getNextX(_44,_43);}else{_46=this._getNextY(_44,_43);}}if(_46){this.thumb.alignElWithMouse(t.getEl(),_46[0],_46[1]);if(!(_46[0]==_43[0]&&_46[1]==_43[1])){var _48=this;setTimeout(function(){_48.moveOneTick(_43);},this.tickPause);}else{this.endMove();}}else{this.endMove();}};YAHOO.widget.Slider.prototype._getNextX=function(_49,_50){var t=this.thumb;var _51;var tmp=[];var _52=null;if(_49[0]>_50[0]){_51=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(_49[0]-_51,_49[1]);_52=[tmp.x,tmp.y];}else{if(_49[0]<_50[0]){_51=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(_49[0]+_51,_49[1]);_52=[tmp.x,tmp.y];}else{}}return _52;};YAHOO.widget.Slider.prototype._getNextY=function(_53,_54){var t=this.thumb;var _55;var tmp=[];var _56=null;if(_53[1]>_54[1]){_55=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(_53[0],_53[1]-_55);_56=[tmp.x,tmp.y];}else{if(_53[1]<_54[1]){_55=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(_53[0],_53[1]+_55);_56=[tmp.x,tmp.y];}else{}}return _56;};YAHOO.widget.Slider.prototype.b4MouseDown=function(e){this.thumb.autoOffset();this.thumb.resetConstraints();};YAHOO.widget.Slider.prototype.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);}};YAHOO.widget.Slider.prototype.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);}};YAHOO.widget.Slider.prototype.endMove=function(){this.unlock();this.moveComplete=true;this.fireEvents();};YAHOO.widget.Slider.prototype.fireEvents=function(){var t=this.thumb;t.cachePosition();if(!this.isLocked()){if(t._isRegion){var _58=t.getXValue();var _59=t.getYValue();if(_58!=this.previousX||_59!=this.previousY){this.onChange(_58,_59);}this.previousX=_58;this.previousY=_59;}else{var _60=t.getValue();if(_60!=this.previousVal){this.onChange(_60);}this.previousVal=_60;}if(this.moveComplete){this.onSlideEnd();this.moveComplete=false;}}};YAHOO.widget.Slider.prototype.toString=function(){return ("Slider ("+this.type+") "+this.id);};YAHOO.widget.SliderThumb=function(id,_62,_63,_64,iUp,_65,_66){if(id){this.init(id,_62);this.parentElId=_62;}this.isTarget=false;this.tickSize=_66;this.maintainOffset=true;this.initSlider(_63,_64,iUp,_65,_66);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD);YAHOO.widget.SliderThumb.prototype.getOffsetFromParent=function(_67){var _68=YAHOO.util.Dom.getXY(this.getEl());var _69=_67||YAHOO.util.Dom.getXY(this.parentElId);return [(_68[0]-_69[0]),(_68[1]-_69[1])];};YAHOO.widget.SliderThumb.prototype.startOffset=null;YAHOO.widget.SliderThumb.prototype._isHoriz=false;YAHOO.widget.SliderThumb.prototype._prevVal=0;YAHOO.widget.SliderThumb.prototype._graduated=false;YAHOO.widget.SliderThumb.prototype.initSlider=function(_70,_71,iUp,_72,_73){this.setXConstraint(_70,_71,_73);this.setYConstraint(iUp,_72,_73);if(_73&&_73>1){this._graduated=true;}this._isHoriz=(_70>0||_71>0);this._isVert=(iUp>0||_72>0);this._isRegion=(this._isHoriz&&this._isVert);};YAHOO.widget.SliderThumb.prototype.clearTicks=function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this._graduated=false;};YAHOO.widget.SliderThumb.prototype.getValue=function(){if(!this.available){return 0;}var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;};YAHOO.widget.SliderThumb.prototype.getXValue=function(){if(!this.available){return 0;}var _75=this.getOffsetFromParent();return (_75[0]-this.startOffset[0]);};YAHOO.widget.SliderThumb.prototype.getYValue=function(){if(!this.available){return 0;}var _76=this.getOffsetFromParent();return (_76[1]-this.startOffset[1]);};YAHOO.widget.SliderThumb.prototype.toString=function(){return "SliderThumb "+this.id;};YAHOO.widget.SliderThumb.prototype.onChange=function(x,y){};if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.widget.Slider=function(_1,_2,_3,_4){if(_1){this.type=_4;this.init(_1,_2,true);var _5=this;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.thumb=_3;_3.onChange=function(){_5.handleThumbChange();};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;if(_3._isHoriz&&_3.xTicks&&_3.xTicks.length){this.tickPause=Math.round(360/_3.xTicks.length);}else{if(_3.yTicks&&_3.yTicks.length){this.tickPause=Math.round(360/_3.yTicks.length);}}_3.onMouseDown=function(){return _5.focus();};_3.onMouseUp=function(){_5.thumbMouseUp();};_3.onDrag=function(){_5.fireEvents();};_3.onAvailable=function(){return _5.setStartSliderState();};}};YAHOO.widget.Slider.getHorizSlider=function(_6,_7,_8,_9,_10){return new YAHOO.widget.Slider(_6,_6,new YAHOO.widget.SliderThumb(_7,_6,_8,_9,0,0,_10),"horiz");};YAHOO.widget.Slider.getVertSlider=function(_11,_12,iUp,_14,_15){return new YAHOO.widget.Slider(_11,_11,new YAHOO.widget.SliderThumb(_12,_11,0,0,iUp,_14,_15),"vert");};YAHOO.widget.Slider.getSliderRegion=function(_16,_17,_18,_19,iUp,_20,_21){return new YAHOO.widget.Slider(_16,_16,new YAHOO.widget.SliderThumb(_17,_16,_18,_19,iUp,_20,_21),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{onAvailable:function(){var _22=YAHOO.util.Event;_22.on(this.id,"keydown",this.handleKeyDown,this,true);_22.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var _24=YAHOO.util.Event;var kc=_24.getCharCode(e);switch(kc){case 37:case 38:case 39:case 40:case 36:case 35:_24.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var _26=YAHOO.util.Event;var kc=_26.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var _28=false;var _29=true;switch(kc){case 37:h-=this.keyIncrement;break;case 38:v-=this.keyIncrement;break;case 39:h+=this.keyIncrement;break;case 40:v+=this.keyIncrement;break;case 36:h=t.leftConstraint;v=t.topConstraint;break;case 35:h=t.rightConstraint;v=t.bottomConstraint;break;default:_29=false;}if(_29){if(t._isRegion){this.setRegionValue(h,v,true);}else{var _30=(t._isHoriz)?h:v;this.setValue(_30,true);}_26.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);}}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(){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(_32,_33){},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(_35,_36,_37){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!_37){return false;}if(isNaN(_35)){return false;}var t=this.thumb;var _38,newY;this.verifyOffset();if(t._isRegion){return false;}else{if(t._isHoriz){this.onSlideStart();_38=t.initPageX+_35+this.thumbCenterPoint.x;this.moveThumb(_38,t.initPageY,_36);}else{this.onSlideStart();newY=t.initPageY+_35+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,_36);}}return true;},setRegionValue:function(_39,_40,_41){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!force){return false;}if(isNaN(_39)){return false;}var t=this.thumb;if(t._isRegion){this.onSlideStart();var _42=t.initPageX+_39+this.thumbCenterPoint.x;var _43=t.initPageY+_40+this.thumbCenterPoint.y;this.moveThumb(_42,_43,_41);return true;}return false;},verifyOffset:function(){var _44=YAHOO.util.Dom.getXY(this.getEl());if(_44[0]!=this.baselinePos[0]||_44[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=_44;return false;}return true;},moveThumb:function(x,y,_47){var t=this.thumb;var _48=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&&!_47){this.lock();setTimeout(function(){_48.moveOneTick(p);},this.tickPause);}else{if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!_47){this.lock();var _51=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);_51.onComplete.subscribe(function(){_48.endMove();});_51.animate();}else{t.setDragElPos(x,y);this.endMove();}}},moveOneTick:function(_52){var t=this.thumb;var _53=YAHOO.util.Dom.getXY(t.getEl());var tmp;var _55=null;if(t._isRegion){_55=this._getNextX(_53,_52);var _56=(_55)?_55[0]:_53[0];_55=this._getNextY([_56,_53[1]],_52);}else{if(t._isHoriz){_55=this._getNextX(_53,_52);}else{_55=this._getNextY(_53,_52);}}if(_55){this.thumb.alignElWithMouse(t.getEl(),_55[0],_55[1]);if(!(_55[0]==_52[0]&&_55[1]==_52[1])){var _57=this;setTimeout(function(){_57.moveOneTick(_52);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(_58,_59){var t=this.thumb;var _60;var tmp=[];var _61=null;if(_58[0]>_59[0]){_60=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(_58[0]-_60,_58[1]);_61=[tmp.x,tmp.y];}else{if(_58[0]<_59[0]){_60=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(_58[0]+_60,_58[1]);_61=[tmp.x,tmp.y];}else{}}return _61;},_getNextY:function(_62,_63){var t=this.thumb;var _64;var tmp=[];var _65=null;if(_62[1]>_63[1]){_64=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(_62[0],_62[1]-_64);_65=[tmp.x,tmp.y];}else{if(_62[1]<_63[1]){_64=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(_62[0],_62[1]+_64);_65=[tmp.x,tmp.y];}else{}}return _65;},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(){var t=this.thumb;t.cachePosition();if(!this.isLocked()){if(t._isRegion){var _66=t.getXValue();var _67=t.getYValue();if(_66!=this.previousX||_67!=this.previousY){this.onChange(_66,_67);this.fireEvent("change",{x:_66,y:_67});}this.previousX=_66;this.previousY=_67;}else{var _68=t.getValue();if(_68!=this.previousVal){this.onChange(_68);this.fireEvent("change",_68);}this.previousVal=_68;}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,_70,_71,_72,iUp,_73,_74){if(id){this.init(id,_70);this.parentElId=_70;}this.isTarget=false;this.tickSize=_74;this.maintainOffset=true;this.initSlider(_71,_72,iUp,_73,_74);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent:function(_75){var _76=YAHOO.util.Dom.getXY(this.getEl());var _77=_75||YAHOO.util.Dom.getXY(this.parentElId);return [(_76[0]-_77[0]),(_76[1]-_77[1])];},initSlider:function(_78,_79,iUp,_80,_81){this.setXConstraint(_78,_79,_81);this.setYConstraint(iUp,_80,_81);if(_81&&_81>1){this._graduated=true;}this._isHoriz=(_78||_79);this._isVert=(iUp||_80);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);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 _83=this.getOffsetFromParent();return (_83[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}var _84=this.getOffsetFromParent();return (_84[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;}
\ No newline at end of file
index 14fa5f57b894f71e2074bc8cf10d4b0ae3acfa70..8d3cd62039759fe48abe736cca7edf79b44a3603 100755 (executable)
@@ -1,10 +1,25 @@
 /*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
 */ \r
 \r
+/**\r
+ * The Slider component is a UI control that enables the user to adjust \r
+ * values in a finite range along one or two axes. Typically, the Slider \r
+ * control is used in a web application as a rich, visual replacement \r
+ * for an input box that takes a number as input. The Slider control can \r
+ * also easily accommodate a second dimension, providing x,y output for \r
+ * a selection point chosen from a rectangular region.\r
+ *\r
+ * @module    slider\r
+ * @title     Slider Widget\r
+ * @namespace YAHOO.widget\r
+ * @requires  yahoo,dom,dragdrop,event\r
+ * @optional  animation\r
+ */\r
+\r
 /**\r
  * A DragDrop implementation that can be used as a background for a\r
  * slider.  It takes a reference to the thumb instance \r
@@ -12,6 +27,7 @@ version: 0.11.0
  * thumb jump to the location on the background when the background is \r
  * clicked.  \r
  *\r
+ * @class Slider\r
  * @extends YAHOO.util.DragDrop\r
  * @constructor\r
  * @param {String} id     The id of the element linked to this instance\r
@@ -19,83 +35,147 @@ version: 0.11.0
  * @param {String} sType  The type of slider (horiz, vert, region)\r
  */\r
 YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {\r
-       if (sElementId) {\r
+    if (sElementId) {\r
 \r
         /**\r
          * The type of the slider (horiz, vert, region)\r
+         * @property type\r
          * @type string\r
          */\r
         this.type = sType;\r
 \r
-               this.init(sElementId, sGroup, true);\r
+        this.init(sElementId, sGroup, true);\r
+\r
+        //this.removeInvalidHandleType("A");\r
 \r
 \r
-               var self = this;\r
+        var self = this;\r
 \r
-               /**\r
-                * a YAHOO.widget.SliderThumb instance that we will use to \r
-                * reposition the thumb when the background is clicked\r
-                *\r
-                * @type Slider \r
-                */\r
-               this.thumb = oThumb;\r
+        /**\r
+         * Event the fires when the value of the control changes.  If \r
+         * the control is animated the event will fire every point\r
+         * along the way.\r
+         * @event change\r
+         * @param {int} new\r
+         * @param {int} firstOffset the number of pixels the thumb has moved\r
+         * from its start position. Normal horizontal and vertical sliders will only\r
+         * have the firstOffset.  Regions will have both, the first is the horizontal\r
+         * offset, the second the vertical.\r
+         * @param {int} secondOffset the y offset for region sliders\r
+         */\r
+        this.createEvent("change", this);\r
 \r
-               // add handler for the handle onchange event\r
-               oThumb.onChange = function() { \r
-                       self.onThumbChange(); \r
-               };\r
+        /**\r
+         * Event that fires at the end of a slider thumb move.\r
+         * @event slideStart\r
+         */\r
+        this.createEvent("slideStart", this);\r
 \r
-               /**\r
-                * Overrides the isTarget property in YAHOO.util.DragDrop\r
-                * @private\r
-                */\r
-               this.isTarget = false;\r
-       \r
-               /**\r
-                * Flag that determines if the thumb will animate when moved\r
-                * @type boolean\r
-                */\r
-               this.animate = YAHOO.widget.Slider.ANIM_AVAIL;\r
+        /**\r
+         * Event that fires at the end of a slider thumb move\r
+         * @event slideEnd\r
+         */\r
+        this.createEvent("slideEnd", this);\r
+\r
+        /**\r
+         * A YAHOO.widget.SliderThumb instance that we will use to \r
+         * reposition the thumb when the background is clicked\r
+         * @property thumb\r
+         * @type YAHOO.widget.SliderThumb\r
+         */\r
+        this.thumb = oThumb;\r
+\r
+        // add handler for the handle onchange event\r
+        oThumb.onChange = function() { \r
+            self.handleThumbChange(); \r
+        };\r
+\r
+        /**\r
+         * Overrides the isTarget property in YAHOO.util.DragDrop\r
+         * @property isTarget\r
+         * @private\r
+         */\r
+        this.isTarget = false;\r
+    \r
+        /**\r
+         * Flag that determines if the thumb will animate when moved\r
+         * @property animate\r
+         * @type boolean\r
+         */\r
+        this.animate = YAHOO.widget.Slider.ANIM_AVAIL;\r
 \r
         /**\r
          * Set to false to disable a background click thumb move\r
+         * @property backgroundEnabled\r
+         * @type boolean\r
          */\r
         this.backgroundEnabled = true;\r
 \r
-               /**\r
-                * Adjustment factor for tick animation, the more ticks, the\r
-                * faster the animation (by default)\r
-                *\r
-                * @type int\r
-                */\r
-               this.tickPause = 40;\r
-               if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
-                       this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
-               } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
-                       this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
-               }\r
-\r
-\r
-               // delegate thumb methods\r
-               oThumb.onMouseDown = function () { return self.focus(); };\r
-               //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
-               // oThumb.lock = function() { self.lock(); };\r
-               // oThumb.unlock = function() { self.unlock(); };\r
-               oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
-               oThumb.onDrag = function() { self.fireEvents(); };\r
-               oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
-       }\r
-};\r
+        /**\r
+         * Adjustment factor for tick animation, the more ticks, the\r
+         * faster the animation (by default)\r
+         * @property tickPause\r
+         * @type int\r
+         */\r
+        this.tickPause = 40;\r
+\r
+        /**\r
+         * Enables the arrow, home and end keys, defaults to true.\r
+         * @property enableKeys\r
+         * @type boolean\r
+         */\r
+        this.enableKeys = true;\r
+\r
+        /**\r
+         * Specifies the number of pixels the arrow keys will move the slider.\r
+         * Default is 25.\r
+         * @property keyIncrement\r
+         * @type int\r
+         */\r
+        this.keyIncrement = 20;\r
+\r
+        /**\r
+         * moveComplete is set to true when the slider has moved to its final\r
+         * destination.  For animated slider, this value can be checked in \r
+         * the onChange handler to make it possible to execute logic only\r
+         * when the move is complete rather than at all points along the way.\r
+         *\r
+         * @property moveComplete\r
+         * @type Boolean\r
+         */\r
+        this.moveComplete = true;\r
 \r
-//YAHOO.widget.Slider.prototype = new YAHOO.util.DragDrop();\r
-YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop);\r
+        /**\r
+         * If animation is configured, specifies the length of the animation\r
+         * in seconds.\r
+         * @property animationDuration\r
+         * @type int\r
+         * @default 0.2\r
+         */\r
+        this.animationDuration = 0.2;\r
+\r
+        if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
+            this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
+        } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
+            this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
+        }\r
 \r
-// YAHOO.widget.Slider.prototype.onAvailable = function() {\r
-// };\r
+\r
+        // delegate thumb methods\r
+        oThumb.onMouseDown = function () { return self.focus(); };\r
+        //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
+        // oThumb.lock = function() { self.lock(); };\r
+        // oThumb.unlock = function() { self.unlock(); };\r
+        oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
+        oThumb.onDrag = function() { self.fireEvents(); };\r
+        oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
+    }\r
+};\r
 \r
 /**\r
  * Factory method for creating a horizontal slider\r
- *\r
+ * @method YAHOO.widget.Slider.getHorizSlider\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iLeft the number of pixels the element can move left\r
@@ -105,15 +185,16 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop);
  * @return {Slider} a horizontal slider control\r
  */\r
 YAHOO.widget.Slider.getHorizSlider = \r
-       function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
-                                                          iLeft, iRight, 0, 0, iTickSize), "horiz");\r
+    function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
+                               iLeft, iRight, 0, 0, iTickSize), "horiz");\r
 };\r
 \r
 /**\r
  * Factory method for creating a vertical slider\r
- *\r
+ * @method YAHOO.widget.Slider.getVertSlider\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iUp the number of pixels the element can move up\r
@@ -123,16 +204,17 @@ YAHOO.widget.Slider.getHorizSlider =
  * @return {Slider} a vertical slider control\r
  */\r
 YAHOO.widget.Slider.getVertSlider = \r
-       function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
-                                                          iUp, iDown, iTickSize), "vert");\r
+    function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
+                               iUp, iDown, iTickSize), "vert");\r
 };\r
 \r
 /**\r
  * Factory method for creating a slider region like the one in the color\r
  * picker example\r
- *\r
+ * @method YAHOO.widget.Slider.getSliderRegion\r
+ * @static\r
  * @param {String} sBGElId the id of the slider's background element\r
  * @param {String} sHandleElId the id of the thumb element\r
  * @param {int} iLeft the number of pixels the element can move left\r
@@ -144,560 +226,684 @@ YAHOO.widget.Slider.getVertSlider =
  * @return {Slider} a slider region control\r
  */\r
 YAHOO.widget.Slider.getSliderRegion = \r
-       function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
-               return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
-                       new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
-                                                          iUp, iDown, iTickSize), "region");\r
+    function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
+        return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+            new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
+                               iUp, iDown, iTickSize), "region");\r
 };\r
 \r
 /**\r
  * By default, animation is available if the animation library is detected.\r
+ * @property YAHOO.widget.Slider.ANIM_AVAIL\r
+ * @static\r
  * @type boolean\r
  */\r
 YAHOO.widget.Slider.ANIM_AVAIL = true;\r
 \r
-YAHOO.widget.Slider.prototype.setStartSliderState = function() {\r
+YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+\r
+    onAvailable: function() {\r
+        var Event = YAHOO.util.Event;\r
+        Event.on(this.id, "keydown",  this.handleKeyDown,  this, true);\r
+        Event.on(this.id, "keypress", this.handleKeyPress, this, true);\r
+    },\r
\r
+    handleKeyPress: function(e) {\r
+        if (this.enableKeys) {\r
+            var Event = YAHOO.util.Event;\r
+            var kc = Event.getCharCode(e);\r
+            switch (kc) {\r
+                case 0x25: // left\r
+                case 0x26: // up\r
+                case 0x27: // right\r
+                case 0x28: // down\r
+                case 0x24: // home\r
+                case 0x23: // end\r
+                    Event.preventDefault(e);\r
+                    break;\r
+                default:\r
+            }\r
+        }\r
+   },\r
 \r
+    handleKeyDown: function(e) {\r
+        if (this.enableKeys) {\r
+            var Event = YAHOO.util.Event;\r
 \r
-    this.setThumbCenterPoint();\r
+            var kc = Event.getCharCode(e), t=this.thumb;\r
+            var h=this.getXValue(),v=this.getYValue();\r
+\r
+            var horiz = false;\r
+            var changeValue = true;\r
+            switch (kc) {\r
+\r
+                // left\r
+                case 0x25: h -= this.keyIncrement; break;\r
+\r
+                // up\r
+                case 0x26: v -= this.keyIncrement; break;\r
+\r
+                // right\r
+                case 0x27: h += this.keyIncrement; break;\r
+\r
+                // down\r
+                case 0x28: v += this.keyIncrement; break;\r
+\r
+                // home\r
+                case 0x24: h = t.leftConstraint;    \r
+                           v = t.topConstraint;    \r
+                           break;\r
+\r
+                // end\r
+                case 0x23: h = t.rightConstraint; \r
+                           v = t.bottomConstraint;    \r
+                           break;\r
+\r
+                default:   changeValue = false;\r
+            }\r
+\r
+            if (changeValue) {\r
+                if (t._isRegion) {\r
+                    this.setRegionValue(h, v, true);\r
+                } else {\r
+                    var newVal = (t._isHoriz) ? h : v;\r
+                    this.setValue(newVal, true);\r
+                }\r
+                Event.stopEvent(e);\r
+            }\r
+\r
+        }\r
+    },\r
 \r
     /**\r
-     * The basline position of the background element, used\r
-     * to determine if the background has moved since the last\r
-     * operation.\r
-     * @type int[]\r
+     * Initialization that sets up the value offsets once the elements are ready\r
+     * @method setSliderStartState\r
      */\r
-    this.baselinePos = YAHOO.util.Dom.getXY(this.getEl());\r
+    setStartSliderState: function() {\r
 \r
-    this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos);\r
 \r
-    if (this.thumb._isRegion) {\r
-        if (this.deferredSetRegionValue) {\r
-            this.setRegionValue.apply(this, this.deferredSetRegionValue, true);\r
+        this.setThumbCenterPoint();\r
+\r
+        /**\r
+         * The basline position of the background element, used\r
+         * to determine if the background has moved since the last\r
+         * operation.\r
+         * @property baselinePos\r
+         * @type [int, int]\r
+         */\r
+        this.baselinePos = YAHOO.util.Dom.getXY(this.getEl());\r
+\r
+        this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos);\r
+\r
+        if (this.thumb._isRegion) {\r
+            if (this.deferredSetRegionValue) {\r
+                this.setRegionValue.apply(this, this.deferredSetRegionValue, true);\r
+                this.deferredSetRegionValue = null;\r
+            } else {\r
+                this.setRegionValue(0, 0, true);\r
+            }\r
         } else {\r
-            this.setRegionValue(0, 0, true);\r
+            if (this.deferredSetValue) {\r
+                this.setValue.apply(this, this.deferredSetValue, true);\r
+                this.deferredSetValue = null;\r
+            } else {\r
+                this.setValue(0, true, true);\r
+            }\r
         }\r
-    } else {\r
-        if (this.deferredSetValue) {\r
-            this.setValue.apply(this, this.deferredSetValue, true);\r
-        } else {\r
-            this.setValue(0, true, true);\r
+    },\r
+\r
+    /**\r
+     * When the thumb is available, we cache the centerpoint of the element so\r
+     * we can position the element correctly when the background is clicked\r
+     * @method setThumbCenterPoint\r
+     */\r
+    setThumbCenterPoint: function() {\r
+\r
+        var el = this.thumb.getEl();\r
+\r
+        if (el) {\r
+            /**\r
+             * The center of the slider element is stored so we can position \r
+             * place it in the correct position when the background is clicked\r
+             * @property thumbCenterPoint\r
+             * @type {"x": int, "y": int}\r
+             */\r
+            this.thumbCenterPoint = { \r
+                    x: parseInt(el.offsetWidth/2, 10), \r
+                    y: parseInt(el.offsetHeight/2, 10) \r
+            };\r
         }\r
-    }\r
-};\r
 \r
-YAHOO.widget.Slider.prototype.setThumbCenterPoint = function() {\r
+    },\r
 \r
-    var el = this.thumb.getEl();\r
+    /**\r
+     * Locks the slider, overrides YAHOO.util.DragDrop\r
+     * @method lock\r
+     */\r
+    lock: function() {\r
+        this.thumb.lock();\r
+        this.locked = true;\r
+    },\r
 \r
-    if (el) {\r
-        /**\r
-         * the center of the slider element is stored so we can position \r
-         * place it in the correct position when the background is clicked\r
-         *\r
-         * @type Coordinate\r
-         */\r
-        this.thumbCenterPoint = { \r
-                x: parseInt(el.offsetWidth/2, 10), \r
-                y: parseInt(el.offsetHeight/2, 10) \r
-        };\r
-    }\r
+    /**\r
+     * Unlocks the slider, overrides YAHOO.util.DragDrop\r
+     * @method unlock\r
+     */\r
+    unlock: function() {\r
+        this.thumb.unlock();\r
+        this.locked = false;\r
+    },\r
 \r
-};\r
+    /**\r
+     * Handles mouseup event on the slider background\r
+     * @method thumbMouseUp\r
+     * @private\r
+     */\r
+    thumbMouseUp: function() {\r
+        if (!this.isLocked() && !this.moveComplete) {\r
+            this.endMove();\r
+        }\r
 \r
-/**\r
- * Lock the slider, overrides YAHOO.util.DragDrop\r
- */\r
-YAHOO.widget.Slider.prototype.lock = function() {\r
-       this.thumb.lock();\r
-       this.locked = true;\r
-};\r
+    },\r
 \r
-/**\r
- * Unlock the slider, overrides YAHOO.util.DragDrop\r
- */\r
-YAHOO.widget.Slider.prototype.unlock = function() {\r
-       this.thumb.unlock();\r
-       this.locked = false;\r
-};\r
+    /**\r
+     * Returns a reference to this slider's thumb\r
+     * @method getThumb\r
+     * @return {SliderThumb} this slider's thumb\r
+     */\r
+    getThumb: function() {\r
+        return this.thumb;\r
+    },\r
 \r
-/**\r
- * handles mouseup event on the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.thumbMouseUp = function() {\r
-    if (!this.isLocked() && !this.moveComplete) {\r
-           this.endMove();\r
-    }\r
+    /**\r
+     * Try to focus the element when clicked so we can add\r
+     * accessibility features\r
+     * @method focus\r
+     * @private\r
+     */\r
+    focus: function() {\r
+\r
+        // Focus the background element if possible\r
+        var el = this.getEl();\r
+\r
+        if (el.focus) {\r
+            try {\r
+                el.focus();\r
+            } catch(e) {\r
+                // Prevent permission denied unhandled exception in FF that can\r
+                // happen when setting focus while another element is handling\r
+                // the blur.  @TODO this is still writing to the error log \r
+                // (unhandled error) in FF1.5 with strict error checking on.\r
+            }\r
+        }\r
 \r
-};\r
+        this.verifyOffset();\r
 \r
-/**\r
- * Returns a reference to this slider's thumb\r
- */\r
-YAHOO.widget.Slider.prototype.getThumb = function() {\r
-    return this.thumb;\r
-};\r
+        if (this.isLocked()) {\r
+            return false;\r
+        } else {\r
+            this.onSlideStart();\r
+            return true;\r
+        }\r
+    },\r
 \r
-/**\r
- * Try to focus the element when clicked so we can add\r
- * accessibility features\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.focus = function() {\r
+    /**\r
+     * Event that fires when the value of the slider has changed\r
+     * @method onChange\r
+     * @param {int} firstOffset the number of pixels the thumb has moved\r
+     * from its start position. Normal horizontal and vertical sliders will only\r
+     * have the firstOffset.  Regions will have both, the first is the horizontal\r
+     * offset, the second the vertical.\r
+     * @param {int} secondOffset the y offset for region sliders\r
+     * @deprecated use instance.subscribe("change") instead\r
+     */\r
+    onChange: function (firstOffset, secondOffset) { \r
+        /* override me */ \r
+    },\r
 \r
-    // Focus the background element if possible\r
-    var el = this.getEl();\r
+    /**\r
+     * Event that fires when the at the beginning of the slider thumb move\r
+     * @method onSlideStart\r
+     * @deprecated use instance.subscribe("slideStart") instead\r
+     */\r
+    onSlideStart: function () { \r
+        /* override me */ \r
+    },\r
 \r
-    if (el.focus) {\r
-        el.focus();\r
-    }\r
+    /**\r
+     * Event that fires at the end of a slider thumb move\r
+     * @method onSliderEnd\r
+     * @deprecated use instance.subscribe("slideEnd") instead\r
+     */\r
+    onSlideEnd: function () { \r
+        /* override me */ \r
+    },\r
 \r
-    this.verifyOffset();\r
+    /**\r
+     * Returns the slider's thumb offset from the start position\r
+     * @method getValue\r
+     * @return {int} the current value\r
+     */\r
+    getValue: function () { \r
+        return this.thumb.getValue();\r
+    },\r
 \r
-    if (this.isLocked()) {\r
-        return false;\r
-    } else {\r
-        this.onSlideStart();\r
-           return true;\r
-    }\r
-};\r
+    /**\r
+     * Returns the slider's thumb X offset from the start position\r
+     * @method getXValue\r
+     * @return {int} the current horizontal offset\r
+     */\r
+    getXValue: function () { \r
+        return this.thumb.getXValue();\r
+    },\r
 \r
-/**\r
- * Event that fires when the value of the slider has changed\r
- *\r
- * @param {int} offsetFromStart the number of pixels the thumb has moved\r
- * from its start position. Normal horizontal and vertical sliders will only\r
- * have the firstOffset.  Regions will have both, the first is the horizontal\r
- * offset, the second the vertical.\r
- */\r
-YAHOO.widget.Slider.prototype.onChange = function (firstOffset, secondOffset) { \r
-       /* override me */ \r
-};\r
+    /**\r
+     * Returns the slider's thumb Y offset from the start position\r
+     * @method getYValue\r
+     * @return {int} the current vertical offset\r
+     */\r
+    getYValue: function () { \r
+        return this.thumb.getYValue();\r
+    },\r
 \r
-/**\r
- * Event that fires when the at the beginning of the slider thumb move\r
- */\r
-YAHOO.widget.Slider.prototype.onSlideStart = function () { \r
-       /* override me */ \r
-};\r
+    /**\r
+     * Internal handler for the slider thumb's onChange event\r
+     * @method handleThumbChange\r
+     * @private\r
+     */\r
+    handleThumbChange: function () { \r
+        var t = this.thumb;\r
+        if (t._isRegion) {\r
+            t.onChange(t.getXValue(), t.getYValue());\r
+            this.fireEvent("change", { x: t.getXValue(), y: t.getYValue() } );\r
+        } else {\r
+            t.onChange(t.getValue());\r
+            this.fireEvent("change", t.getValue());\r
+        }\r
 \r
-/**\r
- * Event that fires at the end of a slider thumb move\r
- */\r
-YAHOO.widget.Slider.prototype.onSlideEnd = function () { \r
-       /* override me */ \r
-};\r
+    },\r
 \r
-/**\r
- * Returns the slider's thumb offset from the start position\r
- *\r
- * @return {int} the current value\r
- */\r
-YAHOO.widget.Slider.prototype.getValue = function () { \r
-       return this.thumb.getValue();\r
-};\r
+    /**\r
+     * Provides a way to set the value of the slider in code.\r
+     * @method setValue\r
+     * @param {int} newOffset the number of pixels the thumb should be\r
+     * positioned away from the initial start point \r
+     * @param {boolean} skipAnim set to true to disable the animation\r
+     * for this move action (but not others).\r
+     * @param {boolean} force ignore the locked setting and set value anyway\r
+     * @return {boolean} true if the move was performed, false if it failed\r
+     */\r
+    setValue: function(newOffset, skipAnim, force) {\r
 \r
-/**\r
- * Returns the slider's thumb X offset from the start position\r
- *\r
- * @return {int} the current horizontal offset\r
- */\r
-YAHOO.widget.Slider.prototype.getXValue = function () { \r
-       return this.thumb.getXValue();\r
-};\r
+        if (!this.thumb.available) {\r
+            this.deferredSetValue = arguments;\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Returns the slider's thumb Y offset from the start position\r
- *\r
- * @return {int} the current vertical offset\r
- */\r
-YAHOO.widget.Slider.prototype.getYValue = function () { \r
-       return this.thumb.getYValue();\r
-};\r
+        if (this.isLocked() && !force) {\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Internal handler for the slider thumb's onChange event\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onThumbChange = function () { \r
-       var t = this.thumb;\r
-       if (t._isRegion) {\r
-               t.onChange(t.getXValue(), t.getYValue());\r
-       } else {\r
-               t.onChange(t.getValue());\r
-       }\r
+        if ( isNaN(newOffset) ) {\r
+            return false;\r
+        }\r
 \r
-};\r
+        var t = this.thumb;\r
+        var newX, newY;\r
+        this.verifyOffset();\r
+        if (t._isRegion) {\r
+            return false;\r
+        } else if (t._isHoriz) {\r
+            this.onSlideStart();\r
+            // this.fireEvent("slideStart");\r
+            newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
+            this.moveThumb(newX, t.initPageY, skipAnim);\r
+        } else {\r
+            this.onSlideStart();\r
+            // this.fireEvent("slideStart");\r
+            newY = t.initPageY + newOffset + this.thumbCenterPoint.y;\r
+            this.moveThumb(t.initPageX, newY, skipAnim);\r
+        }\r
 \r
-/**\r
- * Provides a way to set the value of the slider in code.\r
- *\r
- * @param {int} newOffset the number of pixels the thumb should be\r
- * positioned away from the initial start point \r
- * @param {boolean} skipAnim set to true to disable the animation\r
- * for this move action (but not others).\r
- * @param {boolean} force ignore the locked setting and set value anyway\r
- * @return {boolean} true if the move was performed, false if it failed\r
- */\r
-YAHOO.widget.Slider.prototype.setValue = function(newOffset, skipAnim, force) {\r
+        return true;\r
+    },\r
 \r
-    if (!this.thumb.available) {\r
-        this.deferredSetValue = arguments;\r
-        return false;\r
-    }\r
+    /**\r
+     * Provides a way to set the value of the region slider in code.\r
+     * @method setRegionValue\r
+     * @param {int} newOffset the number of pixels the thumb should be\r
+     * positioned away from the initial start point (x axis for region)\r
+     * @param {int} newOffset2 the number of pixels the thumb should be\r
+     * positioned away from the initial start point (y axis for region)\r
+     * @param {boolean} skipAnim set to true to disable the animation\r
+     * for this move action (but not others).\r
+     * @param {boolean} force ignore the locked setting and set value anyway\r
+     * @return {boolean} true if the move was performed, false if it failed\r
+     */\r
+    setRegionValue: function(newOffset, newOffset2, skipAnim) {\r
 \r
-    if (this.isLocked() && !force) {\r
-        return false;\r
-    }\r
+        if (!this.thumb.available) {\r
+            this.deferredSetRegionValue = arguments;\r
+            return false;\r
+        }\r
 \r
-       if ( isNaN(newOffset) ) {\r
-               return false;\r
-       }\r
+        if (this.isLocked() && !force) {\r
+            return false;\r
+        }\r
 \r
-       var t = this.thumb;\r
-       var newX, newY;\r
-    this.verifyOffset();\r
-       if (t._isRegion) {\r
-        return false;\r
-       } else if (t._isHoriz) {\r
-        this.onSlideStart();\r
-               newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
-               this.moveThumb(newX, t.initPageY, skipAnim);\r
-       } else {\r
-        this.onSlideStart();\r
-               newY = t.initPageY + newOffset + this.thumbCenterPoint.y;\r
-               this.moveThumb(t.initPageX, newY, skipAnim);\r
-       }\r
-\r
-       return true;\r
-};\r
+        if ( isNaN(newOffset) ) {\r
+            return false;\r
+        }\r
 \r
-/**\r
- * Provides a way to set the value of the region slider in code.\r
- *\r
- * @param {int} newOffset the number of pixels the thumb should be\r
- * positioned away from the initial start point \r
- * @param {int} newOffset2 the number of pixels the thumb should be\r
- * positioned away from the initial start point (y axis for region)\r
- * @param {boolean} skipAnim set to true to disable the animation\r
- * for this move action (but not others).\r
- * @param {boolean} force ignore the locked setting and set value anyway\r
- * @return {boolean} true if the move was performed, false if it failed\r
- */\r
-YAHOO.widget.Slider.prototype.setRegionValue = function(newOffset, newOffset2, skipAnim) {\r
+        var t = this.thumb;\r
+        if (t._isRegion) {\r
+            this.onSlideStart();\r
+            var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
+            var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;\r
+            this.moveThumb(newX, newY, skipAnim);\r
+            return true;\r
+        }\r
 \r
-    if (!this.thumb.available) {\r
-        this.deferredSetRegionValue = arguments;\r
         return false;\r
-    }\r
 \r
-    if (this.isLocked() && !force) {\r
-        return false;\r
-    }\r
+    },\r
 \r
-       if ( isNaN(newOffset) ) {\r
-               return false;\r
-       }\r
+    /**\r
+     * Checks the background position element position.  If it has moved from the\r
+     * baseline position, the constraints for the thumb are reset\r
+     * @method verifyOffset\r
+     * @return {boolean} True if the offset is the same as the baseline.\r
+     */\r
+    verifyOffset: function() {\r
 \r
-       var t = this.thumb;\r
-       if (t._isRegion) {\r
-        this.onSlideStart();\r
-               var newX = t.initPageX + newOffset + this.thumbCenterPoint.x;\r
-               var newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y;\r
-               this.moveThumb(newX, newY, skipAnim);\r
-           return true;\r
-       }\r
+        var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
 \r
-    return false;\r
+        if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
+            this.thumb.resetConstraints();\r
+            this.baselinePos = newPos;\r
+            return false;\r
+        }\r
 \r
-};\r
+        return true;\r
+    },\r
 \r
-/**\r
- * Checks the background position element position.  If it has moved from the\r
- * baseline position, the constraints for the thumb are reset\r
- * @return {boolean} True if the offset is the same as the baseline.\r
- */\r
-YAHOO.widget.Slider.prototype.verifyOffset = function() {\r
+    /**\r
+     * Move the associated slider moved to a timeout to try to get around the \r
+     * mousedown stealing moz does when I move the slider element between the \r
+     * cursor and the background during the mouseup event\r
+     * @method moveThumb\r
+     * @param {int} x the X coordinate of the click\r
+     * @param {int} y the Y coordinate of the click\r
+     * @param {boolean} skipAnim don't animate if the move happend onDrag\r
+     * @private\r
+     */\r
+    moveThumb: function(x, y, skipAnim) {\r
 \r
-    var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
 \r
-    if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
-        this.thumb.resetConstraints();\r
-        this.baselinePos = newPos;\r
-        return false;\r
-    }\r
+        var t = this.thumb;\r
+        var self = this;\r
 \r
-    return true;\r
-};\r
+        if (!t.available) {\r
+            return;\r
+        }\r
 \r
-/**\r
- * Move the associated slider moved to a timeout to try to get around the \r
- * mousedown stealing moz does when I move the slider element between the \r
- * cursor and the background during the mouseup event\r
- *\r
- * @param {int} x the X coordinate of the click\r
- * @param {int} y the Y coordinate of the click\r
- * @param {boolean} skipAnim don't animate if the move happend onDrag\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.moveThumb = function(x, y, skipAnim) {\r
 \r
+        // this.verifyOffset();\r
 \r
-       var t = this.thumb;\r
-       var self = this;\r
+        t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);\r
 \r
-    if (!t.available) {\r
-        return;\r
-    }\r
+        var _p = t.getTargetCoord(x, y);\r
+        var p = [_p.x, _p.y];\r
 \r
+        this.fireEvent("slideStart");\r
 \r
-    // this.verifyOffset();\r
+        if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {\r
+            // this.thumb._animating = true;\r
+            this.lock();\r
+            \r
+            setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
 \r
-       t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y);\r
+        } else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
 \r
-       var _p = t.getTargetCoord(x, y);\r
-    var p = [_p.x, _p.y];\r
+            // this.thumb._animating = true;\r
+            this.lock();\r
 \r
-       if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {\r
-               // this.thumb._animating = true;\r
-               this.lock();\r
-               \r
-               setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
+            var oAnim = new YAHOO.util.Motion( \r
+                    t.id, { points: { to: p } }, \r
+                    this.animationDuration, \r
+                    YAHOO.util.Easing.easeOut );\r
 \r
-       } else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
+            oAnim.onComplete.subscribe( function() { self.endMove(); } );\r
+            oAnim.animate();\r
+        } else {\r
+            t.setDragElPos(x, y);\r
+            // this.fireEvents();\r
+            this.endMove();\r
+        }\r
+    },\r
 \r
-               // this.thumb._animating = true;\r
-               this.lock();\r
+    /**\r
+     * Move the slider one tick mark towards its final coordinate.  Used\r
+     * for the animation when tick marks are defined\r
+     * @method moveOneTick\r
+     * @param {int[]} the destination coordinate\r
+     * @private\r
+     */\r
+    moveOneTick: function(finalCoord) {\r
 \r
-               var oAnim = new YAHOO.util.Motion( \r
-                t.id, { points: { to: p } }, 0.4, YAHOO.util.Easing.easeOut );\r
+        var t = this.thumb;\r
+        var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
+        var tmp;\r
 \r
-               oAnim.onComplete.subscribe( function() { self.endMove(); } );\r
-               oAnim.animate();\r
-       } else {\r
-               t.setDragElPos(x, y);\r
-               // this.fireEvents();\r
-               this.endMove();\r
-       }\r
-};\r
+        // var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
+        // var thresh = 10;\r
+        // var thresh = t.tickSize + (Math.floor(t.tickSize/2));\r
 \r
-/**\r
- * Move the slider one tick mark towards its final coordinate.  Used\r
- * for the animation when tick marks are defined\r
- *\r
- * @param {int[]} the destination coordinate\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.moveOneTick = function(finalCoord) {\r
+        var nextCoord = null;\r
 \r
-       var t = this.thumb;\r
-       var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
-       var tmp;\r
+        if (t._isRegion) {\r
+            nextCoord = this._getNextX(curCoord, finalCoord);\r
+            var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
+            nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
 \r
-    // var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
-    // var thresh = 10;\r
-    // var thresh = t.tickSize + (Math.floor(t.tickSize/2));\r
+        } else if (t._isHoriz) {\r
+            nextCoord = this._getNextX(curCoord, finalCoord);\r
+        } else {\r
+            nextCoord = this._getNextY(curCoord, finalCoord);\r
+        }\r
 \r
-       var nextCoord = null;\r
 \r
-       if (t._isRegion) {\r
-        nextCoord = this._getNextX(curCoord, finalCoord);\r
-               var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
-        nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
+        if (nextCoord) {\r
 \r
-       } else if (t._isHoriz) {\r
-        nextCoord = this._getNextX(curCoord, finalCoord);\r
-       } else {\r
-        nextCoord = this._getNextY(curCoord, finalCoord);\r
-       }\r
+            // move to the next coord\r
+            // YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
 \r
+            // var el = t.getEl();\r
+            // YAHOO.util.Dom.setStyle(el, "left", (nextCoord[0] + this.thumb.deltaSetXY[0]) + "px");\r
+            // YAHOO.util.Dom.setStyle(el, "top",  (nextCoord[1] + this.thumb.deltaSetXY[1]) + "px");\r
 \r
-       if (nextCoord) {\r
+            this.thumb.alignElWithMouse(t.getEl(), nextCoord[0], nextCoord[1]);\r
+            \r
+            // check if we are in the final position, if not make a recursive call\r
+            if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) {\r
+                var self = this;\r
+                setTimeout(function() { self.moveOneTick(finalCoord); }, \r
+                        this.tickPause);\r
+            } else {\r
+                this.endMove();\r
+            }\r
+        } else {\r
+            this.endMove();\r
+        }\r
 \r
-               // move to the next coord\r
-               // YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
+        //this.tickPause = Math.round(this.tickPause/2);\r
+    },\r
 \r
-        // var el = t.getEl();\r
-        // YAHOO.util.Dom.setStyle(el, "left", (nextCoord[0] + this.thumb.deltaSetXY[0]) + "px");\r
-        // YAHOO.util.Dom.setStyle(el, "top",  (nextCoord[1] + this.thumb.deltaSetXY[1]) + "px");\r
+    /**\r
+     * Returns the next X tick value based on the current coord and the target coord.\r
+     * @method _getNextX\r
+     * @private\r
+     */\r
+    _getNextX: function(curCoord, finalCoord) {\r
+        var t = this.thumb;\r
+        var thresh;\r
+        var tmp = [];\r
+        var nextCoord = null;\r
+        if (curCoord[0] > finalCoord[0]) {\r
+            thresh = t.tickSize - this.thumbCenterPoint.x;\r
+            tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else if (curCoord[0] < finalCoord[0]) {\r
+            thresh = t.tickSize + this.thumbCenterPoint.x;\r
+            tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else {\r
+            // equal, do nothing\r
+        }\r
 \r
-        this.thumb.alignElWithMouse(t.getEl(), nextCoord[0], nextCoord[1]);\r
-               \r
-               // check if we are in the final position, if not make a recursive call\r
-               if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) {\r
-                       var self = this;\r
-                       setTimeout(function() { self.moveOneTick(finalCoord); }, \r
-                                       this.tickPause);\r
-               } else {\r
-            this.endMove();\r
-               }\r
-       } else {\r
-        this.endMove();\r
-       }\r
+        return nextCoord;\r
+    },\r
 \r
-       //this.tickPause = Math.round(this.tickPause/2);\r
-};\r
+    /**\r
+     * Returns the next Y tick value based on the current coord and the target coord.\r
+     * @method _getNextY\r
+     * @private\r
+     */\r
+    _getNextY: function(curCoord, finalCoord) {\r
+        var t = this.thumb;\r
+        var thresh;\r
+        var tmp = [];\r
+        var nextCoord = null;\r
+\r
+        if (curCoord[1] > finalCoord[1]) {\r
+            thresh = t.tickSize - this.thumbCenterPoint.y;\r
+            tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else if (curCoord[1] < finalCoord[1]) {\r
+            thresh = t.tickSize + this.thumbCenterPoint.y;\r
+            tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh );\r
+            nextCoord = [tmp.x, tmp.y];\r
+        } else {\r
+            // equal, do nothing\r
+        }\r
 \r
-/**\r
- * Returns the next X tick value based on the current coord and the target coord.\r
- * @private/\r
- */\r
-YAHOO.widget.Slider.prototype._getNextX = function(curCoord, finalCoord) {\r
-    var t = this.thumb;\r
-    var thresh;\r
-    var tmp = [];\r
-    var nextCoord = null;\r
-    if (curCoord[0] > finalCoord[0]) {\r
-        thresh = t.tickSize - this.thumbCenterPoint.x;\r
-        tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else if (curCoord[0] < finalCoord[0]) {\r
-        thresh = t.tickSize + this.thumbCenterPoint.x;\r
-        tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else {\r
-        // equal, do nothing\r
-    }\r
+        return nextCoord;\r
+    },\r
 \r
-    return nextCoord;\r
-};\r
+    /**\r
+     * Resets the constraints before moving the thumb.\r
+     * @method b4MouseDown\r
+     * @private\r
+     */\r
+    b4MouseDown: function(e) {\r
+        this.thumb.autoOffset();\r
+        this.thumb.resetConstraints();\r
+    },\r
 \r
-/**\r
- * Returns the next Y tick value based on the current coord and the target coord.\r
- * @private/\r
- */\r
-YAHOO.widget.Slider.prototype._getNextY = function(curCoord, finalCoord) {\r
-    var t = this.thumb;\r
-    // var thresh = t.tickSize;\r
-    // var thresh = t.tickSize + this.thumbCenterPoint.y;\r
-    var thresh;\r
-    var tmp = [];\r
-    var nextCoord = null;\r
-\r
-    if (curCoord[1] > finalCoord[1]) {\r
-        thresh = t.tickSize - this.thumbCenterPoint.y;\r
-        tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else if (curCoord[1] < finalCoord[1]) {\r
-        thresh = t.tickSize + this.thumbCenterPoint.y;\r
-        tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh );\r
-        nextCoord = [tmp.x, tmp.y];\r
-    } else {\r
-        // equal, do nothing\r
-    }\r
+    /**\r
+     * Handles the mousedown event for the slider background\r
+     * @method onMouseDown\r
+     * @private\r
+     */\r
+    onMouseDown: function(e) {\r
+        // this.resetConstraints(true);\r
+        // this.thumb.resetConstraints(true);\r
 \r
-    return nextCoord;\r
-};\r
+        if (! this.isLocked() && this.backgroundEnabled) {\r
+            var x = YAHOO.util.Event.getPageX(e);\r
+            var y = YAHOO.util.Event.getPageY(e);\r
 \r
-/**\r
- * Resets the constraints before moving the thumb.\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.b4MouseDown = function(e) {\r
-    this.thumb.autoOffset();\r
-    this.thumb.resetConstraints();\r
-};\r
+            this.focus();\r
+            this.moveThumb(x, y);\r
+        }\r
+        \r
+    },\r
 \r
-/**\r
- * Handles the mousedown event for the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onMouseDown = function(e) {\r
-    // this.resetConstraints(true);\r
-    // this.thumb.resetConstraints(true);\r
-\r
-       if (! this.isLocked() && this.backgroundEnabled) {\r
-               var x = YAHOO.util.Event.getPageX(e);\r
-               var y = YAHOO.util.Event.getPageY(e);\r
-\r
-               this.focus();\r
-               this.moveThumb(x, y);\r
-       }\r
-       \r
-};\r
+    /**\r
+     * Handles the onDrag event for the slider background\r
+     * @method onDrag\r
+     * @private\r
+     */\r
+    onDrag: function(e) {\r
+        if (! this.isLocked()) {\r
+            var x = YAHOO.util.Event.getPageX(e);\r
+            var y = YAHOO.util.Event.getPageY(e);\r
+            this.moveThumb(x, y, true);\r
+        }\r
+    },\r
 \r
-/**\r
- * Handles the onDrag event for the slider background\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.onDrag = function(e) {\r
-       if (! this.isLocked()) {\r
-               var x = YAHOO.util.Event.getPageX(e);\r
-               var y = YAHOO.util.Event.getPageY(e);\r
-               this.moveThumb(x, y, true);\r
-       }\r
-};\r
+    /**\r
+     * Fired when the slider movement ends\r
+     * @method endMove\r
+     * @private\r
+     */\r
+    endMove: function () {\r
+        // this._animating = false;\r
+        this.unlock();\r
+        this.moveComplete = true;\r
+        this.fireEvents();\r
+    },\r
 \r
-/**\r
- * Fired when the slider movement ends\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.endMove = function () {\r
-       // this._animating = false;\r
-       this.unlock();\r
-       this.moveComplete = true;\r
-       this.fireEvents();\r
-       \r
-};\r
+    /**\r
+     * Fires the change event if the value has been changed.  Ignored if we are in\r
+     * the middle of an animation as the event will fire when the animation is\r
+     * complete\r
+     * @method fireEvents\r
+     * @private\r
+     */\r
+    fireEvents: function () {\r
 \r
-/**\r
- * Fires the change event if the value has been changed.  Ignored if we are in\r
- * the middle of an animation as the event will fire when the animation is\r
- * complete\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.Slider.prototype.fireEvents = function () {\r
+        var t = this.thumb;\r
 \r
-       var t = this.thumb;\r
+        t.cachePosition();\r
 \r
-       t.cachePosition();\r
+        if (! this.isLocked()) {\r
+            if (t._isRegion) {\r
+                var newX = t.getXValue();\r
+                var newY = t.getYValue();\r
 \r
-       if (! this.isLocked()) {\r
-               if (t._isRegion) {\r
-                       var newX = t.getXValue();\r
-                       var newY = t.getYValue();\r
+                if (newX != this.previousX || newY != this.previousY) {\r
+                    this.onChange(newX, newY);\r
+                    this.fireEvent("change", { x: newX, y: newY });\r
+                }\r
 \r
-                       if (newX != this.previousX || newY != this.previousY) {\r
-                               this.onChange( newX, newY );\r
-                       }\r
+                this.previousX = newX;\r
+                this.previousY = newY;\r
 \r
-                       this.previousX = newX;\r
-                       this.previousY = newY;\r
+            } else {\r
+                var newVal = t.getValue();\r
+                if (newVal != this.previousVal) {\r
+                    this.onChange( newVal );\r
+                    this.fireEvent("change", newVal);\r
+                }\r
+                this.previousVal = newVal;\r
+            }\r
 \r
-               } else {\r
-                       var newVal = t.getValue();\r
-                       if (newVal != this.previousVal) {\r
-                               this.onChange( newVal );\r
-                       }\r
-                       this.previousVal = newVal;\r
-               }\r
+            if (this.moveComplete) {\r
+                this.onSlideEnd();\r
+                this.fireEvent("slideEnd");\r
+                this.moveComplete = false;\r
+            }\r
 \r
-               if (this.moveComplete) {\r
-                       this.onSlideEnd();\r
-                       this.moveComplete = false;\r
-               }\r
+        }\r
+    },\r
 \r
-       }\r
-};\r
+    /**\r
+     * Slider toString\r
+     * @method toString\r
+     * @return {string} string representation of the instance\r
+     */\r
+    toString: function () { \r
+        return ("Slider (" + this.type +") " + this.id);\r
+    }\r
 \r
-/**\r
- * toString\r
- * @return {string} string representation of the instance\r
- */\r
-YAHOO.widget.Slider.prototype.toString = function () { \r
-    return ("Slider (" + this.type +") " + this.id);\r
-};\r
+});\r
+\r
+YAHOO.augment(YAHOO.widget.Slider, YAHOO.util.EventProvider);\r
 \r
 /**\r
  * A drag and drop implementation to be used as the thumb of a slider.\r
- *\r
+ * @class SliderThumb\r
  * @extends YAHOO.util.DD\r
  * @constructor\r
  * @param {String} id the id of the slider html element\r
@@ -711,194 +917,197 @@ YAHOO.widget.Slider.prototype.toString = function () {
  */\r
 YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) {\r
 \r
-       if (id) {\r
-               this.init(id, sGroup);\r
+    if (id) {\r
+        this.init(id, sGroup);\r
 \r
         /**\r
-         * The id of the thumbs parent HTML element (the slider background element).\r
+         * The id of the thumbs parent HTML element (the slider background \r
+         * element).\r
+         * @property parentElId\r
          * @type string\r
          */\r
         this.parentElId = sGroup;\r
-       }\r
+    }\r
+\r
+    //this.removeInvalidHandleType("A");\r
 \r
 \r
-       /**\r
-        * Overrides the isTarget property in YAHOO.util.DragDrop\r
-        * @private\r
-        */\r
-       this.isTarget = false;\r
+    /**\r
+     * Overrides the isTarget property in YAHOO.util.DragDrop\r
+     * @property isTarget\r
+     * @private\r
+     */\r
+    this.isTarget = false;\r
 \r
     /**\r
      * The tick size for this slider\r
+     * @property tickSize\r
      * @type int\r
+     * @private\r
      */\r
-       this.tickSize = iTickSize;\r
+    this.tickSize = iTickSize;\r
 \r
     /**\r
      * Informs the drag and drop util that the offsets should remain when\r
      * resetting the constraints.  This preserves the slider value when\r
      * the constraints are reset\r
+     * @property maintainOffset\r
      * @type boolean\r
+     * @private\r
      */\r
     this.maintainOffset = true;\r
 \r
-       this.initSlider(iLeft, iRight, iUp, iDown, iTickSize);\r
+    this.initSlider(iLeft, iRight, iUp, iDown, iTickSize);\r
 \r
+    /**\r
+     * Turns off the autoscroll feature in drag and drop\r
+     * @property scroll\r
+     * @private\r
+     */\r
     this.scroll = false;\r
 \r
-};\r
-\r
-// YAHOO.widget.SliderThumb.prototype = new YAHOO.util.DD();\r
-YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD);\r
+}; \r
 \r
-/**\r
- * Returns the difference between the location of the thumb and its parent.\r
- * @param {Array} Optionally accepts the position of the parent\r
- * @type int[]\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getOffsetFromParent = function(parentPos) {\r
-    var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
-    var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
+YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {\r
 \r
-    return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
-};\r
+    /**\r
+     * The (X and Y) difference between the thumb location and its parent \r
+     * (the slider background) when the control is instantiated.\r
+     * @property startOffset\r
+     * @type [int, int]\r
+     */\r
+    startOffset: null,\r
 \r
-/**\r
- * The (X and Y) difference between the thumb location and its parent \r
- * (the slider background) when the control is instantiated.  \r
- * @type int[]\r
- */\r
-YAHOO.widget.SliderThumb.prototype.startOffset = null;\r
+    /**\r
+     * Flag used to figure out if this is a horizontal or vertical slider\r
+     * @property _isHoriz\r
+     * @type boolean\r
+     * @private\r
+     */\r
+    _isHoriz: false,\r
 \r
-/**\r
- * Flag used to figure out if this is a horizontal or vertical slider\r
- *\r
- * @type boolean\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._isHoriz = false;\r
+    /**\r
+     * Cache the last value so we can check for change\r
+     * @property _prevVal\r
+     * @type int\r
    * @private\r
    */\r
+    _prevVal: 0,\r
 \r
-/**\r
- * Cache the last value so we can check for change\r
- *\r
- * @type int\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._prevVal = 0;\r
+    /**\r
+     * The slider is _graduated if there is a tick interval defined\r
+     * @property _graduated\r
+     * @type boolean\r
    * @private\r
    */\r
+    _graduated: false,\r
 \r
-/**\r
- * initial element X\r
- *\r
- * @type int\r
- * @private\r
- */\r
-// YAHOO.widget.SliderThumb.prototype._initX = 0;\r
+    /**\r
+     * Returns the difference between the location of the thumb and its parent.\r
+     * @method getOffsetFromParent\r
+     * @param {[int, int]} parentPos Optionally accepts the position of the parent\r
+     * @type [int, int]\r
+     */\r
+    getOffsetFromParent: function(parentPos) {\r
+        var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
+        var ppos  = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
 \r
-/**\r
- * initial element Y\r
- *\r
- * @type int\r
- * @private\r
- */\r
-// YAHOO.widget.SliderThumb.prototype._initY = 0;\r
+        return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+    },\r
 \r
-/**\r
- * The slider is _graduated if there is a tick interval defined\r
- *\r
- * @type boolean\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype._graduated = false;\r
+    /**\r
+     * Set up the slider, must be called in the constructor of all subclasses\r
+     * @method initSlider\r
+     * @param {int} iLeft the number of pixels the element can move left\r
+     * @param {int} iRight the number of pixels the element can move right\r
+     * @param {int} iUp the number of pixels the element can move up\r
+     * @param {int} iDown the number of pixels the element can move down\r
+     * @param {int} iTickSize the width of the tick interval.\r
+     */\r
+    initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) {\r
 \r
-/**\r
- * Set up the slider, must be called in the constructor of all subclasses\r
- *\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize the width of the tick interval.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.initSlider = function (iLeft, iRight, iUp, iDown, \r
-               iTickSize) {\r
+        this.setXConstraint(iLeft, iRight, iTickSize);\r
+        this.setYConstraint(iUp, iDown, iTickSize);\r
 \r
-       this.setXConstraint(iLeft, iRight, iTickSize);\r
-       this.setYConstraint(iUp, iDown, iTickSize);\r
+        if (iTickSize && iTickSize > 1) {\r
+            this._graduated = true;\r
+        }\r
 \r
-       if (iTickSize && iTickSize > 1) {\r
-               this._graduated = true;\r
-       }\r
+        this._isHoriz  = (iLeft || iRight); \r
+        this._isVert   = (iUp   || iDown);\r
+        this._isRegion = (this._isHoriz && this._isVert); \r
 \r
-       this._isHoriz = (iLeft > 0 || iRight > 0); \r
-       this._isVert   = (iUp > 0 ||  iDown > 0);\r
-       this._isRegion = (this._isHoriz && this._isVert); \r
+    },\r
 \r
-};\r
+    /**\r
+     * Clear's the slider's ticks\r
+     * @method clearTicks\r
+     */\r
+    clearTicks: function () {\r
+        YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
+        this._graduated = false;\r
+    },\r
 \r
-/**\r
- * Clear's the slider's ticks\r
- */\r
-YAHOO.widget.SliderThumb.prototype.clearTicks = function () {\r
-    YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
-    this._graduated = false;\r
-};\r
+    /**\r
+     * Gets the current offset from the element's start position in\r
+     * pixels.\r
+     * @method getValue\r
+     * @return {int} the number of pixels (positive or negative) the\r
+     * slider has moved from the start position.\r
+     */\r
+    getValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var val = (this._isHoriz) ? this.getXValue() : this.getYValue();\r
+        return val;\r
+    },\r
 \r
-/**\r
* Gets the current offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
* slider has moved from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var val = (this._isHoriz) ? this.getXValue() : this.getYValue();\r
-    return val;\r
-};\r
+    /**\r
    * Gets the current X offset from the element's start position in\r
    * pixels.\r
+     * @method getXValue\r
    * @return {int} the number of pixels (positive or negative) the\r
    * slider has moved horizontally from the start position.\r
    */\r
+    getXValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var newOffset = this.getOffsetFromParent();\r
+        return (newOffset[0] - this.startOffset[0]);\r
+    },\r
 \r
-/**\r
* Gets the current X offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
* slider has moved horizontally from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getXValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var newOffset = this.getOffsetFromParent();\r
-       return (newOffset[0] - this.startOffset[0]);\r
-};\r
+    /**\r
    * Gets the current Y offset from the element's start position in\r
    * pixels.\r
+     * @method getYValue\r
    * @return {int} the number of pixels (positive or negative) the\r
    * slider has moved vertically from the start position.\r
    */\r
+    getYValue: function () {\r
+        if (!this.available) { return 0; }\r
+        var newOffset = this.getOffsetFromParent();\r
+        return (newOffset[1] - this.startOffset[1]);\r
+    },\r
 \r
-/**\r
- * Gets the current Y offset from the element's start position in\r
- * pixels.\r
- *\r
- * @return {int} the number of pixels (positive or negative) the\r
- * slider has moved vertically from the start position.\r
- */\r
-YAHOO.widget.SliderThumb.prototype.getYValue = function () {\r
-    if (!this.available) { return 0; }\r
-    var newOffset = this.getOffsetFromParent();\r
-       return (newOffset[1] - this.startOffset[1]);\r
-};\r
+    /**\r
+     * Thumb toString\r
+     * @method toString\r
+     * @return {string} string representation of the instance\r
+     */\r
+    toString: function () { \r
+        return "SliderThumb " + this.id;\r
+    },\r
 \r
-/**\r
- * toString\r
- * @return {string} string representation of the instance\r
- */\r
-YAHOO.widget.SliderThumb.prototype.toString = function () { \r
-    return "SliderThumb " + this.id;\r
-};\r
+    /**\r
+     * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider\r
+     * instance it belongs to.\r
+     * @method onChange\r
+     * @private\r
+     */\r
+    onChange: function (x, y) { \r
+    }\r
 \r
-/**\r
- * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider\r
- * instance it belongs to.\r
- *\r
- * @private\r
- */\r
-YAHOO.widget.SliderThumb.prototype.onChange = function (x, y) { };\r
+});\r
 \r
 if ("undefined" == typeof YAHOO.util.Anim) {\r
-       YAHOO.widget.Slider.ANIM_AVAIL = false;\r
+    YAHOO.widget.Slider.ANIM_AVAIL = false;\r
 }\r
 \r
diff --git a/lib/yui/tabview/README b/lib/yui/tabview/README
new file mode 100755 (executable)
index 0000000..b24caa0
--- /dev/null
@@ -0,0 +1,6 @@
+Tabview Release Notes\r
+\r
+*** version 0.12.0 ***\r
+\r
+* Initial release\r
+\r
diff --git a/lib/yui/tabview/tabview-debug.js b/lib/yui/tabview/tabview-debug.js
new file mode 100755 (executable)
index 0000000..498fb0d
--- /dev/null
@@ -0,0 +1,1951 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+(function() {\r
+\r
+    YAHOO.util.Lang = {\r
+        isArray: function(val) { // frames lose type, so test constructor string\r
+            if (val.constructor && val.constructor.toString().indexOf('Array') > -1) {\r
+                return true;\r
+            } else {\r
+                return YAHOO.util.Lang.isObject(val) && val.constructor == Array;\r
+            }\r
+        },\r
+\r
+        isBoolean: function(val) {\r
+            return typeof val == 'boolean';\r
+        },\r
+\r
+        isFunction: function(val) {\r
+            return typeof val == 'function';\r
+        },\r
+\r
+        isNull: function(val) {\r
+            return val === null;\r
+        },\r
+\r
+        isNumber: function(val) {\r
+            return !isNaN(val);\r
+        },\r
+\r
+        isObject: function(val) {\r
+            return typeof val == 'object' || YAHOO.util.Lang.isFunction(val);\r
+        },\r
+\r
+        isString: function(val) {\r
+            return typeof val == 'string';\r
+        },\r
+\r
+        isUndefined: function(val) {\r
+            return typeof val == 'undefined';\r
+        }\r
+    };\r
+})();/**\r
+ * Provides Attribute configurations.\r
+ * @namespace YAHOO.util\r
+ * @class Attribute\r
+ * @constructor\r
+ * @param hash {Object} The intial Attribute.\r
+ * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.\r
+ */\r
+\r
+YAHOO.util.Attribute = function(hash, owner) {\r
+    if (owner) {\r
+        this.owner = owner;\r
+        this.configure(hash, true);\r
+    }\r
+};\r
+\r
+YAHOO.util.Attribute.prototype = {\r
+       /**\r
+     * The name of the attribute.\r
+        * @property name\r
+        * @type String\r
+        */\r
+    name: undefined,\r
+\r
+       /**\r
+     * The value of the attribute.\r
+        * @property value\r
+        * @type String\r
+        */\r
+    value: null,\r
+\r
+       /**\r
+     * The owner of the attribute.\r
+        * @property owner\r
+        * @type YAHOO.util.AttributeProvider\r
+        */\r
+    owner: null,\r
+\r
+       /**\r
+     * Whether or not the attribute is read only.\r
+        * @property readOnly\r
+        * @type Boolean\r
+        */\r
+    readOnly: false,\r
+\r
+       /**\r
+     * Whether or not the attribute can only be written once.\r
+        * @property writeOnce\r
+        * @type Boolean\r
+        */\r
+    writeOnce: false,\r
+\r
+       /**\r
+     * The attribute's initial configuration.\r
+     * @private\r
+        * @property _initialConfig\r
+        * @type Object\r
+        */\r
+    _initialConfig: null,\r
+\r
+       /**\r
+     * Whether or not the attribute's value has been set.\r
+     * @private\r
+        * @property _written\r
+        * @type Boolean\r
+        */\r
+    _written: false,\r
+\r
+       /**\r
+     * The method to use when setting the attribute's value.\r
+     * The method recieves the new value as the only argument.\r
+        * @property method\r
+        * @type Function\r
+        */\r
+    method: null,\r
+\r
+       /**\r
+     * The validator to use when setting the attribute's value.\r
+        * @property validator\r
+        * @type Function\r
+     * @return Boolean\r
+        */\r
+    validator: null,\r
+\r
+    /**\r
+     * Retrieves the current value of the attribute.\r
+     * @method getValue\r
+     * @return {any} The current value of the attribute.\r
+     */\r
+    getValue: function() {\r
+        return this.value;\r
+    },\r
+\r
+    /**\r
+     * Sets the value of the attribute and fires beforeChange and change events.\r
+     * @method setValue\r
+     * @param {Any} value The value to apply to the attribute.\r
+     * @param {Boolean} silent If true the change events will not be fired.\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    setValue: function(value, silent) {\r
+        var beforeRetVal;\r
+        var owner = this.owner;\r
+        var name = this.name;\r
+\r
+        var event = {\r
+            type: name,\r
+            prevValue: this.getValue(),\r
+            newValue: value\r
+        };\r
+\r
+        if (this.readOnly || ( this.writeOnce && this._written) ) {\r
+            return false; // write not allowed\r
+        }\r
+\r
+        if (this.validator && !this.validator.call(owner, value) ) {\r
+            return false; // invalid value\r
+        }\r
+\r
+        if (!silent) {\r
+            beforeRetVal = owner.fireBeforeChangeEvent(event);\r
+            if (beforeRetVal === false) {\r
+                YAHOO.log('setValue ' + name +\r
+                        'cancelled by beforeChange event', 'info', 'Attribute');\r
+                return false;\r
+            }\r
+        }\r
+\r
+        if (this.method) {\r
+            this.method.call(owner, value);\r
+        }\r
+\r
+        this.value = value;\r
+        this._written = true;\r
+\r
+        event.type = name;\r
+\r
+        if (!silent) {\r
+            this.owner.fireChangeEvent(event);\r
+        }\r
+\r
+        return true;\r
+    },\r
+\r
+    /**\r
+     * Allows for configuring the Attribute's properties.\r
+     * @method configure\r
+     * @param {Object} map A key-value map of Attribute properties.\r
+     * @param {Boolean} init Whether or not this should become the initial config.\r
+     */\r
+    configure: function(map, init) {\r
+        map = map || {};\r
+        this._written = false; // reset writeOnce\r
+        this._initialConfig = this._initialConfig || {};\r
+\r
+        for (var key in map) {\r
+            if ( key && map.hasOwnProperty(key) ) {\r
+                this[key] = map[key];\r
+                if (init) {\r
+                    this._initialConfig[key] = map[key];\r
+                }\r
+            }\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Resets the value to the initial config value.\r
+     * @method resetValue\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    resetValue: function() {\r
+        return this.setValue(this._initialConfig.value);\r
+    },\r
+\r
+    /**\r
+     * Resets the attribute config to the initial config state.\r
+     * @method resetConfig\r
+     */\r
+    resetConfig: function() {\r
+        this.configure(this._initialConfig);\r
+    },\r
+\r
+    /**\r
+     * Resets the value to the current value.\r
+     * Useful when values may have gotten out of sync with actual properties.\r
+     * @method refresh\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    refresh: function(silent) {\r
+        this.setValue(this.value, silent);\r
+    }\r
+};(function() {\r
+    var Lang = YAHOO.util.Lang;\r
+\r
+    /*\r
+    Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+    Code licensed under the BSD License:\r
+    http://developer.yahoo.net/yui/license.txt\r
+    */\r
+\r
+    /**\r
+     * Provides and manages YAHOO.util.Attribute instances\r
+     * @namespace YAHOO.util\r
+     * @class AttributeProvider\r
+     * @uses YAHOO.util.EventProvider\r
+     */\r
+    YAHOO.util.AttributeProvider = function() {};\r
+\r
+    YAHOO.util.AttributeProvider.prototype = {\r
+\r
+        /**\r
+         * A key-value map of Attribute configurations\r
+         * @property _configs\r
+         * @protected (may be used by subclasses and augmentors)\r
+         * @private\r
+         * @type {Object}\r
+         */\r
+        _configs: null,\r
+        /**\r
+         * Returns the current value of the attribute.\r
+         * @method get\r
+         * @param {String} key The attribute whose value will be returned.\r
+         */\r
+        get: function(key){\r
+            var configs = this._configs || {};\r
+            var config = configs[key];\r
+\r
+            if (!config) {\r
+                YAHOO.log(key + ' not found', 'error', 'AttributeProvider');\r
+                return undefined;\r
+            }\r
+\r
+            return config.value;\r
+        },\r
+\r
+        /**\r
+         * Sets the value of a config.\r
+         * @method set\r
+         * @param {String} key The name of the attribute\r
+         * @param {Any} value The value to apply to the attribute\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         * @return {Boolean} Whether or not the value was set.\r
+         */\r
+        set: function(key, value, silent){\r
+            var configs = this._configs || {};\r
+            var config = configs[key];\r
+\r
+            if (!config) {\r
+                YAHOO.log('set failed: ' + key + ' not found',\r
+                        'error', 'AttributeProvider');\r
+                return false;\r
+            }\r
+\r
+            return config.setValue(value, silent);\r
+        },\r
+\r
+        /**\r
+         * Returns an array of attribute names.\r
+         * @method getAttributeKeys\r
+         * @return {Array} An array of attribute names.\r
+         */\r
+        getAttributeKeys: function(){\r
+            var configs = this._configs;\r
+            var keys = [];\r
+            var config;\r
+            for (var key in configs) {\r
+                config = configs[key];\r
+                if ( configs.hasOwnProperty(key) &&\r
+                        !Lang.isUndefined(config) ) {\r
+                    keys[keys.length] = key;\r
+                }\r
+            }\r
+\r
+            return keys;\r
+        },\r
+\r
+        /**\r
+         * Sets multiple attribute values.\r
+         * @method setAttributes\r
+         * @param {Object} map  A key-value map of attributes\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         */\r
+        setAttributes: function(map, silent){\r
+            for (var key in map) {\r
+                if ( map.hasOwnProperty(key) ) {\r
+                    this.set(key, map[key], silent);\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Resets the specified attribute's value to its initial value.\r
+         * @method resetValue\r
+         * @param {String} key The name of the attribute\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         * @return {Boolean} Whether or not the value was set\r
+         */\r
+        resetValue: function(key, silent){\r
+            var configs = this._configs || {};\r
+            if (configs[key]) {\r
+                this.set(key, configs[key]._initialConfig.value, silent);\r
+                return true;\r
+            }\r
+            return false;\r
+        },\r
+\r
+        /**\r
+         * Sets the attribute's value to its current value.\r
+         * @method refresh\r
+         * @param {String | Array} key The attribute(s) to refresh\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         */\r
+        refresh: function(key, silent){\r
+            var configs = this._configs;\r
+\r
+            key = ( ( Lang.isString(key) ) ? [key] : key ) ||\r
+                    this.getAttributeKeys();\r
+\r
+            for (var i = 0, len = key.length; i < len; ++i) {\r
+                if ( // only set if there is a value and not null\r
+                    configs[key[i]] &&\r
+                    ! Lang.isUndefined(configs[key[i]].value) &&\r
+                    ! Lang.isNull(configs[key[i]].value) ) {\r
+                    configs[key[i]].refresh(silent);\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Adds an Attribute to the AttributeProvider instance.\r
+         * @method register\r
+         * @param {String} key The attribute's name\r
+         * @param {Object} map A key-value map containing the\r
+         * attribute's properties.\r
+         */\r
+        register: function(key, map) {\r
+            this._configs = this._configs || {};\r
+\r
+            if (this._configs[key]) { // dont override\r
+                return false;\r
+            }\r
+\r
+            map.name = key;\r
+            this._configs[key] = new YAHOO.util.Attribute(map, this);\r
+            return true;\r
+        },\r
+\r
+        /**\r
+         * Returns the attribute's properties.\r
+         * @method getAttributeConfig\r
+         * @param {String} key The attribute's name\r
+         * @private\r
+         * @return {object} A key-value map containing all of the\r
+         * attribute's properties.\r
+         */\r
+        getAttributeConfig: function(key) {\r
+            var configs = this._configs || {};\r
+            var config = configs[key] || {};\r
+            var map = {}; // returning a copy to prevent overrides\r
+\r
+            for (key in config) {\r
+                if ( config.hasOwnProperty(key) ) {\r
+                    map[key] = config[key];\r
+                }\r
+            }\r
+\r
+            return map;\r
+        },\r
+\r
+        /**\r
+         * Sets or updates an Attribute instance's properties.\r
+         * @method configureAttribute\r
+         * @param {String} key The attribute's name.\r
+         * @param {Object} map A key-value map of attribute properties\r
+         * @param {Boolean} init Whether or not this should become the intial config.\r
+         */\r
+        configureAttribute: function(key, map, init) {\r
+            var configs = this._configs || {};\r
+\r
+            if (!configs[key]) {\r
+                YAHOO.log('unable to configure, ' + key + ' not found',\r
+                        'error', 'AttributeProvider');\r
+                return false;\r
+            }\r
+\r
+            configs[key].configure(map, init);\r
+        },\r
+\r
+        /**\r
+         * Resets an attribute to its intial configuration.\r
+         * @method resetAttributeConfig\r
+         * @param {String} key The attribute's name.\r
+         * @private\r
+         */\r
+        resetAttributeConfig: function(key){\r
+            var configs = this._configs || {};\r
+            configs[key].resetConfig();\r
+        },\r
+\r
+        /**\r
+         * Fires the attribute's beforeChange event.\r
+         * @method fireBeforeChangeEvent\r
+         * @param {String} key The attribute's name.\r
+         * @param {Obj} e The event object to pass to handlers.\r
+         */\r
+        fireBeforeChangeEvent: function(e) {\r
+            var type = 'before';\r
+            type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change';\r
+            e.type = type;\r
+            return this.fireEvent(e.type, e);\r
+        },\r
+\r
+        /**\r
+         * Fires the attribute's change event.\r
+         * @method fireChangeEvent\r
+         * @param {String} key The attribute's name.\r
+         * @param {Obj} e The event object to pass to the handlers.\r
+         */\r
+        fireChangeEvent: function(e) {\r
+            e.type += 'Change';\r
+            return this.fireEvent(e.type, e);\r
+        }\r
+    };\r
+\r
+    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);\r
+})();(function() {\r
+// internal shorthand\r
+var Dom = YAHOO.util.Dom,\r
+    Lang = YAHOO.util.Lang,\r
+    EventPublisher = YAHOO.util.EventPublisher,\r
+    AttributeProvider = YAHOO.util.AttributeProvider;\r
+\r
+/**\r
+ * Element provides an interface to an HTMLElement's attributes and common\r
+ * methods.  Other commonly used attributes are added as well.\r
+ * @namespace YAHOO.util\r
+ * @class Element\r
+ * @uses YAHOO.util.AttributeProvider\r
+ * @constructor\r
+ * @param el {HTMLElement | String} The html element that\r
+ * represents the Element.\r
+ * @param {Object} map A key-value map of initial config names and values\r
+ */\r
+YAHOO.util.Element = function(el, map) {\r
+    if (arguments.length) {\r
+        this.init(el, map);\r
+    }\r
+};\r
+\r
+YAHOO.util.Element.prototype = {\r
+       /**\r
+     * Dom events supported by the Element instance.\r
+        * @property DOM_EVENTS\r
+        * @type Object\r
+        */\r
+    DOM_EVENTS: null,\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method appendChild\r
+        * @param {Boolean} deep Whether or not to do a deep clone\r
+        */\r
+    appendChild: function(child) {\r
+        child = child.get ? child.get('element') : child;\r
+        this.get('element').appendChild(child);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method getElementsByTagName\r
+        * @param {String} tag The tagName to collect\r
+        */\r
+    getElementsByTagName: function(tag) {\r
+        return this.get('element').getElementsByTagName(tag);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method hasChildNodes\r
+        * @return {Boolean} Whether or not the element has childNodes\r
+        */\r
+    hasChildNodes: function() {\r
+        return this.get('element').hasChildNodes();\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method insertBefore\r
+        * @param {HTMLElement} element The HTMLElement to insert\r
+        * @param {HTMLElement} before The HTMLElement to insert\r
+     * the element before.\r
+        */\r
+    insertBefore: function(element, before) {\r
+        element = element.get ? element.get('element') : element;\r
+        before = (before && before.get) ? before.get('element') : before;\r
+\r
+        this.get('element').insertBefore(element, before);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method removeChild\r
+        * @param {HTMLElement} child The HTMLElement to remove\r
+        */\r
+    removeChild: function(child) {\r
+        child = child.get ? child.get('element') : child;\r
+        this.get('element').removeChild(child);\r
+        return true;\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method replaceChild\r
+        * @param {HTMLElement} newNode The HTMLElement to insert\r
+        * @param {HTMLElement} oldNode The HTMLElement to replace\r
+        */\r
+    replaceChild: function(newNode, oldNode) {\r
+        newNode = newNode.get ? newNode.get('element') : newNode;\r
+        oldNode = oldNode.get ? oldNode.get('element') : oldNode;\r
+        return this.get('element').replaceChild(newNode, oldNode);\r
+    },\r
+\r
+\r
+    /**\r
+     * Registers Element specific attributes.\r
+     * @method initAttributes\r
+     * @param {Object} map A key-value map of initial attribute configs\r
+     */\r
+    initAttributes: function(map) {\r
+        map = map || {};\r
+        var element = Dom.get(map.element) || null;\r
+\r
+        /**\r
+         * The HTMLElement the Element instance refers to.\r
+         * @config element\r
+         * @type HTMLElement\r
+         */\r
+        this.register('element', {\r
+            value: element,\r
+            readOnly: true\r
+         });\r
+    },\r
+\r
+    /**\r
+     * Adds a listener for the given event.  These may be DOM or\r
+     * customEvent listeners.  Any event that is fired via fireEvent\r
+     * can be listened for.  All handlers receive an event object.\r
+     * @method addListener\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The handler to call when the event fires\r
+     * @param {Any} obj A variable to pass to the handler\r
+     * @param {Object} scope The object to use for the scope of the handler\r
+     */\r
+    addListener: function(type, fn, obj, scope) {\r
+        var el = this.get('element');\r
+        var scope = scope || this;\r
+\r
+        el = this.get('id') || el;\r
+\r
+        if (!this._events[type]) { // create on the fly\r
+            if ( this.DOM_EVENTS[type] ) {\r
+                YAHOO.util.Event.addListener(el, type, function(e) {\r
+                    if (e.srcElement && !e.target) { // supplement IE with target\r
+                        e.target = e.srcElement;\r
+                    }\r
+                    this.fireEvent(type, e);\r
+                }, obj, scope);\r
+            }\r
+\r
+            this.createEvent(type, this);\r
+            this._events[type] = true;\r
+        }\r
+\r
+        this.subscribe.apply(this, arguments); // notify via customEvent\r
+    },\r
+\r
+\r
+    /**\r
+     * Alias for addListener\r
+     * @method on\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The function call when the event fires\r
+     * @param {Any} obj A variable to pass to the handler\r
+     * @param {Object} scope The object to use for the scope of the handler\r
+     */\r
+    on: function() { this.addListener.apply(this, arguments); },\r
+\r
+\r
+    /**\r
+     * Remove an event listener\r
+     * @method removeListener\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The function call when the event fires\r
+     */\r
+    removeListener: function(type, fn) {\r
+        this.unsubscribe.apply(this, arguments);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method addClass\r
+        * @param {String} className The className to add\r
+        */\r
+    addClass: function(className) {\r
+        Dom.addClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method getElementsByClassName\r
+        * @param {String} className The className to collect\r
+        * @param {String} tag (optional) The tag to use in\r
+     * conjunction with class name\r
+     * @return {Array} Array of HTMLElements\r
+        */\r
+    getElementsByClassName: function(className, tag) {\r
+        return Dom.getElementsByClassName(className, tag,\r
+                this.get('element') );\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method hasClass\r
+        * @param {String} className The className to add\r
+     * @return {Boolean} Whether or not the element has the class name\r
+        */\r
+    hasClass: function(className) {\r
+        return Dom.hasClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method removeClass\r
+        * @param {String} className The className to remove\r
+        */\r
+    removeClass: function(className) {\r
+        return Dom.removeClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method replaceClass\r
+        * @param {String} oldClassName The className to replace\r
+        * @param {String} newClassName The className to add\r
+        */\r
+    replaceClass: function(oldClassName, newClassName) {\r
+        return Dom.replaceClass(this.get('element'),\r
+                oldClassName, newClassName);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method setStyle\r
+        * @param {String} property The style property to set\r
+        * @param {String} value The value to apply to the style property\r
+        */\r
+    setStyle: function(property, value) {\r
+        return Dom.setStyle(this.get('element'),  property, value);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method getStyle\r
+        * @param {String} property The style property to retrieve\r
+        * @return {String} The current value of the property\r
+        */\r
+    getStyle: function(property) {\r
+        return Dom.getStyle(this.get('element'),  property);\r
+    },\r
+\r
+       /**\r
+     * Apply any queued set calls.\r
+        * @method fireQueue\r
+        */\r
+    fireQueue: function() {\r
+        var queue = this._queue;\r
+        for (var i = 0, len = queue.length; i < len; ++i) {\r
+            this[queue[i][0]].apply(this, queue[i][1]);\r
+        }\r
+    },\r
+\r
+       /**\r
+     * Appends the HTMLElement into either the supplied parentNode.\r
+        * @method appendTo\r
+        * @param {HTMLElement | Element} parentNode The node to append to\r
+        * @param {HTMLElement | Element} before An optional node to insert before\r
+        */\r
+    appendTo: function(parent, before) {\r
+        parent = (parent.get) ?  parent.get('element') : Dom.get(parent);\r
+\r
+        before = (before && before.get) ?\r
+                before.get('element') : Dom.get(before);\r
+        var element = this.get('element');\r
+\r
+        var newAddition =  !Dom.inDocument(element);\r
+\r
+        if (!element) {\r
+            YAHOO.log('appendTo failed: element not available',\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        if (!parent) {\r
+            YAHOO.log('appendTo failed: parent not available',\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        if (element.parent != parent) {\r
+            if (before) {\r
+                parent.insertBefore(element, before);\r
+            } else {\r
+                parent.appendChild(element);\r
+            }\r
+        }\r
+\r
+        YAHOO.log(element + 'appended to ' + parent);\r
+\r
+        if (!newAddition) {\r
+            return false; // note return; no refresh if in document\r
+        }\r
+\r
+        // if a new addition, refresh HTMLElement any applied attributes\r
+        var keys = this.getAttributeKeys();\r
+\r
+        for (var key in keys) { // only refresh HTMLElement attributes\r
+            if ( !Lang.isUndefined(element[key]) ) {\r
+                this.refresh(key);\r
+            }\r
+        }\r
+    },\r
+\r
+    get: function(key) {\r
+        var configs = this._configs || {};\r
+        var el = configs.element; // avoid loop due to 'element'\r
+        if (el && !configs[key] && !Lang.isUndefined(el.value[key]) ) {\r
+            return el.value[key];\r
+        }\r
+\r
+        return AttributeProvider.prototype.get.call(this, key);\r
+    },\r
+\r
+    set: function(key, value, silent) {\r
+        var el = this.get('element');\r
+        if (!el) {\r
+            this._queue[key] = ['set', arguments];\r
+            return false;\r
+        }\r
+\r
+        // set it on the element if not a property\r
+        if ( !this._configs[key] && !Lang.isUndefined(el[key]) ) {\r
+            _registerHTMLAttr(this, key);\r
+        }\r
+\r
+        return AttributeProvider.prototype.set.apply(this, arguments);\r
+    },\r
+\r
+    register: function(key) { // protect html attributes\r
+        var configs = this._configs || {};\r
+        var element = this.get('element') || null;\r
+\r
+        if ( element && !Lang.isUndefined(element[key]) ) {\r
+            YAHOO.log(key + ' is reserved for ' + element,\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        return AttributeProvider.prototype.register.apply(this, arguments);\r
+    },\r
+\r
+    configureAttribute: function(property, map, init) { // protect html attributes\r
+        if (!this._configs[property] && this._configs.element &&\r
+                !Lang.isUndefined(this._configs.element[property]) ) {\r
+            _registerHTMLAttr(this, property, map);\r
+            return false;\r
+        }\r
+\r
+        return AttributeProvider.prototype.configure.apply(this, arguments);\r
+    },\r
+\r
+    getAttributeKeys: function() {\r
+        var el = this.get('element');\r
+        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);\r
+\r
+        //add any unconfigured element keys\r
+        for (var key in el) {\r
+            if (!this._configs[key]) {\r
+                keys[key] = keys[key] || el[key];\r
+            }\r
+        }\r
+\r
+        return keys;\r
+    },\r
+\r
+    init: function(el, attr) {\r
+        this._queue = this._queue || [];\r
+        this._events = this._events || {};\r
+        this._configs = this._configs || {};\r
+        attr = attr || {};\r
+        attr.element = attr.element || el || null;\r
+\r
+        this.DOM_EVENTS = {\r
+            'click': true,\r
+            'keydown': true,\r
+            'keypress': true,\r
+            'keyup': true,\r
+            'mousedown': true,\r
+            'mousemove': true,\r
+            'mouseout': true,\r
+            'mouseover': true,\r
+            'mouseup': true\r
+        };\r
+\r
+        var readyHandler = function() {\r
+            this.initAttributes(attr);\r
+\r
+            this.setAttributes(attr, true);\r
+            this.fireQueue();\r
+            this.fireEvent('contentReady', {\r
+                type: 'contentReady',\r
+                target: attr.element\r
+            });\r
+        };\r
+\r
+        if ( Lang.isString(el) ) {\r
+            _registerHTMLAttr(this, 'id', { value: el });\r
+            YAHOO.util.Event.onAvailable(el, function() {\r
+                attr.element = Dom.get(el);\r
+                this.fireEvent('available', {\r
+                    type: 'available',\r
+                    target: attr.element\r
+                });\r
+            }, this, true);\r
+\r
+            YAHOO.util.Event.onContentReady(el, function() {\r
+                readyHandler.call(this);\r
+            }, this, true);\r
+        } else {\r
+            readyHandler.call(this);\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets the value of the property and fires beforeChange and change events.\r
+ * @private\r
+ * @method _registerHTMLAttr\r
+ * @param {YAHOO.util.Element} element The Element instance to\r
+ * register the config to.\r
+ * @param {String} key The name of the config to register\r
+ * @param {Object} map A key-value map of the config's params\r
+ */\r
+var _registerHTMLAttr = function(self, key, map) {\r
+    var el = self.get('element');\r
+    map = map || {};\r
+    map.name = key;\r
+    map.method = map.method || function(value) {\r
+        el[key] = value;\r
+    };\r
+    map.value = map.value || el[key];\r
+    self._configs[key] = new YAHOO.util.Attribute(map, self);\r
+};\r
+\r
+/**\r
+ * Fires when the Element's HTMLElement can be retrieved by Id.\r
+ * <p>See: <a href="#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> available<br>\r
+ * <code>&lt;HTMLElement&gt;\r
+ * target</code> the HTMLElement bound to this Element instance<br>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var target = e.target};<br>\r
+ * myTabs.addListener('available', handler);</code></p>\r
+ * @event available\r
+ */\r
+\r
+/**\r
+ * Fires when the Element's HTMLElement subtree is rendered.\r
+ * <p>See: <a href="#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> contentReady<br>\r
+ * <code>&lt;HTMLElement&gt;\r
+ * target</code> the HTMLElement bound to this Element instance<br>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var target = e.target};<br>\r
+ * myTabs.addListener('contentReady', handler);</code></p>\r
+ * @event contentReady\r
+ */\r
+\r
+\r
+YAHOO.augment(YAHOO.util.Element, AttributeProvider);\r
+})();(function() {\r
+    var Dom = YAHOO.util.Dom,\r
+        Event = YAHOO.util.Event,\r
+        Lang = YAHOO.util.Lang;\r
+\r
+    /**\r
+     * A representation of a Tab's label and content.\r
+     * @namespace YAHOO.widget\r
+     * @class Tab\r
+     * @extends YAHOO.util.Element\r
+     * @constructor\r
+     * @param element {HTMLElement | String} (optional) The html element that\r
+     * represents the TabView. An element will be created if none provided.\r
+     * @param {Object} properties A key map of initial properties\r
+     */\r
+    Tab = function(el, attr) {\r
+        attr = attr || {};\r
+        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {\r
+            attr = el;\r
+            el = attr.element;\r
+        }\r
+\r
+        if (!el && !attr.element) {\r
+            el = _createTabElement.call(this, attr);\r
+        }\r
+\r
+        this.loadHandler =  {\r
+            success: function(o) {\r
+                this.set('content', o.responseText);\r
+            },\r
+            failure: function(o) {\r
+                YAHOO.log('loading failed: ' + o.statusText,\r
+                        'error', 'Tab');\r
+            }\r
+        };\r
+\r
+        Tab.superclass.constructor.call(this, el, attr);\r
+\r
+        this.DOM_EVENTS = {}; // delegating to tabView\r
+    };\r
+\r
+    YAHOO.extend(Tab, YAHOO.util.Element);\r
+    var proto = Tab.prototype;\r
+\r
+    /**\r
+     * The default tag name for a Tab's inner element.\r
+     * @property LABEL_INNER_TAGNAME\r
+     * @type String\r
+     * @default "em"\r
+     */\r
+    proto.LABEL_TAGNAME = 'em';\r
+\r
+    /**\r
+     * The class name applied to active tabs.\r
+     * @property ACTIVE_CLASSNAME\r
+     * @type String\r
+     * @default "on"\r
+     */\r
+    proto.ACTIVE_CLASSNAME = 'selected';\r
+\r
+    /**\r
+     * The class name applied to disabled tabs.\r
+     * @property DISABLED_CLASSNAME\r
+     * @type String\r
+     * @default "disabled"\r
+     */\r
+    proto.DISABLED_CLASSNAME = 'disabled';\r
+\r
+    /**\r
+     * The class name applied to dynamic tabs while loading.\r
+     * @property LOADING_CLASSNAME\r
+     * @type String\r
+     * @default "disabled"\r
+     */\r
+    proto.LOADING_CLASSNAME = 'loading';\r
+\r
+    /**\r
+     * Provides a reference to the connection request object when data is\r
+     * loaded dynamically.\r
+     * @property dataConnection\r
+     * @type Object\r
+     */\r
+    proto.dataConnection = null;\r
+\r
+    /**\r
+     * Object containing success and failure callbacks for loading data.\r
+     * @property loadHandler\r
+     * @type object\r
+     */\r
+    proto.loadHandler = null;\r
+\r
+    /**\r
+     * Provides a readable name for the tab.\r
+     * @method toString\r
+     * @return String\r
+     */\r
+    proto.toString = function() {\r
+        var el = this.get('element');\r
+        var id = el.id || el.tagName;\r
+        return "Tab " + id;\r
+    };\r
+\r
+    /**\r
+     * Registers TabView specific properties.\r
+     * @method initAttributes\r
+     * @param {Object} attr Hash of initial attributes\r
+     */\r
+    proto.initAttributes = function(attr) {\r
+        attr = attr || {};\r
+        Tab.superclass.initAttributes.call(this, attr);\r
+\r
+        var el = this.get('element');\r
+\r
+        /**\r
+         * The event that triggers the tab's activation.\r
+         * @config activationEvent\r
+         * @type String\r
+         */\r
+        this.register('activationEvent', {\r
+            value: attr.activationEvent || 'click'\r
+        });\r
+\r
+        /**\r
+         * The element that contains the tab's label.\r
+         * @config labelEl\r
+         * @type HTMLElement\r
+         */\r
+        this.register('labelEl', {\r
+            value: attr.labelEl || _getlabelEl.call(this),\r
+            method: function(value) {\r
+                var current = this.get('labelEl');\r
+\r
+                if (current) {\r
+                    if (current == value) {\r
+                        return false; // already set\r
+                    }\r
+\r
+                    this.replaceChild(value, current);\r
+                } else if (el.firstChild) { // ensure label is firstChild by default\r
+                    this.insertBefore(value, el.firstChild);\r
+                } else {\r
+                    this.appendChild(value);\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab's label text (or innerHTML).\r
+         * @config label\r
+         * @type String\r
+         */\r
+        this.register('label', {\r
+            value: attr.label || _getLabel.call(this),\r
+            method: function(value) {\r
+                var labelEl = this.get('labelEl');\r
+                if (!labelEl) { // create if needed\r
+                    this.set('labelEl', _createlabelEl.call(this));\r
+                }\r
+\r
+                _setLabel.call(this, value);\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The HTMLElement that contains the tab's content.\r
+         * @config contentEl\r
+         * @type HTMLElement\r
+         */\r
+        this.register('contentEl', { // TODO: apply className?\r
+            value: attr.contentEl || document.createElement('div'),\r
+            method: function(value) {\r
+                var current = this.get('contentEl');\r
+\r
+                if (current) {\r
+                    if (current == value) {\r
+                        return false; // already set\r
+                    }\r
+                    this.replaceChild(value, current);\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab's content.\r
+         * @config content\r
+         * @type String\r
+         */\r
+        this.register('content', {\r
+            value: attr.content, // TODO: what about existing?\r
+            method: function(value) {\r
+                this.get('contentEl').innerHTML = value;\r
+            }\r
+        });\r
+\r
+        var _dataLoaded = false;\r
+\r
+        /**\r
+         * The tab's data source, used for loading content dynamically.\r
+         * @config dataSrc\r
+         * @type String\r
+         */\r
+        this.register('dataSrc', {\r
+            value: attr.dataSrc\r
+        });\r
+\r
+        /**\r
+         * Whether or not content should be reloaded for every view.\r
+         * @config cacheData\r
+         * @type Boolean\r
+         * @default false\r
+         */\r
+        this.register('cacheData', {\r
+            value: attr.cacheData || false,\r
+            validator: Lang.isBoolean\r
+        });\r
+\r
+        /**\r
+         * The method to use for the data request.\r
+         * @config loadMethod\r
+         * @type String\r
+         * @default "GET"\r
+         */\r
+        this.register('loadMethod', {\r
+            value: attr.loadMethod || 'GET',\r
+            validator: Lang.isString\r
+        });\r
+\r
+        /**\r
+         * Whether or not any data has been loaded from the server.\r
+         * @config dataLoaded\r
+         * @type Boolean\r
+         */\r
+        this.register('dataLoaded', {\r
+            value: false,\r
+            validator: Lang.isBoolean,\r
+            writeOnce: true\r
+        });\r
+\r
+        /**\r
+         * Number if milliseconds before aborting and calling failure handler.\r
+         * @config dataTimeout\r
+         * @type Number\r
+         * @default null\r
+         */\r
+        this.register('dataTimeout', {\r
+            value: attr.dataTimeout || null,\r
+            validator: Lang.isNumber\r
+        });\r
+\r
+        /**\r
+         * Whether or not the tab is currently active.\r
+         * If a dataSrc is set for the tab, the content will be loaded from\r
+         * the given source.\r
+         * @config active\r
+         * @type Boolean\r
+         */\r
+        this.register('active', {\r
+            value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME),\r
+            method: function(value) {\r
+                if (value === true) {\r
+                    this.addClass(this.ACTIVE_CLASSNAME);\r
+                    this.set('title', 'active');\r
+                } else {\r
+                    this.removeClass(this.ACTIVE_CLASSNAME);\r
+                    this.set('title', '');\r
+                }\r
+            },\r
+            validator: function(value) {\r
+                return Lang.isBoolean(value) && !this.get('disabled') ;\r
+            }\r
+        });\r
+\r
+        /**\r
+         * Whether or not the tab is disabled.\r
+         * @config disabled\r
+         * @type Boolean\r
+         */\r
+        this.register('disabled', {\r
+            value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME),\r
+            method: function(value) {\r
+                if (value === true) {\r
+                    Dom.addClass(this.get('element'), this.DISABLED_CLASSNAME);\r
+                } else {\r
+                    Dom.removeClass(this.get('element'), this.DISABLED_CLASSNAME);\r
+                }\r
+            },\r
+            validator: Lang.isBoolean\r
+        });\r
+\r
+        /**\r
+         * The href of the tab's anchor element.\r
+         * @config href\r
+         * @type String\r
+         * @default '#'\r
+         */\r
+        this.register('href', {\r
+            value: attr.href || '#',\r
+            method: function(value) {\r
+                this.getElementsByTagName('a')[0].href = value;\r
+            },\r
+            validator: Lang.isString\r
+        });\r
+\r
+        /**\r
+         * The Whether or not the tab's content is visible.\r
+         * @config contentVisible\r
+         * @type Boolean\r
+         * @default false\r
+         */\r
+        this.register('contentVisible', {\r
+            value: attr.contentVisible,\r
+            method: function(value) {\r
+                if (value == true) {\r
+                    this.get('contentEl').style.display = 'block';\r
+\r
+                    if ( this.get('dataSrc') ) {\r
+                     // load dynamic content unless already loaded and caching\r
+                        if ( !this.get('dataLoaded') || !this.get('cacheData') ) {\r
+                            _dataConnect.call(this);\r
+                        }\r
+                    }\r
+                } else {\r
+                    this.get('contentEl').style.display = 'none';\r
+                }\r
+            },\r
+            validator: Lang.isBoolean\r
+        });\r
+    };\r
+\r
+    var _createTabElement = function(attr) {\r
+        var el = document.createElement('li');\r
+        var a = document.createElement('a');\r
+\r
+        a.href = attr.href || '#';\r
+\r
+        el.appendChild(a);\r
+\r
+        var label = attr.label || null;\r
+        var labelEl = attr.labelEl || null;\r
+\r
+        if (labelEl) { // user supplied labelEl\r
+            if (!label) { // user supplied label\r
+                label = _getLabel.call(this, labelEl);\r
+            }\r
+        } else {\r
+            labelEl = _createlabelEl.call(this);\r
+        }\r
+\r
+        a.appendChild(labelEl);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _getlabelEl = function() {\r
+        return this.getElementsByTagName(this.LABEL_TAGNAME)[0];\r
+    };\r
+\r
+    var _createlabelEl = function() {\r
+        var el = document.createElement(this.LABEL_TAGNAME);\r
+        return el;\r
+    };\r
+\r
+    var _setLabel = function(label) {\r
+        var el = this.get('labelEl');\r
+        el.innerHTML = label;\r
+    };\r
+\r
+    var _getLabel = function() {\r
+        var label,\r
+            el = this.get('labelEl');\r
+\r
+            if (!el) {\r
+                return undefined;\r
+            }\r
+\r
+        return el.innerHTML;\r
+    };\r
+\r
+    var _dataConnect = function() {\r
+        if (!YAHOO.util.Connect) {\r
+            YAHOO.log('YAHOO.util.Connect dependency not met',\r
+                    'error', 'Tab');\r
+            return false;\r
+        }\r
+\r
+        Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);\r
+\r
+        this.dataConnection = YAHOO.util.Connect.asyncRequest(\r
+            this.get('loadMethod'),\r
+            this.get('dataSrc'),\r
+            {\r
+                success: function(o) {\r
+                    this.loadHandler.success.call(this, o);\r
+                    this.set('dataLoaded', true);\r
+                    this.dataConnection = null;\r
+                    Dom.removeClass(this.get('contentEl').parentNode,\r
+                            this.LOADING_CLASSNAME);\r
+                },\r
+                failure: function(o) {\r
+                    this.loadHandler.failure.call(this, o);\r
+                    this.dataConnection = null;\r
+                    Dom.removeClass(this.get('contentEl').parentNode,\r
+                            this.LOADING_CLASSNAME);\r
+                },\r
+                scope: this,\r
+                timeout: this.get('dataTimeout')\r
+            }\r
+        );\r
+    };\r
+\r
+    YAHOO.widget.Tab = Tab;\r
+\r
+    /**\r
+     * Fires before the active state is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeActiveChange<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeActiveChange', handler);</code></p>\r
+     * @event beforeActiveChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the active state is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> activeChange<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('activeChange', handler);</code></p>\r
+     * @event activeChange\r
+     */\r
+\r
+    /**\r
+     * Fires before the tab label is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeLabelChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeLabelChange', handler);</code></p>\r
+     * @event beforeLabelChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the tab label is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> labelChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('labelChange', handler);</code></p>\r
+     * @event labelChange\r
+     */\r
+\r
+    /**\r
+     * Fires before the tab content is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeContentChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeContentChange', handler);</code></p>\r
+     * @event beforeContentChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the tab content is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> contentChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('contentChange', handler);</code></p>\r
+     * @event contentChange\r
+     */\r
+})();(function() {\r
+\r
+    /**\r
+     * The tabview module provides a widget for managing content bound to tabs.\r
+     * @module tabview\r
+     *\r
+     */\r
+    /**\r
+     * A widget to control tabbed views.\r
+     * @namespace YAHOO.widget\r
+     * @class TabView\r
+     * @extends YAHOO.util.Element\r
+     * @constructor\r
+     * @param {HTMLElement | String | Object} el(optional) The html\r
+     * element that represents the TabView, or the attribute object to use.\r
+     * An element will be created if none provided.\r
+     * @param {Object} attr (optional) A key map of the tabView's\r
+     * initial attributes.  Ignored if first arg is attributes object.\r
+     */\r
+    YAHOO.widget.TabView = function(el, attr) {\r
+        attr = attr || {};\r
+        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {\r
+            attr = el; // treat first arg as attr object\r
+            el = attr.element || null;\r
+        }\r
+\r
+        if (!el && !attr.element) { // create if we dont have one\r
+            el = _createTabViewElement.call(this, attr);\r
+        }\r
+       YAHOO.widget.TabView.superclass.constructor.call(this, el, attr);\r
+    };\r
+\r
+    YAHOO.extend(YAHOO.widget.TabView, YAHOO.util.Element);\r
+\r
+    var proto = YAHOO.widget.TabView.prototype;\r
+    var Dom = YAHOO.util.Dom;\r
+    var Lang = YAHOO.util.Lang;\r
+    var Event = YAHOO.util.Event;\r
+    var Tab = YAHOO.widget.Tab;\r
+\r
+\r
+    /**\r
+     * The className to add when building from scratch.\r
+     * @property CLASSNAME\r
+     * @default "navset"\r
+     */\r
+    proto.CLASSNAME = 'yui-navset';\r
+\r
+    /**\r
+     * The className of the HTMLElement containing the TabView's tab elements\r
+     * to look for when building from existing markup, or to add when building\r
+     * from scratch.\r
+     * All childNodes of the tab container are treated as Tabs when building\r
+     * from existing markup.\r
+     * @property TAB_PARENT_CLASSNAME\r
+     * @default "nav"\r
+     */\r
+    proto.TAB_PARENT_CLASSNAME = 'yui-nav';\r
+\r
+    /**\r
+     * The className of the HTMLElement containing the TabView's label elements\r
+     * to look for when building from existing markup, or to add when building\r
+     * from scratch.\r
+     * All childNodes of the content container are treated as content elements when\r
+     * building from existing markup.\r
+     * @property CONTENT_PARENT_CLASSNAME\r
+     * @default "nav-content"\r
+     */\r
+    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';\r
+\r
+    proto._tabParent = null;\r
+    proto._contentParent = null;\r
+\r
+    /**\r
+     * Adds a Tab to the TabView instance.\r
+     * If no index is specified, the tab is added to the end of the tab list.\r
+     * @method addTab\r
+     * @param {YAHOO.widget.Tab} tab A Tab instance to add.\r
+     * @param {Integer} index The position to add the tab.\r
+     * @return void\r
+     */\r
+    proto.addTab = function(tab, index) {\r
+        var tabs = this.get('tabs');\r
+        if (!tabs) { // not ready yet\r
+            this._queue[this._queue.length] = ['addTab', arguments];\r
+            return false;\r
+        }\r
+\r
+        index = (index === undefined) ? tabs.length : index;\r
+\r
+        var before = this.getTab(index);\r
+\r
+        var self = this;\r
+        var el = this.get('element');\r
+        var tabParent = this._tabParent;\r
+        var contentParent = this._contentParent;\r
+\r
+        var tabElement = tab.get('element');\r
+        var contentEl = tab.get('contentEl');\r
+\r
+        if ( before ) {\r
+            tabParent.insertBefore(tabElement, before.get('element'));\r
+        } else {\r
+            tabParent.appendChild(tabElement);\r
+        }\r
+\r
+        if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {\r
+            contentParent.appendChild(contentEl);\r
+        }\r
+\r
+        if ( !tab.get('active') ) {\r
+            tab.set('contentVisible', false, true); /* hide if not active */\r
+        } else {\r
+            this.set('activeTab', tab, true);\r
+\r
+        }\r
+\r
+        var activate = function(e) {\r
+            YAHOO.util.Event.preventDefault(e);\r
+            self.set('activeTab', this);\r
+        };\r
+\r
+        tab.addListener( tab.get('activationEvent'), activate);\r
+\r
+        tab.addListener('activationEventChange', function(e) {\r
+            if (e.prevValue != e.newValue) {\r
+                tab.removeListener(e.prevValue, activate);\r
+                tab.addListener(e.newValue, activate);\r
+            }\r
+        });\r
+\r
+        tabs.splice(index, 0, tab);\r
+    };\r
+\r
+    /**\r
+     * Routes childNode events.\r
+     * @method DOMEventHandler\r
+     * @param {event} e The Dom event that is being handled.\r
+     * @return void\r
+     */\r
+    proto.DOMEventHandler = function(e) {\r
+        var el = this.get('element');\r
+        var target = YAHOO.util.Event.getTarget(e);\r
+        var tabParent = this._tabParent;\r
+\r
+        if (Dom.isAncestor(tabParent, target) ) {\r
+            var tabEl;\r
+            var tab = null;\r
+            var contentEl;\r
+            var tabs = this.get('tabs');\r
+\r
+            for (var i = 0, len = tabs.length; i < len; i++) {\r
+                tabEl = tabs[i].get('element');\r
+                contentEl = tabs[i].get('contentEl');\r
+\r
+                if ( target == tabEl || Dom.isAncestor(tabEl, target) ) {\r
+                    tab = tabs[i];\r
+                    break; // note break\r
+                }\r
+            }\r
+\r
+            if (tab) {\r
+                tab.fireEvent(e.type, e);\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Returns the Tab instance at the specified index.\r
+     * @method getTab\r
+     * @param {Integer} index The position of the Tab.\r
+     * @return YAHOO.widget.Tab\r
+     */\r
+    proto.getTab = function(index) {\r
+       return this.get('tabs')[index];\r
+    };\r
+\r
+    /**\r
+     * Returns the index of given tab.\r
+     * @method getTabIndex\r
+     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.\r
+     * @return int\r
+     */\r
+    proto.getTabIndex = function(tab) {\r
+        var index = null;\r
+        var tabs = this.get('tabs');\r
+       for (var i = 0, len = tabs.length; i < len; ++i) {\r
+            if (tab == tabs[i]) {\r
+                index = i;\r
+                break;\r
+            }\r
+        }\r
+\r
+        return index;\r
+    };\r
+\r
+    /**\r
+     * Removes the specified Tab from the TabView.\r
+     * @method removeTab\r
+     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.\r
+     * @return void\r
+     */\r
+    proto.removeTab = function(tab) {\r
+        var tabCount = this.get('tabs').length;\r
+\r
+        var index = this.getTabIndex(tab);\r
+        var nextIndex = index + 1;\r
+        if ( tab == this.get('activeTab') ) { // select next tab\r
+            if (tabCount > 1) {\r
+                if (index + 1 == tabCount) {\r
+                    this.set('activeIndex', index - 1);\r
+                } else {\r
+                    this.set('activeIndex', index + 1);\r
+                }\r
+            }\r
+        }\r
+\r
+        this._tabParent.removeChild( tab.get('element') );\r
+        this._contentParent.removeChild( tab.get('contentEl') );\r
+        this._configs.tabs.value.splice(index, 1);\r
+\r
+    };\r
+\r
+    /**\r
+     * Provides a readable name for the TabView instance.\r
+     * @method toString\r
+     * @return String\r
+     */\r
+    proto.toString = function() {\r
+        var name = this.get('id') || this.get('tagName');\r
+        return "TabView " + name;\r
+    };\r
+\r
+    /**\r
+     * The transiton to use when switching between tabs.\r
+     * @method contentTransition\r
+     */\r
+    proto.contentTransition = function(newTab, oldTab) {\r
+        newTab.set('contentVisible', true);\r
+        oldTab.set('contentVisible', false);\r
+    };\r
+\r
+    /**\r
+     * Registers TabView specific properties.\r
+     * @method initAttributes\r
+     * @param {Object} attr Hash of initial attributes\r
+     */\r
+    proto.initAttributes = function(attr) {\r
+        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);\r
+\r
+        if (!attr.orientation) {\r
+            attr.orientation = 'top';\r
+        }\r
+\r
+        var el = this.get('element');\r
+\r
+        /**\r
+         * The Tabs belonging to the TabView instance.\r
+         * @config tabs\r
+         * @type Array\r
+         */\r
+        this.register('tabs', {\r
+            value: [],\r
+            readOnly: true\r
+        });\r
+\r
+        /**\r
+         * The container of the tabView's label elements.\r
+         * @property _tabParent\r
+         * @private\r
+         * @type HTMLElement\r
+         */\r
+        this._tabParent =\r
+                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,\r
+                        'ul' )[0] || _createTabParent.call(this);\r
+\r
+        /**\r
+         * The container of the tabView's content elements.\r
+         * @property _contentParent\r
+         * @type HTMLElement\r
+         * @private\r
+         */\r
+        this._contentParent =\r
+                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,\r
+                        'div')[0] ||  _createContentParent.call(this);\r
+\r
+        /**\r
+         * How the Tabs should be oriented relative to the TabView.\r
+         * @config orientation\r
+         * @type String\r
+         * @default "top"\r
+         */\r
+        this.register('orientation', {\r
+            value: attr.orientation,\r
+            method: function(value) {\r
+                var current = this.get('orientation');\r
+                this.addClass('yui-navset-' + value);\r
+\r
+                if (current != value) {\r
+                    this.removeClass('yui-navset-' + current);\r
+                }\r
+\r
+                switch(value) {\r
+                    case 'bottom':\r
+                    this.appendChild(this._tabParent);\r
+                    break;\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The index of the tab currently active.\r
+         * @config activeIndex\r
+         * @type Int\r
+         */\r
+        this.register('activeIndex', {\r
+            value: attr.activeIndex,\r
+            method: function(value) {\r
+                this.set('activeTab', this.getTab(value));\r
+            },\r
+            validator: function(value) {\r
+                return !this.getTab(value).get('disabled'); // cannot activate if disabled\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab currently active.\r
+         * @config activeTab\r
+         * @type YAHOO.widget.Tab\r
+         */\r
+        this.register('activeTab', {\r
+            value: attr.activeTab,\r
+            method: function(tab) {\r
+                var activeTab = this.get('activeTab');\r
+\r
+                if (tab) {\r
+                    tab.set('active', true);\r
+                }\r
+\r
+                if (activeTab && activeTab != tab) {\r
+                    activeTab.set('active', false);\r
+                }\r
+\r
+                if (activeTab && tab != activeTab) { // no transition if only 1\r
+                    this.contentTransition(tab, activeTab);\r
+                } else if (tab) {\r
+                    tab.set('contentVisible', true);\r
+                }\r
+            },\r
+            validator: function(value) {\r
+                return !value.get('disabled'); // cannot activate if disabled\r
+            }\r
+        });\r
+\r
+        if ( this._tabParent ) {\r
+            _initTabs.call(this);\r
+        }\r
+\r
+        for (var type in this.DOM_EVENTS) {\r
+            if ( this.DOM_EVENTS.hasOwnProperty(type) ) {\r
+                this.addListener.call(this, type, this.DOMEventHandler);\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Creates Tab instances from a collection of HTMLElements.\r
+     * @method createTabs\r
+     * @private\r
+     * @param {Array|HTMLCollection} elements The elements to use for Tabs.\r
+     * @return void\r
+     */\r
+    var _initTabs = function() {\r
+        var tab,\r
+            attr,\r
+            contentEl;\r
+\r
+        var el = this.get('element');\r
+        var tabs = _getChildNodes(this._tabParent);\r
+        var contentElements = _getChildNodes(this._contentParent);\r
+\r
+        for (var i = 0, len = tabs.length; i < len; ++i) {\r
+            attr = {};\r
+\r
+            if (contentElements[i]) {\r
+                attr.contentEl = contentElements[i];\r
+            }\r
+\r
+            tab = new YAHOO.widget.Tab(tabs[i], attr);\r
+            this.addTab(tab);\r
+\r
+            if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {\r
+                this._configs.activeTab.value = tab; // dont invoke method\r
+            }\r
+        }\r
+    };\r
+\r
+    var _createTabViewElement = function(attr) {\r
+        var el = document.createElement('div');\r
+\r
+        if ( this.CLASSNAME ) {\r
+            el.className = this.CLASSNAME;\r
+        }\r
+\r
+        return el;\r
+    };\r
+\r
+    var _createTabParent = function(attr) {\r
+        var el = document.createElement('ul');\r
+\r
+        if ( this.TAB_PARENT_CLASSNAME ) {\r
+            el.className = this.TAB_PARENT_CLASSNAME;\r
+        }\r
+\r
+        this.get('element').appendChild(el);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _createContentParent = function(attr) {\r
+        var el = document.createElement('div');\r
+\r
+        if ( this.CONTENT_PARENT_CLASSNAME ) {\r
+            el.className = this.CONTENT_PARENT_CLASSNAME;\r
+        }\r
+\r
+        this.get('element').appendChild(el);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _getChildNodes = function(el) {\r
+        var nodes = [];\r
+        var childNodes = el.childNodes;\r
+\r
+        for (var i = 0, len = childNodes.length; i < len; ++i) {\r
+            if (childNodes[i].nodeType == 1) {\r
+                nodes[nodes.length] = childNodes[i];\r
+            }\r
+        }\r
+\r
+        return nodes;\r
+    };\r
+\r
+/**\r
+ * Fires before the activeTab is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p>If handler returns false, the change will be cancelled, and the value will not\r
+ * be set.</p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * prevValue</code> the currently active tab<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * newValue</code> the tab to be made active</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('beforeActiveTabChange', handler);</code></p>\r
+ * @event beforeActiveTabChange\r
+ */\r
+\r
+/**\r
+ * Fires after the activeTab is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> activeTabChange<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * prevValue</code> the formerly active tab<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * newValue</code> the new active tab</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('activeTabChange', handler);</code></p>\r
+ * @event activeTabChange\r
+ */\r
+\r
+/**\r
+ * Fires before the orientation is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p>If handler returns false, the change will be cancelled, and the value will not\r
+ * be set.</p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> beforeOrientationChange<br>\r
+ * <code>&lt;String&gt;\r
+ * prevValue</code> the current orientation<br>\r
+ * <code>&lt;String&gt;\r
+ * newValue</code> the new orientation to be applied</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('beforeOrientationChange', handler);</code></p>\r
+ * @event beforeOrientationChange\r
+ */\r
+\r
+/**\r
+ * Fires after the orientation is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> orientationChange<br>\r
+ * <code>&lt;String&gt;\r
+ * prevValue</code> the former orientation<br>\r
+ * <code>&lt;String&gt;\r
+ * newValue</code> the new orientation</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('orientationChange', handler);</code></p>\r
+ * @event orientationChange\r
+ */\r
+})();
\ No newline at end of file
diff --git a/lib/yui/tabview/tabview-min.js b/lib/yui/tabview/tabview-min.js
new file mode 100755 (executable)
index 0000000..e893de7
--- /dev/null
@@ -0,0 +1 @@
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){YAHOO.util.Lang={isArray:function(val){if(val.constructor&&val.constructor.toString().indexOf('Array')>-1){return true;}else{return YAHOO.util.Lang.isObject(val)&&val.constructor==Array;}},isBoolean:function(val){return typeof val=='boolean';},isFunction:function(val){return typeof val=='function';},isNull:function(val){return val===null;},isNumber:function(val){return!isNaN(val);},isObject:function(val){return typeof val=='object'||YAHOO.util.Lang.isFunction(val);},isString:function(val){return typeof val=='string';},isUndefined:function(val){return typeof val=='undefined';}};})();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){YAHOO.log('setValue '+name+'cancelled by beforeChange event','info','Attribute');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&&map.hasOwnProperty(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){YAHOO.log(key+' not found','error','AttributeProvider');return undefined;}return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){YAHOO.log('set failed: '+key+' not found','error','AttributeProvider');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(configs.hasOwnProperty(key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}return keys;},setAttributes:function(map,silent){for(var key in map){if(map.hasOwnProperty(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._configs=this._configs||{};if(this._configs[key]){return false;}map.name=key;this._configs[key]=new YAHOO.util.Attribute(map,this);return true;},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(config.hasOwnProperty(key)){map[key]=config[key];}}return map;},configureAttribute:function(key,map,init){var configs=this._configs||{};if(!configs[key]){YAHOO.log('unable to configure, '+key+' not found','error','AttributeProvider');return false;}configs[key].configure(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,Lang=YAHOO.util.Lang,EventPublisher=YAHOO.util.EventPublisher,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){map=map||{};var element=Dom.get(map.element)||null;this.register('element',{value:element,readOnly:true});},addListener:function(type,fn,obj,scope){var el=this.get('element');var scope=scope||this;el=this.get('id')||el;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;}this.fireEvent(type,e);},obj,scope);}this.createEvent(type,this);this._events[type]=true;}this.subscribe.apply(this,arguments);},on: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){return Dom.setStyle(this.get('element'),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);before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');var newAddition=!Dom.inDocument(element);if(!element){YAHOO.log('appendTo failed: element not available','error','Element');return false;}if(!parent){YAHOO.log('appendTo failed: parent not available','error','Element');return false;}if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}YAHOO.log(element+'appended to '+parent);if(!newAddition){return false;}var keys=this.getAttributeKeys();for(var key in keys){if(!Lang.isUndefined(element[key])){this.refresh(key);}}},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!Lang.isUndefined(el.value[key])){return el.value[key];}return AttributeProvider.prototype.get.call(this,key);},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[key]=['set',arguments];return false;}if(!this._configs[key]&&!Lang.isUndefined(el[key])){_registerHTMLAttr(this,key);}return AttributeProvider.prototype.set.apply(this,arguments);},register:function(key){var configs=this._configs||{};var element=this.get('element')||null;if(element&&!Lang.isUndefined(element[key])){YAHOO.log(key+' is reserved for '+element,'error','Element');return false;}return AttributeProvider.prototype.register.apply(this,arguments);},configureAttribute:function(property,map,init){if(!this._configs[property]&&this._configs.element&&!Lang.isUndefined(this._configs.element[property])){_registerHTMLAttr(this,property,map);return false;}return AttributeProvider.prototype.configure.apply(this,arguments);},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;},init:function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true};var readyHandler=function(){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();this.fireEvent('contentReady',{type:'contentReady',target:attr.element});};if(Lang.isString(el)){_registerHTMLAttr(this,'id',{value:el});YAHOO.util.Event.onAvailable(el,function(){attr.element=Dom.get(el);this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(el,function(){readyHandler.call(this);},this,true);}else{readyHandler.call(this);}}};var _registerHTMLAttr=function(self,key,map){var el=self.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];self._configs[key]=new YAHOO.util.Attribute(map,self);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.util.Lang;Tab=function(el,attr){attr=attr||{};if(arguments.length==1&&!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){YAHOO.log('loading failed: '+o.statusText,'error','Tab');}};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.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.register('activationEvent',{value:attr.activationEvent||'click'});this.register('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.register('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.register('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.register('content',{value:attr.content,method:function(value){this.get('contentEl').innerHTML=value;}});var _dataLoaded=false;this.register('dataSrc',{value:attr.dataSrc});this.register('cacheData',{value:attr.cacheData||false,validator:Lang.isBoolean});this.register('loadMethod',{value:attr.loadMethod||'GET',validator:Lang.isString});this.register('dataLoaded',{value:false,validator:Lang.isBoolean,writeOnce:true});this.register('dataTimeout',{value:attr.dataTimeout||null,validator:Lang.isNumber});this.register('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 Lang.isBoolean(value)&&!this.get('disabled');}});this.register('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:Lang.isBoolean});this.register('href',{value:attr.href||'#',method:function(value){this.getElementsByTagName('a')[0].href=value;},validator:Lang.isString});this.register('contentVisible',{value:attr.contentVisible,method:function(value){if(value==true){this.get('contentEl').style.display='block';if(this.get('dataSrc')){if(!this.get('dataLoaded')||!this.get('cacheData')){_dataConnect.call(this);}}}else{this.get('contentEl').style.display='none';}},validator: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){YAHOO.log('YAHOO.util.Connect dependency not met','error','Tab');return false;}Dom.addClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);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);},failure:function(o){this.loadHandler.failure.call(this,o);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);},scope:this,timeout:this.get('dataTimeout')});};YAHOO.widget.Tab=Tab;})();(function(){YAHOO.widget.TabView=function(el,attr){attr=attr||{};if(arguments.length==1&&!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 Lang=YAHOO.util.Lang;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);self.set('activeTab',this);};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');this.register('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.register('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.register('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.register('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);}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);}for(var type in this.DOM_EVENTS){if(this.DOM_EVENTS.hasOwnProperty(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;}}};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;};})();
\ No newline at end of file
diff --git a/lib/yui/tabview/tabview.js b/lib/yui/tabview/tabview.js
new file mode 100755 (executable)
index 0000000..34a09bb
--- /dev/null
@@ -0,0 +1,1950 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
+(function() {\r
+\r
+    YAHOO.util.Lang = {\r
+        isArray: function(val) { // frames lose type, so test constructor string\r
+            if (val.constructor && val.constructor.toString().indexOf('Array') > -1) {\r
+                return true;\r
+            } else {\r
+                return YAHOO.util.Lang.isObject(val) && val.constructor == Array;\r
+            }\r
+        },\r
+\r
+        isBoolean: function(val) {\r
+            return typeof val == 'boolean';\r
+        },\r
+\r
+        isFunction: function(val) {\r
+            return typeof val == 'function';\r
+        },\r
+\r
+        isNull: function(val) {\r
+            return val === null;\r
+        },\r
+\r
+        isNumber: function(val) {\r
+            return !isNaN(val);\r
+        },\r
+\r
+        isObject: function(val) {\r
+            return typeof val == 'object' || YAHOO.util.Lang.isFunction(val);\r
+        },\r
+\r
+        isString: function(val) {\r
+            return typeof val == 'string';\r
+        },\r
+\r
+        isUndefined: function(val) {\r
+            return typeof val == 'undefined';\r
+        }\r
+    };\r
+})();/**\r
+ * Provides Attribute configurations.\r
+ * @namespace YAHOO.util\r
+ * @class Attribute\r
+ * @constructor\r
+ * @param hash {Object} The intial Attribute.\r
+ * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.\r
+ */\r
+\r
+YAHOO.util.Attribute = function(hash, owner) {\r
+    if (owner) {\r
+        this.owner = owner;\r
+        this.configure(hash, true);\r
+    }\r
+};\r
+\r
+YAHOO.util.Attribute.prototype = {\r
+       /**\r
+     * The name of the attribute.\r
+        * @property name\r
+        * @type String\r
+        */\r
+    name: undefined,\r
+\r
+       /**\r
+     * The value of the attribute.\r
+        * @property value\r
+        * @type String\r
+        */\r
+    value: null,\r
+\r
+       /**\r
+     * The owner of the attribute.\r
+        * @property owner\r
+        * @type YAHOO.util.AttributeProvider\r
+        */\r
+    owner: null,\r
+\r
+       /**\r
+     * Whether or not the attribute is read only.\r
+        * @property readOnly\r
+        * @type Boolean\r
+        */\r
+    readOnly: false,\r
+\r
+       /**\r
+     * Whether or not the attribute can only be written once.\r
+        * @property writeOnce\r
+        * @type Boolean\r
+        */\r
+    writeOnce: false,\r
+\r
+       /**\r
+     * The attribute's initial configuration.\r
+     * @private\r
+        * @property _initialConfig\r
+        * @type Object\r
+        */\r
+    _initialConfig: null,\r
+\r
+       /**\r
+     * Whether or not the attribute's value has been set.\r
+     * @private\r
+        * @property _written\r
+        * @type Boolean\r
+        */\r
+    _written: false,\r
+\r
+       /**\r
+     * The method to use when setting the attribute's value.\r
+     * The method recieves the new value as the only argument.\r
+        * @property method\r
+        * @type Function\r
+        */\r
+    method: null,\r
+\r
+       /**\r
+     * The validator to use when setting the attribute's value.\r
+        * @property validator\r
+        * @type Function\r
+     * @return Boolean\r
+        */\r
+    validator: null,\r
+\r
+    /**\r
+     * Retrieves the current value of the attribute.\r
+     * @method getValue\r
+     * @return {any} The current value of the attribute.\r
+     */\r
+    getValue: function() {\r
+        return this.value;\r
+    },\r
+\r
+    /**\r
+     * Sets the value of the attribute and fires beforeChange and change events.\r
+     * @method setValue\r
+     * @param {Any} value The value to apply to the attribute.\r
+     * @param {Boolean} silent If true the change events will not be fired.\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    setValue: function(value, silent) {\r
+        var beforeRetVal;\r
+        var owner = this.owner;\r
+        var name = this.name;\r
+\r
+        var event = {\r
+            type: name,\r
+            prevValue: this.getValue(),\r
+            newValue: value\r
+        };\r
+\r
+        if (this.readOnly || ( this.writeOnce && this._written) ) {\r
+            return false; // write not allowed\r
+        }\r
+\r
+        if (this.validator && !this.validator.call(owner, value) ) {\r
+            return false; // invalid value\r
+        }\r
+\r
+        if (!silent) {\r
+            beforeRetVal = owner.fireBeforeChangeEvent(event);\r
+            if (beforeRetVal === false) {\r
+                YAHOO.log('setValue ' + name +\r
+                        'cancelled by beforeChange event', 'info', 'Attribute');\r
+                return false;\r
+            }\r
+        }\r
+\r
+        if (this.method) {\r
+            this.method.call(owner, value);\r
+        }\r
+\r
+        this.value = value;\r
+        this._written = true;\r
+\r
+        event.type = name;\r
+\r
+        if (!silent) {\r
+            this.owner.fireChangeEvent(event);\r
+        }\r
+\r
+        return true;\r
+    },\r
+\r
+    /**\r
+     * Allows for configuring the Attribute's properties.\r
+     * @method configure\r
+     * @param {Object} map A key-value map of Attribute properties.\r
+     * @param {Boolean} init Whether or not this should become the initial config.\r
+     */\r
+    configure: function(map, init) {\r
+        map = map || {};\r
+        this._written = false; // reset writeOnce\r
+        this._initialConfig = this._initialConfig || {};\r
+\r
+        for (var key in map) {\r
+            if ( key && map.hasOwnProperty(key) ) {\r
+                this[key] = map[key];\r
+                if (init) {\r
+                    this._initialConfig[key] = map[key];\r
+                }\r
+            }\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Resets the value to the initial config value.\r
+     * @method resetValue\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    resetValue: function() {\r
+        return this.setValue(this._initialConfig.value);\r
+    },\r
+\r
+    /**\r
+     * Resets the attribute config to the initial config state.\r
+     * @method resetConfig\r
+     */\r
+    resetConfig: function() {\r
+        this.configure(this._initialConfig);\r
+    },\r
+\r
+    /**\r
+     * Resets the value to the current value.\r
+     * Useful when values may have gotten out of sync with actual properties.\r
+     * @method refresh\r
+     * @return {Boolean} Whether or not the value was set.\r
+     */\r
+    refresh: function(silent) {\r
+        this.setValue(this.value, silent);\r
+    }\r
+};(function() {\r
+    var Lang = YAHOO.util.Lang;\r
+\r
+    /*\r
+    Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+    Code licensed under the BSD License:\r
+    http://developer.yahoo.net/yui/license.txt\r
+    */\r
+\r
+    /**\r
+     * Provides and manages YAHOO.util.Attribute instances\r
+     * @namespace YAHOO.util\r
+     * @class AttributeProvider\r
+     * @uses YAHOO.util.EventProvider\r
+     */\r
+    YAHOO.util.AttributeProvider = function() {};\r
+\r
+    YAHOO.util.AttributeProvider.prototype = {\r
+\r
+        /**\r
+         * A key-value map of Attribute configurations\r
+         * @property _configs\r
+         * @protected (may be used by subclasses and augmentors)\r
+         * @private\r
+         * @type {Object}\r
+         */\r
+        _configs: null,\r
+        /**\r
+         * Returns the current value of the attribute.\r
+         * @method get\r
+         * @param {String} key The attribute whose value will be returned.\r
+         */\r
+        get: function(key){\r
+            var configs = this._configs || {};\r
+            var config = configs[key];\r
+\r
+            if (!config) {\r
+                YAHOO.log(key + ' not found', 'error', 'AttributeProvider');\r
+                return undefined;\r
+            }\r
+\r
+            return config.value;\r
+        },\r
+\r
+        /**\r
+         * Sets the value of a config.\r
+         * @method set\r
+         * @param {String} key The name of the attribute\r
+         * @param {Any} value The value to apply to the attribute\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         * @return {Boolean} Whether or not the value was set.\r
+         */\r
+        set: function(key, value, silent){\r
+            var configs = this._configs || {};\r
+            var config = configs[key];\r
+\r
+            if (!config) {\r
+                YAHOO.log('set failed: ' + key + ' not found',\r
+                        'error', 'AttributeProvider');\r
+                return false;\r
+            }\r
+\r
+            return config.setValue(value, silent);\r
+        },\r
+\r
+        /**\r
+         * Returns an array of attribute names.\r
+         * @method getAttributeKeys\r
+         * @return {Array} An array of attribute names.\r
+         */\r
+        getAttributeKeys: function(){\r
+            var configs = this._configs;\r
+            var keys = [];\r
+            var config;\r
+            for (var key in configs) {\r
+                config = configs[key];\r
+                if ( configs.hasOwnProperty(key) &&\r
+                        !Lang.isUndefined(config) ) {\r
+                    keys[keys.length] = key;\r
+                }\r
+            }\r
+\r
+            return keys;\r
+        },\r
+\r
+        /**\r
+         * Sets multiple attribute values.\r
+         * @method setAttributes\r
+         * @param {Object} map  A key-value map of attributes\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         */\r
+        setAttributes: function(map, silent){\r
+            for (var key in map) {\r
+                if ( map.hasOwnProperty(key) ) {\r
+                    this.set(key, map[key], silent);\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Resets the specified attribute's value to its initial value.\r
+         * @method resetValue\r
+         * @param {String} key The name of the attribute\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         * @return {Boolean} Whether or not the value was set\r
+         */\r
+        resetValue: function(key, silent){\r
+            var configs = this._configs || {};\r
+            if (configs[key]) {\r
+                this.set(key, configs[key]._initialConfig.value, silent);\r
+                return true;\r
+            }\r
+            return false;\r
+        },\r
+\r
+        /**\r
+         * Sets the attribute's value to its current value.\r
+         * @method refresh\r
+         * @param {String | Array} key The attribute(s) to refresh\r
+         * @param {Boolean} silent Whether or not to suppress change events\r
+         */\r
+        refresh: function(key, silent){\r
+            var configs = this._configs;\r
+\r
+            key = ( ( Lang.isString(key) ) ? [key] : key ) ||\r
+                    this.getAttributeKeys();\r
+\r
+            for (var i = 0, len = key.length; i < len; ++i) {\r
+                if ( // only set if there is a value and not null\r
+                    configs[key[i]] &&\r
+                    ! Lang.isUndefined(configs[key[i]].value) &&\r
+                    ! Lang.isNull(configs[key[i]].value) ) {\r
+                    configs[key[i]].refresh(silent);\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Adds an Attribute to the AttributeProvider instance.\r
+         * @method register\r
+         * @param {String} key The attribute's name\r
+         * @param {Object} map A key-value map containing the\r
+         * attribute's properties.\r
+         */\r
+        register: function(key, map) {\r
+            this._configs = this._configs || {};\r
+\r
+            if (this._configs[key]) { // dont override\r
+                return false;\r
+            }\r
+\r
+            map.name = key;\r
+            this._configs[key] = new YAHOO.util.Attribute(map, this);\r
+            return true;\r
+        },\r
+\r
+        /**\r
+         * Returns the attribute's properties.\r
+         * @method getAttributeConfig\r
+         * @param {String} key The attribute's name\r
+         * @private\r
+         * @return {object} A key-value map containing all of the\r
+         * attribute's properties.\r
+         */\r
+        getAttributeConfig: function(key) {\r
+            var configs = this._configs || {};\r
+            var config = configs[key] || {};\r
+            var map = {}; // returning a copy to prevent overrides\r
+\r
+            for (key in config) {\r
+                if ( config.hasOwnProperty(key) ) {\r
+                    map[key] = config[key];\r
+                }\r
+            }\r
+\r
+            return map;\r
+        },\r
+\r
+        /**\r
+         * Sets or updates an Attribute instance's properties.\r
+         * @method configureAttribute\r
+         * @param {String} key The attribute's name.\r
+         * @param {Object} map A key-value map of attribute properties\r
+         * @param {Boolean} init Whether or not this should become the intial config.\r
+         */\r
+        configureAttribute: function(key, map, init) {\r
+            var configs = this._configs || {};\r
+\r
+            if (!configs[key]) {\r
+                YAHOO.log('unable to configure, ' + key + ' not found',\r
+                        'error', 'AttributeProvider');\r
+                return false;\r
+            }\r
+\r
+            configs[key].configure(map, init);\r
+        },\r
+\r
+        /**\r
+         * Resets an attribute to its intial configuration.\r
+         * @method resetAttributeConfig\r
+         * @param {String} key The attribute's name.\r
+         * @private\r
+         */\r
+        resetAttributeConfig: function(key){\r
+            var configs = this._configs || {};\r
+            configs[key].resetConfig();\r
+        },\r
+\r
+        /**\r
+         * Fires the attribute's beforeChange event.\r
+         * @method fireBeforeChangeEvent\r
+         * @param {String} key The attribute's name.\r
+         * @param {Obj} e The event object to pass to handlers.\r
+         */\r
+        fireBeforeChangeEvent: function(e) {\r
+            var type = 'before';\r
+            type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change';\r
+            e.type = type;\r
+            return this.fireEvent(e.type, e);\r
+        },\r
+\r
+        /**\r
+         * Fires the attribute's change event.\r
+         * @method fireChangeEvent\r
+         * @param {String} key The attribute's name.\r
+         * @param {Obj} e The event object to pass to the handlers.\r
+         */\r
+        fireChangeEvent: function(e) {\r
+            e.type += 'Change';\r
+            return this.fireEvent(e.type, e);\r
+        }\r
+    };\r
+\r
+    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);\r
+})();(function() {\r
+// internal shorthand\r
+var Dom = YAHOO.util.Dom,\r
+    Lang = YAHOO.util.Lang,\r
+    EventPublisher = YAHOO.util.EventPublisher,\r
+    AttributeProvider = YAHOO.util.AttributeProvider;\r
+\r
+/**\r
+ * Element provides an interface to an HTMLElement's attributes and common\r
+ * methods.  Other commonly used attributes are added as well.\r
+ * @namespace YAHOO.util\r
+ * @class Element\r
+ * @uses YAHOO.util.AttributeProvider\r
+ * @constructor\r
+ * @param el {HTMLElement | String} The html element that\r
+ * represents the Element.\r
+ * @param {Object} map A key-value map of initial config names and values\r
+ */\r
+YAHOO.util.Element = function(el, map) {\r
+    if (arguments.length) {\r
+        this.init(el, map);\r
+    }\r
+};\r
+\r
+YAHOO.util.Element.prototype = {\r
+       /**\r
+     * Dom events supported by the Element instance.\r
+        * @property DOM_EVENTS\r
+        * @type Object\r
+        */\r
+    DOM_EVENTS: null,\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method appendChild\r
+        * @param {Boolean} deep Whether or not to do a deep clone\r
+        */\r
+    appendChild: function(child) {\r
+        child = child.get ? child.get('element') : child;\r
+        this.get('element').appendChild(child);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method getElementsByTagName\r
+        * @param {String} tag The tagName to collect\r
+        */\r
+    getElementsByTagName: function(tag) {\r
+        return this.get('element').getElementsByTagName(tag);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method hasChildNodes\r
+        * @return {Boolean} Whether or not the element has childNodes\r
+        */\r
+    hasChildNodes: function() {\r
+        return this.get('element').hasChildNodes();\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method insertBefore\r
+        * @param {HTMLElement} element The HTMLElement to insert\r
+        * @param {HTMLElement} before The HTMLElement to insert\r
+     * the element before.\r
+        */\r
+    insertBefore: function(element, before) {\r
+        element = element.get ? element.get('element') : element;\r
+        before = (before && before.get) ? before.get('element') : before;\r
+\r
+        this.get('element').insertBefore(element, before);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method removeChild\r
+        * @param {HTMLElement} child The HTMLElement to remove\r
+        */\r
+    removeChild: function(child) {\r
+        child = child.get ? child.get('element') : child;\r
+        this.get('element').removeChild(child);\r
+        return true;\r
+    },\r
+\r
+       /**\r
+     * Wrapper for HTMLElement method.\r
+        * @method replaceChild\r
+        * @param {HTMLElement} newNode The HTMLElement to insert\r
+        * @param {HTMLElement} oldNode The HTMLElement to replace\r
+        */\r
+    replaceChild: function(newNode, oldNode) {\r
+        newNode = newNode.get ? newNode.get('element') : newNode;\r
+        oldNode = oldNode.get ? oldNode.get('element') : oldNode;\r
+        return this.get('element').replaceChild(newNode, oldNode);\r
+    },\r
+\r
+\r
+    /**\r
+     * Registers Element specific attributes.\r
+     * @method initAttributes\r
+     * @param {Object} map A key-value map of initial attribute configs\r
+     */\r
+    initAttributes: function(map) {\r
+        map = map || {};\r
+        var element = Dom.get(map.element) || null;\r
+\r
+        /**\r
+         * The HTMLElement the Element instance refers to.\r
+         * @config element\r
+         * @type HTMLElement\r
+         */\r
+        this.register('element', {\r
+            value: element,\r
+            readOnly: true\r
+         });\r
+    },\r
+\r
+    /**\r
+     * Adds a listener for the given event.  These may be DOM or\r
+     * customEvent listeners.  Any event that is fired via fireEvent\r
+     * can be listened for.  All handlers receive an event object.\r
+     * @method addListener\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The handler to call when the event fires\r
+     * @param {Any} obj A variable to pass to the handler\r
+     * @param {Object} scope The object to use for the scope of the handler\r
+     */\r
+    addListener: function(type, fn, obj, scope) {\r
+        var el = this.get('element');\r
+        var scope = scope || this;\r
+\r
+        el = this.get('id') || el;\r
+\r
+        if (!this._events[type]) { // create on the fly\r
+            if ( this.DOM_EVENTS[type] ) {\r
+                YAHOO.util.Event.addListener(el, type, function(e) {\r
+                    if (e.srcElement && !e.target) { // supplement IE with target\r
+                        e.target = e.srcElement;\r
+                    }\r
+                    this.fireEvent(type, e);\r
+                }, obj, scope);\r
+            }\r
+\r
+            this.createEvent(type, this);\r
+            this._events[type] = true;\r
+        }\r
+\r
+        this.subscribe.apply(this, arguments); // notify via customEvent\r
+    },\r
+\r
+\r
+    /**\r
+     * Alias for addListener\r
+     * @method on\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The function call when the event fires\r
+     * @param {Any} obj A variable to pass to the handler\r
+     * @param {Object} scope The object to use for the scope of the handler\r
+     */\r
+    on: function() { this.addListener.apply(this, arguments); },\r
+\r
+\r
+    /**\r
+     * Remove an event listener\r
+     * @method removeListener\r
+     * @param {String} type The name of the event to listen for\r
+     * @param {Function} fn The function call when the event fires\r
+     */\r
+    removeListener: function(type, fn) {\r
+        this.unsubscribe.apply(this, arguments);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method addClass\r
+        * @param {String} className The className to add\r
+        */\r
+    addClass: function(className) {\r
+        Dom.addClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method getElementsByClassName\r
+        * @param {String} className The className to collect\r
+        * @param {String} tag (optional) The tag to use in\r
+     * conjunction with class name\r
+     * @return {Array} Array of HTMLElements\r
+        */\r
+    getElementsByClassName: function(className, tag) {\r
+        return Dom.getElementsByClassName(className, tag,\r
+                this.get('element') );\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method hasClass\r
+        * @param {String} className The className to add\r
+     * @return {Boolean} Whether or not the element has the class name\r
+        */\r
+    hasClass: function(className) {\r
+        return Dom.hasClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method removeClass\r
+        * @param {String} className The className to remove\r
+        */\r
+    removeClass: function(className) {\r
+        return Dom.removeClass(this.get('element'), className);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method replaceClass\r
+        * @param {String} oldClassName The className to replace\r
+        * @param {String} newClassName The className to add\r
+        */\r
+    replaceClass: function(oldClassName, newClassName) {\r
+        return Dom.replaceClass(this.get('element'),\r
+                oldClassName, newClassName);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method setStyle\r
+        * @param {String} property The style property to set\r
+        * @param {String} value The value to apply to the style property\r
+        */\r
+    setStyle: function(property, value) {\r
+        return Dom.setStyle(this.get('element'),  property, value);\r
+    },\r
+\r
+       /**\r
+     * Wrapper for Dom method.\r
+        * @method getStyle\r
+        * @param {String} property The style property to retrieve\r
+        * @return {String} The current value of the property\r
+        */\r
+    getStyle: function(property) {\r
+        return Dom.getStyle(this.get('element'),  property);\r
+    },\r
+\r
+       /**\r
+     * Apply any queued set calls.\r
+        * @method fireQueue\r
+        */\r
+    fireQueue: function() {\r
+        var queue = this._queue;\r
+        for (var i = 0, len = queue.length; i < len; ++i) {\r
+            this[queue[i][0]].apply(this, queue[i][1]);\r
+        }\r
+    },\r
+\r
+       /**\r
+     * Appends the HTMLElement into either the supplied parentNode.\r
+        * @method appendTo\r
+        * @param {HTMLElement | Element} parentNode The node to append to\r
+        * @param {HTMLElement | Element} before An optional node to insert before\r
+        */\r
+    appendTo: function(parent, before) {\r
+        parent = (parent.get) ?  parent.get('element') : Dom.get(parent);\r
+\r
+        before = (before && before.get) ?\r
+                before.get('element') : Dom.get(before);\r
+        var element = this.get('element');\r
+\r
+        var newAddition =  !Dom.inDocument(element);\r
+\r
+        if (!element) {\r
+            YAHOO.log('appendTo failed: element not available',\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        if (!parent) {\r
+            YAHOO.log('appendTo failed: parent not available',\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        if (element.parent != parent) {\r
+            if (before) {\r
+                parent.insertBefore(element, before);\r
+            } else {\r
+                parent.appendChild(element);\r
+            }\r
+        }\r
+\r
+        YAHOO.log(element + 'appended to ' + parent);\r
+\r
+        if (!newAddition) {\r
+            return false; // note return; no refresh if in document\r
+        }\r
+\r
+        // if a new addition, refresh HTMLElement any applied attributes\r
+        var keys = this.getAttributeKeys();\r
+\r
+        for (var key in keys) { // only refresh HTMLElement attributes\r
+            if ( !Lang.isUndefined(element[key]) ) {\r
+                this.refresh(key);\r
+            }\r
+        }\r
+    },\r
+\r
+    get: function(key) {\r
+        var configs = this._configs || {};\r
+        var el = configs.element; // avoid loop due to 'element'\r
+        if (el && !configs[key] && !Lang.isUndefined(el.value[key]) ) {\r
+            return el.value[key];\r
+        }\r
+\r
+        return AttributeProvider.prototype.get.call(this, key);\r
+    },\r
+\r
+    set: function(key, value, silent) {\r
+        var el = this.get('element');\r
+        if (!el) {\r
+            this._queue[key] = ['set', arguments];\r
+            return false;\r
+        }\r
+\r
+        // set it on the element if not a property\r
+        if ( !this._configs[key] && !Lang.isUndefined(el[key]) ) {\r
+            _registerHTMLAttr(this, key);\r
+        }\r
+\r
+        return AttributeProvider.prototype.set.apply(this, arguments);\r
+    },\r
+\r
+    register: function(key) { // protect html attributes\r
+        var configs = this._configs || {};\r
+        var element = this.get('element') || null;\r
+\r
+        if ( element && !Lang.isUndefined(element[key]) ) {\r
+            YAHOO.log(key + ' is reserved for ' + element,\r
+                    'error', 'Element');\r
+            return false;\r
+        }\r
+\r
+        return AttributeProvider.prototype.register.apply(this, arguments);\r
+    },\r
+\r
+    configureAttribute: function(property, map, init) { // protect html attributes\r
+        if (!this._configs[property] && this._configs.element &&\r
+                !Lang.isUndefined(this._configs.element[property]) ) {\r
+            _registerHTMLAttr(this, property, map);\r
+            return false;\r
+        }\r
+\r
+        return AttributeProvider.prototype.configure.apply(this, arguments);\r
+    },\r
+\r
+    getAttributeKeys: function() {\r
+        var el = this.get('element');\r
+        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);\r
+\r
+        //add any unconfigured element keys\r
+        for (var key in el) {\r
+            if (!this._configs[key]) {\r
+                keys[key] = keys[key] || el[key];\r
+            }\r
+        }\r
+\r
+        return keys;\r
+    },\r
+\r
+    init: function(el, attr) {\r
+        this._queue = this._queue || [];\r
+        this._events = this._events || {};\r
+        this._configs = this._configs || {};\r
+        attr = attr || {};\r
+        attr.element = attr.element || el || null;\r
+\r
+        this.DOM_EVENTS = {\r
+            'click': true,\r
+            'keydown': true,\r
+            'keypress': true,\r
+            'keyup': true,\r
+            'mousedown': true,\r
+            'mousemove': true,\r
+            'mouseout': true,\r
+            'mouseover': true,\r
+            'mouseup': true\r
+        };\r
+\r
+        var readyHandler = function() {\r
+            this.initAttributes(attr);\r
+\r
+            this.setAttributes(attr, true);\r
+            this.fireQueue();\r
+            this.fireEvent('contentReady', {\r
+                type: 'contentReady',\r
+                target: attr.element\r
+            });\r
+        };\r
+\r
+        if ( Lang.isString(el) ) {\r
+            _registerHTMLAttr(this, 'id', { value: el });\r
+            YAHOO.util.Event.onAvailable(el, function() {\r
+                attr.element = Dom.get(el);\r
+                this.fireEvent('available', {\r
+                    type: 'available',\r
+                    target: attr.element\r
+                });\r
+            }, this, true);\r
+\r
+            YAHOO.util.Event.onContentReady(el, function() {\r
+                readyHandler.call(this);\r
+            }, this, true);\r
+        } else {\r
+            readyHandler.call(this);\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Sets the value of the property and fires beforeChange and change events.\r
+ * @private\r
+ * @method _registerHTMLAttr\r
+ * @param {YAHOO.util.Element} element The Element instance to\r
+ * register the config to.\r
+ * @param {String} key The name of the config to register\r
+ * @param {Object} map A key-value map of the config's params\r
+ */\r
+var _registerHTMLAttr = function(self, key, map) {\r
+    var el = self.get('element');\r
+    map = map || {};\r
+    map.name = key;\r
+    map.method = map.method || function(value) {\r
+        el[key] = value;\r
+    };\r
+    map.value = map.value || el[key];\r
+    self._configs[key] = new YAHOO.util.Attribute(map, self);\r
+};\r
+\r
+/**\r
+ * Fires when the Element's HTMLElement can be retrieved by Id.\r
+ * <p>See: <a href="#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> available<br>\r
+ * <code>&lt;HTMLElement&gt;\r
+ * target</code> the HTMLElement bound to this Element instance<br>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var target = e.target};<br>\r
+ * myTabs.addListener('available', handler);</code></p>\r
+ * @event available\r
+ */\r
+\r
+/**\r
+ * Fires when the Element's HTMLElement subtree is rendered.\r
+ * <p>See: <a href="#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> contentReady<br>\r
+ * <code>&lt;HTMLElement&gt;\r
+ * target</code> the HTMLElement bound to this Element instance<br>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var target = e.target};<br>\r
+ * myTabs.addListener('contentReady', handler);</code></p>\r
+ * @event contentReady\r
+ */\r
+\r
+YAHOO.augment(YAHOO.util.Element, AttributeProvider);\r
+})();(function() {\r
+    var Dom = YAHOO.util.Dom,\r
+        Event = YAHOO.util.Event,\r
+        Lang = YAHOO.util.Lang;\r
+\r
+    /**\r
+     * A representation of a Tab's label and content.\r
+     * @namespace YAHOO.widget\r
+     * @class Tab\r
+     * @extends YAHOO.util.Element\r
+     * @constructor\r
+     * @param element {HTMLElement | String} (optional) The html element that\r
+     * represents the TabView. An element will be created if none provided.\r
+     * @param {Object} properties A key map of initial properties\r
+     */\r
+    Tab = function(el, attr) {\r
+        attr = attr || {};\r
+        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {\r
+            attr = el;\r
+            el = attr.element;\r
+        }\r
+\r
+        if (!el && !attr.element) {\r
+            el = _createTabElement.call(this, attr);\r
+        }\r
+\r
+        this.loadHandler =  {\r
+            success: function(o) {\r
+                this.set('content', o.responseText);\r
+            },\r
+            failure: function(o) {\r
+                YAHOO.log('loading failed: ' + o.statusText,\r
+                        'error', 'Tab');\r
+            }\r
+        };\r
+\r
+        Tab.superclass.constructor.call(this, el, attr);\r
+\r
+        this.DOM_EVENTS = {}; // delegating to tabView\r
+    };\r
+\r
+    YAHOO.extend(Tab, YAHOO.util.Element);\r
+    var proto = Tab.prototype;\r
+\r
+    /**\r
+     * The default tag name for a Tab's inner element.\r
+     * @property LABEL_INNER_TAGNAME\r
+     * @type String\r
+     * @default "em"\r
+     */\r
+    proto.LABEL_TAGNAME = 'em';\r
+\r
+    /**\r
+     * The class name applied to active tabs.\r
+     * @property ACTIVE_CLASSNAME\r
+     * @type String\r
+     * @default "on"\r
+     */\r
+    proto.ACTIVE_CLASSNAME = 'selected';\r
+\r
+    /**\r
+     * The class name applied to disabled tabs.\r
+     * @property DISABLED_CLASSNAME\r
+     * @type String\r
+     * @default "disabled"\r
+     */\r
+    proto.DISABLED_CLASSNAME = 'disabled';\r
+\r
+    /**\r
+     * The class name applied to dynamic tabs while loading.\r
+     * @property LOADING_CLASSNAME\r
+     * @type String\r
+     * @default "disabled"\r
+     */\r
+    proto.LOADING_CLASSNAME = 'loading';\r
+\r
+    /**\r
+     * Provides a reference to the connection request object when data is\r
+     * loaded dynamically.\r
+     * @property dataConnection\r
+     * @type Object\r
+     */\r
+    proto.dataConnection = null;\r
+\r
+    /**\r
+     * Object containing success and failure callbacks for loading data.\r
+     * @property loadHandler\r
+     * @type object\r
+     */\r
+    proto.loadHandler = null;\r
+\r
+    /**\r
+     * Provides a readable name for the tab.\r
+     * @method toString\r
+     * @return String\r
+     */\r
+    proto.toString = function() {\r
+        var el = this.get('element');\r
+        var id = el.id || el.tagName;\r
+        return "Tab " + id;\r
+    };\r
+\r
+    /**\r
+     * Registers TabView specific properties.\r
+     * @method initAttributes\r
+     * @param {Object} attr Hash of initial attributes\r
+     */\r
+    proto.initAttributes = function(attr) {\r
+        attr = attr || {};\r
+        Tab.superclass.initAttributes.call(this, attr);\r
+\r
+        var el = this.get('element');\r
+\r
+        /**\r
+         * The event that triggers the tab's activation.\r
+         * @config activationEvent\r
+         * @type String\r
+         */\r
+        this.register('activationEvent', {\r
+            value: attr.activationEvent || 'click'\r
+        });\r
+\r
+        /**\r
+         * The element that contains the tab's label.\r
+         * @config labelEl\r
+         * @type HTMLElement\r
+         */\r
+        this.register('labelEl', {\r
+            value: attr.labelEl || _getlabelEl.call(this),\r
+            method: function(value) {\r
+                var current = this.get('labelEl');\r
+\r
+                if (current) {\r
+                    if (current == value) {\r
+                        return false; // already set\r
+                    }\r
+\r
+                    this.replaceChild(value, current);\r
+                } else if (el.firstChild) { // ensure label is firstChild by default\r
+                    this.insertBefore(value, el.firstChild);\r
+                } else {\r
+                    this.appendChild(value);\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab's label text (or innerHTML).\r
+         * @config label\r
+         * @type String\r
+         */\r
+        this.register('label', {\r
+            value: attr.label || _getLabel.call(this),\r
+            method: function(value) {\r
+                var labelEl = this.get('labelEl');\r
+                if (!labelEl) { // create if needed\r
+                    this.set('labelEl', _createlabelEl.call(this));\r
+                }\r
+\r
+                _setLabel.call(this, value);\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The HTMLElement that contains the tab's content.\r
+         * @config contentEl\r
+         * @type HTMLElement\r
+         */\r
+        this.register('contentEl', { // TODO: apply className?\r
+            value: attr.contentEl || document.createElement('div'),\r
+            method: function(value) {\r
+                var current = this.get('contentEl');\r
+\r
+                if (current) {\r
+                    if (current == value) {\r
+                        return false; // already set\r
+                    }\r
+                    this.replaceChild(value, current);\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab's content.\r
+         * @config content\r
+         * @type String\r
+         */\r
+        this.register('content', {\r
+            value: attr.content, // TODO: what about existing?\r
+            method: function(value) {\r
+                this.get('contentEl').innerHTML = value;\r
+            }\r
+        });\r
+\r
+        var _dataLoaded = false;\r
+\r
+        /**\r
+         * The tab's data source, used for loading content dynamically.\r
+         * @config dataSrc\r
+         * @type String\r
+         */\r
+        this.register('dataSrc', {\r
+            value: attr.dataSrc\r
+        });\r
+\r
+        /**\r
+         * Whether or not content should be reloaded for every view.\r
+         * @config cacheData\r
+         * @type Boolean\r
+         * @default false\r
+         */\r
+        this.register('cacheData', {\r
+            value: attr.cacheData || false,\r
+            validator: Lang.isBoolean\r
+        });\r
+\r
+        /**\r
+         * The method to use for the data request.\r
+         * @config loadMethod\r
+         * @type String\r
+         * @default "GET"\r
+         */\r
+        this.register('loadMethod', {\r
+            value: attr.loadMethod || 'GET',\r
+            validator: Lang.isString\r
+        });\r
+\r
+        /**\r
+         * Whether or not any data has been loaded from the server.\r
+         * @config dataLoaded\r
+         * @type Boolean\r
+         */\r
+        this.register('dataLoaded', {\r
+            value: false,\r
+            validator: Lang.isBoolean,\r
+            writeOnce: true\r
+        });\r
+\r
+        /**\r
+         * Number if milliseconds before aborting and calling failure handler.\r
+         * @config dataTimeout\r
+         * @type Number\r
+         * @default null\r
+         */\r
+        this.register('dataTimeout', {\r
+            value: attr.dataTimeout || null,\r
+            validator: Lang.isNumber\r
+        });\r
+\r
+        /**\r
+         * Whether or not the tab is currently active.\r
+         * If a dataSrc is set for the tab, the content will be loaded from\r
+         * the given source.\r
+         * @config active\r
+         * @type Boolean\r
+         */\r
+        this.register('active', {\r
+            value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME),\r
+            method: function(value) {\r
+                if (value === true) {\r
+                    this.addClass(this.ACTIVE_CLASSNAME);\r
+                    this.set('title', 'active');\r
+                } else {\r
+                    this.removeClass(this.ACTIVE_CLASSNAME);\r
+                    this.set('title', '');\r
+                }\r
+            },\r
+            validator: function(value) {\r
+                return Lang.isBoolean(value) && !this.get('disabled') ;\r
+            }\r
+        });\r
+\r
+        /**\r
+         * Whether or not the tab is disabled.\r
+         * @config disabled\r
+         * @type Boolean\r
+         */\r
+        this.register('disabled', {\r
+            value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME),\r
+            method: function(value) {\r
+                if (value === true) {\r
+                    Dom.addClass(this.get('element'), this.DISABLED_CLASSNAME);\r
+                } else {\r
+                    Dom.removeClass(this.get('element'), this.DISABLED_CLASSNAME);\r
+                }\r
+            },\r
+            validator: Lang.isBoolean\r
+        });\r
+\r
+        /**\r
+         * The href of the tab's anchor element.\r
+         * @config href\r
+         * @type String\r
+         * @default '#'\r
+         */\r
+        this.register('href', {\r
+            value: attr.href || '#',\r
+            method: function(value) {\r
+                this.getElementsByTagName('a')[0].href = value;\r
+            },\r
+            validator: Lang.isString\r
+        });\r
+\r
+        /**\r
+         * The Whether or not the tab's content is visible.\r
+         * @config contentVisible\r
+         * @type Boolean\r
+         * @default false\r
+         */\r
+        this.register('contentVisible', {\r
+            value: attr.contentVisible,\r
+            method: function(value) {\r
+                if (value == true) {\r
+                    this.get('contentEl').style.display = 'block';\r
+\r
+                    if ( this.get('dataSrc') ) {\r
+                     // load dynamic content unless already loaded and caching\r
+                        if ( !this.get('dataLoaded') || !this.get('cacheData') ) {\r
+                            _dataConnect.call(this);\r
+                        }\r
+                    }\r
+                } else {\r
+                    this.get('contentEl').style.display = 'none';\r
+                }\r
+            },\r
+            validator: Lang.isBoolean\r
+        });\r
+    };\r
+\r
+    var _createTabElement = function(attr) {\r
+        var el = document.createElement('li');\r
+        var a = document.createElement('a');\r
+\r
+        a.href = attr.href || '#';\r
+\r
+        el.appendChild(a);\r
+\r
+        var label = attr.label || null;\r
+        var labelEl = attr.labelEl || null;\r
+\r
+        if (labelEl) { // user supplied labelEl\r
+            if (!label) { // user supplied label\r
+                label = _getLabel.call(this, labelEl);\r
+            }\r
+        } else {\r
+            labelEl = _createlabelEl.call(this);\r
+        }\r
+\r
+        a.appendChild(labelEl);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _getlabelEl = function() {\r
+        return this.getElementsByTagName(this.LABEL_TAGNAME)[0];\r
+    };\r
+\r
+    var _createlabelEl = function() {\r
+        var el = document.createElement(this.LABEL_TAGNAME);\r
+        return el;\r
+    };\r
+\r
+    var _setLabel = function(label) {\r
+        var el = this.get('labelEl');\r
+        el.innerHTML = label;\r
+    };\r
+\r
+    var _getLabel = function() {\r
+        var label,\r
+            el = this.get('labelEl');\r
+\r
+            if (!el) {\r
+                return undefined;\r
+            }\r
+\r
+        return el.innerHTML;\r
+    };\r
+\r
+    var _dataConnect = function() {\r
+        if (!YAHOO.util.Connect) {\r
+            YAHOO.log('YAHOO.util.Connect dependency not met',\r
+                    'error', 'Tab');\r
+            return false;\r
+        }\r
+\r
+        Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);\r
+\r
+        this.dataConnection = YAHOO.util.Connect.asyncRequest(\r
+            this.get('loadMethod'),\r
+            this.get('dataSrc'),\r
+            {\r
+                success: function(o) {\r
+                    this.loadHandler.success.call(this, o);\r
+                    this.set('dataLoaded', true);\r
+                    this.dataConnection = null;\r
+                    Dom.removeClass(this.get('contentEl').parentNode,\r
+                            this.LOADING_CLASSNAME);\r
+                },\r
+                failure: function(o) {\r
+                    this.loadHandler.failure.call(this, o);\r
+                    this.dataConnection = null;\r
+                    Dom.removeClass(this.get('contentEl').parentNode,\r
+                            this.LOADING_CLASSNAME);\r
+                },\r
+                scope: this,\r
+                timeout: this.get('dataTimeout')\r
+            }\r
+        );\r
+    };\r
+\r
+    YAHOO.widget.Tab = Tab;\r
+\r
+    /**\r
+     * Fires before the active state is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeActiveChange<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeActiveChange', handler);</code></p>\r
+     * @event beforeActiveChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the active state is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> activeChange<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('activeChange', handler);</code></p>\r
+     * @event activeChange\r
+     */\r
+\r
+    /**\r
+     * Fires before the tab label is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeLabelChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeLabelChange', handler);</code></p>\r
+     * @event beforeLabelChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the tab label is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> labelChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('labelChange', handler);</code></p>\r
+     * @event labelChange\r
+     */\r
+\r
+    /**\r
+     * Fires before the tab content is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p>If handler returns false, the change will be cancelled, and the value will not\r
+     * be set.</p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> beforeContentChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the current value<br>\r
+     * <code>&lt;String&gt;\r
+     * newValue</code> the new value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('beforeContentChange', handler);</code></p>\r
+     * @event beforeContentChange\r
+     */\r
+\r
+    /**\r
+     * Fires after the tab content is changed.\r
+     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+     * <p><strong>Event fields:</strong><br>\r
+     * <code>&lt;String&gt; type</code> contentChange<br>\r
+     * <code>&lt;String&gt;\r
+     * prevValue</code> the previous value<br>\r
+     * <code>&lt;Boolean&gt;\r
+     * newValue</code> the updated value</p>\r
+     * <p><strong>Usage:</strong><br>\r
+     * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+     * myTabs.addListener('contentChange', handler);</code></p>\r
+     * @event contentChange\r
+     */\r
+})();(function() {\r
+\r
+    /**\r
+     * The tabview module provides a widget for managing content bound to tabs.\r
+     * @module tabview\r
+     *\r
+     */\r
+    /**\r
+     * A widget to control tabbed views.\r
+     * @namespace YAHOO.widget\r
+     * @class TabView\r
+     * @extends YAHOO.util.Element\r
+     * @constructor\r
+     * @param {HTMLElement | String | Object} el(optional) The html\r
+     * element that represents the TabView, or the attribute object to use.\r
+     * An element will be created if none provided.\r
+     * @param {Object} attr (optional) A key map of the tabView's\r
+     * initial attributes.  Ignored if first arg is attributes object.\r
+     */\r
+    YAHOO.widget.TabView = function(el, attr) {\r
+        attr = attr || {};\r
+        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {\r
+            attr = el; // treat first arg as attr object\r
+            el = attr.element || null;\r
+        }\r
+\r
+        if (!el && !attr.element) { // create if we dont have one\r
+            el = _createTabViewElement.call(this, attr);\r
+        }\r
+       YAHOO.widget.TabView.superclass.constructor.call(this, el, attr);\r
+    };\r
+\r
+    YAHOO.extend(YAHOO.widget.TabView, YAHOO.util.Element);\r
+\r
+    var proto = YAHOO.widget.TabView.prototype;\r
+    var Dom = YAHOO.util.Dom;\r
+    var Lang = YAHOO.util.Lang;\r
+    var Event = YAHOO.util.Event;\r
+    var Tab = YAHOO.widget.Tab;\r
+\r
+\r
+    /**\r
+     * The className to add when building from scratch.\r
+     * @property CLASSNAME\r
+     * @default "navset"\r
+     */\r
+    proto.CLASSNAME = 'yui-navset';\r
+\r
+    /**\r
+     * The className of the HTMLElement containing the TabView's tab elements\r
+     * to look for when building from existing markup, or to add when building\r
+     * from scratch.\r
+     * All childNodes of the tab container are treated as Tabs when building\r
+     * from existing markup.\r
+     * @property TAB_PARENT_CLASSNAME\r
+     * @default "nav"\r
+     */\r
+    proto.TAB_PARENT_CLASSNAME = 'yui-nav';\r
+\r
+    /**\r
+     * The className of the HTMLElement containing the TabView's label elements\r
+     * to look for when building from existing markup, or to add when building\r
+     * from scratch.\r
+     * All childNodes of the content container are treated as content elements when\r
+     * building from existing markup.\r
+     * @property CONTENT_PARENT_CLASSNAME\r
+     * @default "nav-content"\r
+     */\r
+    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';\r
+\r
+    proto._tabParent = null;\r
+    proto._contentParent = null;\r
+\r
+    /**\r
+     * Adds a Tab to the TabView instance.\r
+     * If no index is specified, the tab is added to the end of the tab list.\r
+     * @method addTab\r
+     * @param {YAHOO.widget.Tab} tab A Tab instance to add.\r
+     * @param {Integer} index The position to add the tab.\r
+     * @return void\r
+     */\r
+    proto.addTab = function(tab, index) {\r
+        var tabs = this.get('tabs');\r
+        if (!tabs) { // not ready yet\r
+            this._queue[this._queue.length] = ['addTab', arguments];\r
+            return false;\r
+        }\r
+\r
+        index = (index === undefined) ? tabs.length : index;\r
+\r
+        var before = this.getTab(index);\r
+\r
+        var self = this;\r
+        var el = this.get('element');\r
+        var tabParent = this._tabParent;\r
+        var contentParent = this._contentParent;\r
+\r
+        var tabElement = tab.get('element');\r
+        var contentEl = tab.get('contentEl');\r
+\r
+        if ( before ) {\r
+            tabParent.insertBefore(tabElement, before.get('element'));\r
+        } else {\r
+            tabParent.appendChild(tabElement);\r
+        }\r
+\r
+        if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {\r
+            contentParent.appendChild(contentEl);\r
+        }\r
+\r
+        if ( !tab.get('active') ) {\r
+            tab.set('contentVisible', false, true); /* hide if not active */\r
+        } else {\r
+            this.set('activeTab', tab, true);\r
+\r
+        }\r
+\r
+        var activate = function(e) {\r
+            YAHOO.util.Event.preventDefault(e);\r
+            self.set('activeTab', this);\r
+        };\r
+\r
+        tab.addListener( tab.get('activationEvent'), activate);\r
+\r
+        tab.addListener('activationEventChange', function(e) {\r
+            if (e.prevValue != e.newValue) {\r
+                tab.removeListener(e.prevValue, activate);\r
+                tab.addListener(e.newValue, activate);\r
+            }\r
+        });\r
+\r
+        tabs.splice(index, 0, tab);\r
+    };\r
+\r
+    /**\r
+     * Routes childNode events.\r
+     * @method DOMEventHandler\r
+     * @param {event} e The Dom event that is being handled.\r
+     * @return void\r
+     */\r
+    proto.DOMEventHandler = function(e) {\r
+        var el = this.get('element');\r
+        var target = YAHOO.util.Event.getTarget(e);\r
+        var tabParent = this._tabParent;\r
+\r
+        if (Dom.isAncestor(tabParent, target) ) {\r
+            var tabEl;\r
+            var tab = null;\r
+            var contentEl;\r
+            var tabs = this.get('tabs');\r
+\r
+            for (var i = 0, len = tabs.length; i < len; i++) {\r
+                tabEl = tabs[i].get('element');\r
+                contentEl = tabs[i].get('contentEl');\r
+\r
+                if ( target == tabEl || Dom.isAncestor(tabEl, target) ) {\r
+                    tab = tabs[i];\r
+                    break; // note break\r
+                }\r
+            }\r
+\r
+            if (tab) {\r
+                tab.fireEvent(e.type, e);\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Returns the Tab instance at the specified index.\r
+     * @method getTab\r
+     * @param {Integer} index The position of the Tab.\r
+     * @return YAHOO.widget.Tab\r
+     */\r
+    proto.getTab = function(index) {\r
+       return this.get('tabs')[index];\r
+    };\r
+\r
+    /**\r
+     * Returns the index of given tab.\r
+     * @method getTabIndex\r
+     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.\r
+     * @return int\r
+     */\r
+    proto.getTabIndex = function(tab) {\r
+        var index = null;\r
+        var tabs = this.get('tabs');\r
+       for (var i = 0, len = tabs.length; i < len; ++i) {\r
+            if (tab == tabs[i]) {\r
+                index = i;\r
+                break;\r
+            }\r
+        }\r
+\r
+        return index;\r
+    };\r
+\r
+    /**\r
+     * Removes the specified Tab from the TabView.\r
+     * @method removeTab\r
+     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.\r
+     * @return void\r
+     */\r
+    proto.removeTab = function(tab) {\r
+        var tabCount = this.get('tabs').length;\r
+\r
+        var index = this.getTabIndex(tab);\r
+        var nextIndex = index + 1;\r
+        if ( tab == this.get('activeTab') ) { // select next tab\r
+            if (tabCount > 1) {\r
+                if (index + 1 == tabCount) {\r
+                    this.set('activeIndex', index - 1);\r
+                } else {\r
+                    this.set('activeIndex', index + 1);\r
+                }\r
+            }\r
+        }\r
+\r
+        this._tabParent.removeChild( tab.get('element') );\r
+        this._contentParent.removeChild( tab.get('contentEl') );\r
+        this._configs.tabs.value.splice(index, 1);\r
+\r
+    };\r
+\r
+    /**\r
+     * Provides a readable name for the TabView instance.\r
+     * @method toString\r
+     * @return String\r
+     */\r
+    proto.toString = function() {\r
+        var name = this.get('id') || this.get('tagName');\r
+        return "TabView " + name;\r
+    };\r
+\r
+    /**\r
+     * The transiton to use when switching between tabs.\r
+     * @method contentTransition\r
+     */\r
+    proto.contentTransition = function(newTab, oldTab) {\r
+        newTab.set('contentVisible', true);\r
+        oldTab.set('contentVisible', false);\r
+    };\r
+\r
+    /**\r
+     * Registers TabView specific properties.\r
+     * @method initAttributes\r
+     * @param {Object} attr Hash of initial attributes\r
+     */\r
+    proto.initAttributes = function(attr) {\r
+        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);\r
+\r
+        if (!attr.orientation) {\r
+            attr.orientation = 'top';\r
+        }\r
+\r
+        var el = this.get('element');\r
+\r
+        /**\r
+         * The Tabs belonging to the TabView instance.\r
+         * @config tabs\r
+         * @type Array\r
+         */\r
+        this.register('tabs', {\r
+            value: [],\r
+            readOnly: true\r
+        });\r
+\r
+        /**\r
+         * The container of the tabView's label elements.\r
+         * @property _tabParent\r
+         * @private\r
+         * @type HTMLElement\r
+         */\r
+        this._tabParent =\r
+                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,\r
+                        'ul' )[0] || _createTabParent.call(this);\r
+\r
+        /**\r
+         * The container of the tabView's content elements.\r
+         * @property _contentParent\r
+         * @type HTMLElement\r
+         * @private\r
+         */\r
+        this._contentParent =\r
+                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,\r
+                        'div')[0] ||  _createContentParent.call(this);\r
+\r
+        /**\r
+         * How the Tabs should be oriented relative to the TabView.\r
+         * @config orientation\r
+         * @type String\r
+         * @default "top"\r
+         */\r
+        this.register('orientation', {\r
+            value: attr.orientation,\r
+            method: function(value) {\r
+                var current = this.get('orientation');\r
+                this.addClass('yui-navset-' + value);\r
+\r
+                if (current != value) {\r
+                    this.removeClass('yui-navset-' + current);\r
+                }\r
+\r
+                switch(value) {\r
+                    case 'bottom':\r
+                    this.appendChild(this._tabParent);\r
+                    break;\r
+                }\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The index of the tab currently active.\r
+         * @config activeIndex\r
+         * @type Int\r
+         */\r
+        this.register('activeIndex', {\r
+            value: attr.activeIndex,\r
+            method: function(value) {\r
+                this.set('activeTab', this.getTab(value));\r
+            },\r
+            validator: function(value) {\r
+                return !this.getTab(value).get('disabled'); // cannot activate if disabled\r
+            }\r
+        });\r
+\r
+        /**\r
+         * The tab currently active.\r
+         * @config activeTab\r
+         * @type YAHOO.widget.Tab\r
+         */\r
+        this.register('activeTab', {\r
+            value: attr.activeTab,\r
+            method: function(tab) {\r
+                var activeTab = this.get('activeTab');\r
+\r
+                if (tab) {\r
+                    tab.set('active', true);\r
+                }\r
+\r
+                if (activeTab && activeTab != tab) {\r
+                    activeTab.set('active', false);\r
+                }\r
+\r
+                if (activeTab && tab != activeTab) { // no transition if only 1\r
+                    this.contentTransition(tab, activeTab);\r
+                } else if (tab) {\r
+                    tab.set('contentVisible', true);\r
+                }\r
+            },\r
+            validator: function(value) {\r
+                return !value.get('disabled'); // cannot activate if disabled\r
+            }\r
+        });\r
+\r
+        if ( this._tabParent ) {\r
+            _initTabs.call(this);\r
+        }\r
+\r
+        for (var type in this.DOM_EVENTS) {\r
+            if ( this.DOM_EVENTS.hasOwnProperty(type) ) {\r
+                this.addListener.call(this, type, this.DOMEventHandler);\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Creates Tab instances from a collection of HTMLElements.\r
+     * @method createTabs\r
+     * @private\r
+     * @param {Array|HTMLCollection} elements The elements to use for Tabs.\r
+     * @return void\r
+     */\r
+    var _initTabs = function() {\r
+        var tab,\r
+            attr,\r
+            contentEl;\r
+\r
+        var el = this.get('element');\r
+        var tabs = _getChildNodes(this._tabParent);\r
+        var contentElements = _getChildNodes(this._contentParent);\r
+\r
+        for (var i = 0, len = tabs.length; i < len; ++i) {\r
+            attr = {};\r
+\r
+            if (contentElements[i]) {\r
+                attr.contentEl = contentElements[i];\r
+            }\r
+\r
+            tab = new YAHOO.widget.Tab(tabs[i], attr);\r
+            this.addTab(tab);\r
+\r
+            if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {\r
+                this._configs.activeTab.value = tab; // dont invoke method\r
+            }\r
+        }\r
+    };\r
+\r
+    var _createTabViewElement = function(attr) {\r
+        var el = document.createElement('div');\r
+\r
+        if ( this.CLASSNAME ) {\r
+            el.className = this.CLASSNAME;\r
+        }\r
+\r
+        return el;\r
+    };\r
+\r
+    var _createTabParent = function(attr) {\r
+        var el = document.createElement('ul');\r
+\r
+        if ( this.TAB_PARENT_CLASSNAME ) {\r
+            el.className = this.TAB_PARENT_CLASSNAME;\r
+        }\r
+\r
+        this.get('element').appendChild(el);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _createContentParent = function(attr) {\r
+        var el = document.createElement('div');\r
+\r
+        if ( this.CONTENT_PARENT_CLASSNAME ) {\r
+            el.className = this.CONTENT_PARENT_CLASSNAME;\r
+        }\r
+\r
+        this.get('element').appendChild(el);\r
+\r
+        return el;\r
+    };\r
+\r
+    var _getChildNodes = function(el) {\r
+        var nodes = [];\r
+        var childNodes = el.childNodes;\r
+\r
+        for (var i = 0, len = childNodes.length; i < len; ++i) {\r
+            if (childNodes[i].nodeType == 1) {\r
+                nodes[nodes.length] = childNodes[i];\r
+            }\r
+        }\r
+\r
+        return nodes;\r
+    };\r
+\r
+/**\r
+ * Fires before the activeTab is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p>If handler returns false, the change will be cancelled, and the value will not\r
+ * be set.</p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * prevValue</code> the currently active tab<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * newValue</code> the tab to be made active</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('beforeActiveTabChange', handler);</code></p>\r
+ * @event beforeActiveTabChange\r
+ */\r
+\r
+/**\r
+ * Fires after the activeTab is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> activeTabChange<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * prevValue</code> the formerly active tab<br>\r
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;\r
+ * newValue</code> the new active tab</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('activeTabChange', handler);</code></p>\r
+ * @event activeTabChange\r
+ */\r
+\r
+/**\r
+ * Fires before the orientation is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p>If handler returns false, the change will be cancelled, and the value will not\r
+ * be set.</p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> beforeOrientationChange<br>\r
+ * <code>&lt;String&gt;\r
+ * prevValue</code> the current orientation<br>\r
+ * <code>&lt;String&gt;\r
+ * newValue</code> the new orientation to be applied</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('beforeOrientationChange', handler);</code></p>\r
+ * @event beforeOrientationChange\r
+ */\r
+\r
+/**\r
+ * Fires after the orientation is changed.\r
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>\r
+ * <p><strong>Event fields:</strong><br>\r
+ * <code>&lt;String&gt; type</code> orientationChange<br>\r
+ * <code>&lt;String&gt;\r
+ * prevValue</code> the former orientation<br>\r
+ * <code>&lt;String&gt;\r
+ * newValue</code> the new orientation</p>\r
+ * <p><strong>Usage:</strong><br>\r
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>\r
+ * myTabs.addListener('orientationChange', handler);</code></p>\r
+ * @event orientationChange\r
+ */\r
+})();
\ No newline at end of file
index 5624915acf9a2957cbc03bf3ad705367e573a4c4..cb715bb2559b8409ae2c190ae74dcf0baafadf60 100755 (executable)
@@ -1,5 +1,35 @@
 TreeView - Release Notes\r
 \r
+0.12.0\r
+\r
+  * TreeView now augments EventProvider, and has custom events for expand,\r
+    collapse, animStart, animComplete, and labelClick.  Existing implementations\r
+    using abstract methods for these events (if they exist) will still work.\r
+    New events can be plugged into the tree by the Node implementation.  For\r
+    example, TaskNode adds a checkClick event.  EventProvider makes it safe\r
+    to do this because implementing code can call subscribe() prior to the\r
+    event creation.\r
+\r
+  * YAHOO.util.Event is now a requirement for the widget\r
+\r
+  * TreeView::removeChildren no longer expands and collapses the node.\r
+\r
+  * Documented the moveComplete property\r
+\r
+  * createElement("DIV") changed to createElement("div")\r
+\r
+0.11.4\r
+\r
+   * Fixed a javascript error on the HTML node example page.\r
+\r
+0.11.3\r
+\r
+   * popNode now clears the tree, previousSibling, nextSibling, and parent\r
+     properties of the node that is being removed from the tree.\r
+\r
+   * Fixed the paths to the images in the tree.css file that is included in\r
+     build/assets.\r
+\r
 0.11.0\r
 \r
    * Added TreeView -> popNode, which differs from removeNode in that the\r
index dffca1eb42b004a9870b8fc54024962a6e354167..8686839b1454562c2b9197d7eb73d8a0d7452230 100755 (executable)
@@ -3,81 +3,81 @@
 /* first or middle sibling, no children */\r
 .ygtvtn {\r
        width:16px; height:22px; \r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/tn.gif) 0 0 no-repeat; \r
+       background: url(tn.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* first or middle sibling, collapsable */\r
 .ygtvtm {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/tm.gif) 0 0 no-repeat; \r
+       background: url(tm.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* first or middle sibling, collapsable, hover */\r
 .ygtvtmh {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/tmh.gif) 0 0 no-repeat; \r
+       background: url(tmh.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* first or middle sibling, expandable */\r
 .ygtvtp {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/tp.gif) 0 0 no-repeat; \r
+       background: url(tp.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* first or middle sibling, expandable, hover */\r
 .ygtvtph {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/tph.gif) 0 0 no-repeat; \r
+       background: url(tph.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* last sibling, no children */\r
 .ygtvln {\r
        width:16px; height:22px; \r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/ln.gif) 0 0 no-repeat; \r
+       background: url(ln.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* Last sibling, collapsable */\r
 .ygtvlm {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/lm.gif) 0 0 no-repeat; \r
+       background: url(lm.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* Last sibling, collapsable, hover */\r
 .ygtvlmh {\r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/lmh.gif) 0 0 no-repeat; \r
+       background: url(lmh.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* Last sibling, expandable */\r
 .ygtvlp { \r
        width:16px; height:22px; \r
        cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/lp.gif) 0 0 no-repeat; \r
+       background: url(lp.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* Last sibling, expandable, hover */\r
 .ygtvlph { \r
        width:16px; height:22px; cursor:pointer ;\r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/lph.gif) 0 0 no-repeat; \r
+       background: url(lph.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* Loading icon */\r
 .ygtvloading { \r
        width:16px; height:22px; \r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/loading.gif) 0 0 no-repeat; \r
+       background: url(loading.gif) 0 0 no-repeat; \r
 }\r
 \r
 /* the style for the empty cells that are used for rendering the depth \r
  * of the node */\r
 .ygtvdepthcell { \r
        width:16px; height:22px; \r
-       background: url(../../../../../../../i/us/nt/widg/tree/dflt/vline.gif) 0 0 no-repeat; \r
+       background: url(vline.gif) 0 0 no-repeat; \r
 }\r
 \r
 .ygtvblankdepthcell { width:16px; height:22px; }\r
index 69efa95feef8e9056bdac1f908500e9525561a4d..94d0310753f8713b3039b74eb6d5a0ee5e47c456 100755 (executable)
@@ -1,16 +1,23 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
 \r
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+/**\r
+ * The treeview widget is a generic tree building tool.\r
+ * @module treeview\r
+ * @title TreeView Widget\r
+ * @requires yahoo\r
+ * @optional animation\r
+ * @namespace YAHOO.widget\r
+ */\r
 \r
 /**\r
- * Contains the tree view state data and the root node.  This is an\r
- * ordered tree; child nodes will be displayed in the order created, and\r
- * there currently is no way to change this.\r
+ * Contains the tree view state data and the root node.\r
  *\r
+ * @class TreeView\r
  * @constructor\r
  * @param {string|HTMLElement} id The id of the element, or the element\r
  * itself that the tree will be inserted into.\r
@@ -19,30 +26,27 @@ YAHOO.widget.TreeView = function(id) {
     if (id) { this.init(id); }\r
 };\r
 \r
-/**\r
- * Count of all nodes in all trees\r
- * @type int\r
- */\r
-YAHOO.widget.TreeView.nodeCount = 0;\r
+\r
 \r
 YAHOO.widget.TreeView.prototype = {\r
 \r
     /**\r
      * The id of tree container element\r
-     *\r
+     * @property id\r
      * @type String\r
      */\r
     id: null,\r
 \r
     /**\r
      * The host element for this tree\r
+     * @property _el\r
      * @private\r
      */\r
     _el: null,\r
 \r
      /**\r
      * Flat collection of all nodes in this tree\r
-     *\r
+     * @property _nodes\r
      * @type Node[]\r
      * @private\r
      */\r
@@ -50,14 +54,14 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * We lock the tree control while waiting for the dynamic loader to return\r
-     *\r
+     * @property locked\r
      * @type boolean\r
      */\r
     locked: false,\r
 \r
     /**\r
      * The animation to use for expanding children, if any\r
-     *\r
+     * @property _expandAnim\r
      * @type string\r
      * @private\r
      */\r
@@ -65,7 +69,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The animation to use for collapsing children, if any\r
-     *\r
+     * @property _collapseAnim\r
      * @type string\r
      * @private\r
      */\r
@@ -73,7 +77,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The current number of animations that are executing\r
-     *\r
+     * @property _animCount\r
      * @type int\r
      * @private\r
      */\r
@@ -81,16 +85,16 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The maximum number of animations to run at one time.\r
-     *\r
+     * @property maxAnim\r
      * @type int\r
      */\r
     maxAnim: 2,\r
 \r
     /**\r
      * Sets up the animation for expanding children\r
-     *\r
-     * @param {string} the type of animation (acceptable values defined in \r
-     * YAHOO.widget.TVAnim)\r
+     * @method setExpandAnim\r
+     * @param {string} type the type of animation (acceptable values defined\r
+     * in YAHOO.widget.TVAnim)\r
      */\r
     setExpandAnim: function(type) {\r
         if (YAHOO.widget.TVAnim.isValid(type)) {\r
@@ -100,8 +104,8 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Sets up the animation for collapsing children\r
-     *\r
-     * @param {string} the type of animation (acceptable values defined in \r
+     * @method setCollapseAnim\r
+     * @param {string} the type of animation (acceptable values defined in\r
      * YAHOO.widget.TVAnim)\r
      */\r
     setCollapseAnim: function(type) {\r
@@ -113,20 +117,25 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Perform the expand animation if configured, or just show the\r
      * element if not configured or too many animations are in progress\r
-     *\r
+     * @method animateExpand\r
      * @param el {HTMLElement} the element to animate\r
+     * @param node {YAHOO.util.Node} the node that was expanded\r
      * @return {boolean} true if animation could be invoked, false otherwise\r
      */\r
-    animateExpand: function(el) {\r
+    animateExpand: function(el, node) {\r
         this.logger.log("animating expand");\r
 \r
         if (this._expandAnim && this._animCount < this.maxAnim) {\r
             // this.locked = true;\r
             var tree = this;\r
-            var a = YAHOO.widget.TVAnim.getAnim(this._expandAnim, el, \r
-                            function() { tree.expandComplete(); });\r
-            if (a) { \r
+            var a = YAHOO.widget.TVAnim.getAnim(this._expandAnim, el,\r
+                            function() { tree.expandComplete(node); });\r
+            if (a) {\r
                 ++this._animCount;\r
+                this.fireEvent("animStart", {\r
+                        "node": node,\r
+                        "type": "expand"\r
+                    });\r
                 a.animate();\r
             }\r
 \r
@@ -139,20 +148,25 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Perform the collapse animation if configured, or just show the\r
      * element if not configured or too many animations are in progress\r
-     *\r
+     * @method animateCollapse\r
      * @param el {HTMLElement} the element to animate\r
+     * @param node {YAHOO.util.Node} the node that was expanded\r
      * @return {boolean} true if animation could be invoked, false otherwise\r
      */\r
-    animateCollapse: function(el) {\r
+    animateCollapse: function(el, node) {\r
         this.logger.log("animating collapse");\r
 \r
         if (this._collapseAnim && this._animCount < this.maxAnim) {\r
             // this.locked = true;\r
             var tree = this;\r
-            var a = YAHOO.widget.TVAnim.getAnim(this._collapseAnim, el, \r
-                            function() { tree.collapseComplete(); });\r
-            if (a) { \r
+            var a = YAHOO.widget.TVAnim.getAnim(this._collapseAnim, el,\r
+                            function() { tree.collapseComplete(node); });\r
+            if (a) {\r
                 ++this._animCount;\r
+                this.fireEvent("animStart", {\r
+                        "node": node,\r
+                        "type": "collapse"\r
+                    });\r
                 a.animate();\r
             }\r
 \r
@@ -164,25 +178,35 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Function executed when the expand animation completes\r
+     * @method expandComplete\r
      */\r
-    expandComplete: function() {\r
+    expandComplete: function(node) {\r
         this.logger.log("expand complete: " + this.id);\r
         --this._animCount;\r
+        this.fireEvent("animComplete", {\r
+                "node": node,\r
+                "type": "expand"\r
+            });\r
         // this.locked = false;\r
     },\r
 \r
     /**\r
      * Function executed when the collapse animation completes\r
+     * @method collapseComplete\r
      */\r
-    collapseComplete: function() {\r
+    collapseComplete: function(node) {\r
         this.logger.log("collapse complete: " + this.id);\r
         --this._animCount;\r
+        this.fireEvent("animComplete", {\r
+                "node": node,\r
+                "type": "collapse"\r
+            });\r
         // this.locked = false;\r
     },\r
 \r
     /**\r
      * Initializes the tree\r
-     *\r
+     * @method init\r
      * @parm {string|HTMLElement} id the id of the element that will hold the tree\r
      * @private\r
      */\r
@@ -195,6 +219,44 @@ YAHOO.widget.TreeView.prototype = {
             this.id = this.generateId(id);\r
         }\r
 \r
+        /**\r
+         * When animation is enabled, this event fires when the animation\r
+         * starts\r
+         * @event animStart\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         * @parm {String} type the type of animation ("expand" or "collapse")\r
+         */\r
+        this.createEvent("animStart", this);\r
+\r
+        /**\r
+         * When animation is enabled, this event fires when the animation\r
+         * completes\r
+         * @event animComplete\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         * @parm {String} type the type of animation ("expand" or "collapse")\r
+         */\r
+        this.createEvent("animComplete", this);\r
+\r
+        /**\r
+         * Fires when a node is going to be expanded.  Return false to stop\r
+         * the expand.\r
+         * @event collapse\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         */\r
+        this.createEvent("collapse", this);\r
+\r
+        /**\r
+         * Fires when a node is going to be collapsed.  Return false to stop\r
+         * the collapse.\r
+         * @event expand\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         */\r
+        this.createEvent("expand", this);\r
+\r
         this._nodes = [];\r
 \r
         // store a global reference\r
@@ -210,6 +272,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Renders the tree boilerplate and visible nodes\r
+     * @method draw\r
      */\r
     draw: function() {\r
         var html = this.root.getHtml();\r
@@ -219,6 +282,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Returns the tree's host element\r
+     * @method getEl\r
      * @return {HTMLElement} the host element\r
      */\r
     getEl: function() {\r
@@ -230,7 +294,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Nodes register themselves with the tree instance when they are created.\r
-     *\r
+     * @method regNode\r
      * @param node {Node} the node to register\r
      * @private\r
      */\r
@@ -240,7 +304,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Returns the root node of this tree\r
-     *\r
+     * @method getRoot\r
      * @return {Node} the root node\r
      */\r
     getRoot: function() {\r
@@ -249,14 +313,14 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Configures this tree to dynamically load all child data\r
-     *\r
+     * @method setDynamicLoad\r
      * @param {function} fnDataLoader the function that will be called to get the data\r
      * @param iconMode {int} configures the icon that is displayed when a dynamic\r
-     * load node is expanded the first time without children.  By default, the \r
+     * load node is expanded the first time without children.  By default, the\r
      * "collapse" icon will be used.  If set to 1, the leaf node icon will be\r
      * displayed.\r
      */\r
-    setDynamicLoad: function(fnDataLoader, iconMode) { \r
+    setDynamicLoad: function(fnDataLoader, iconMode) {\r
         this.root.setDynamicLoad(fnDataLoader, iconMode);\r
     },\r
 \r
@@ -265,19 +329,21 @@ YAHOO.widget.TreeView.prototype = {
      * node property.  If expand all is called in a tree with nodes that\r
      * do not allow multiple siblings to be displayed, only the last sibling\r
      * will be expanded.\r
+     * @method expandAll\r
      */\r
-    expandAll: function() { \r
+    expandAll: function() {\r
         if (!this.locked) {\r
-            this.root.expandAll(); \r
+            this.root.expandAll();\r
         }\r
     },\r
 \r
     /**\r
      * Collapses all expanded child nodes in the entire tree.\r
+     * @method collapseAll\r
      */\r
-    collapseAll: function() { \r
+    collapseAll: function() {\r
         if (!this.locked) {\r
-            this.root.collapseAll(); \r
+            this.root.collapseAll();\r
         }\r
     },\r
 \r
@@ -285,7 +351,7 @@ YAHOO.widget.TreeView.prototype = {
      * Returns a node in the tree that has the specified index (this index\r
      * is created internally, so this function probably will only be used\r
      * in html generated for a given node.)\r
-     *\r
+     * @method getNodeByIndex\r
      * @param {int} nodeIndex the index of the node wanted\r
      * @return {Node} the node with index=nodeIndex, null if no match\r
      */\r
@@ -297,7 +363,7 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Returns a node that has a matching property and value in the data\r
      * object that was passed into its constructor.\r
-     *\r
+     * @method getNodeByProperty\r
      * @param {object} property the property to search (usually a string)\r
      * @param {object} value the value we want to find (usuall an int or string)\r
      * @return {Node} the matching node, null if no match\r
@@ -314,9 +380,9 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * Returns a collection of nodes that have a matching property \r
-     * and value in the data object that was passed into its constructor.  \r
-     *\r
+     * Returns a collection of nodes that have a matching property\r
+     * and value in the data object that was passed into its constructor.\r
+     * @method getNodesByProperty\r
      * @param {object} property the property to search (usually a string)\r
      * @param {object} value the value we want to find (usuall an int or string)\r
      * @return {Array} the matching collection of nodes, null if no match\r
@@ -334,13 +400,14 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * Removes the node and its children, and optionally refreshes the branch \r
-     * of the tree that was affected.\r
+     * Removes the node and its children, and optionally refreshes the\r
+     * branch of the tree that was affected.\r
+     * @method removeNode\r
      * @param {Node} The node to remove\r
      * @param {boolean} autoRefresh automatically refreshes branch if true\r
      * @return {boolean} False is there was a problem, true otherwise.\r
      */\r
-    removeNode: function(node, autoRefresh) { \r
+    removeNode: function(node, autoRefresh) {\r
 \r
         // Don't delete the root node\r
         if (node.isRoot()) {\r
@@ -369,9 +436,10 @@ YAHOO.widget.TreeView.prototype = {
      * the node, and resets the dynamic load flag.  The primary use for\r
      * this method is to purge a node and allow it to fetch its data\r
      * dynamically again.\r
+     * @method removeChildren\r
      * @param {Node} node the node to purge\r
      */\r
-    removeChildren: function(node) { \r
+    removeChildren: function(node) {\r
         this.logger.log("Removing children for " + node);\r
         while (node.children.length) {\r
              this._deleteNode(node.children[0]);\r
@@ -379,16 +447,19 @@ YAHOO.widget.TreeView.prototype = {
 \r
         node.childrenRendered = false;\r
         node.dynamicLoadComplete = false;\r
-        // node.collapse();\r
-        node.expand();\r
-        node.collapse();\r
+        if (node.expanded) {\r
+            node.collapse();\r
+        } else {\r
+            node.updateIcon();\r
+        }\r
     },\r
 \r
     /**\r
      * Deletes the node and recurses children\r
+     * @method _deleteNode\r
      * @private\r
      */\r
-    _deleteNode: function(node) { \r
+    _deleteNode: function(node) {\r
         // Remove all the child nodes first\r
         this.removeChildren(node);\r
 \r
@@ -397,12 +468,13 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * Removes the branch from the tree.  This differs from removeNode in\r
-     * that the child collection is preserved to make it possible to\r
-     * insert the branch into another part of the tree, or another tree.\r
+     * Removes the node from the tree, preserving the child collection\r
+     * to make it possible to insert the branch into another part of the\r
+     * tree, or another tree.\r
+     * @method popNode\r
      * @param {Node} the node to remove\r
      */\r
-    popNode: function(node) { \r
+    popNode: function(node) {\r
         var p = node.parent;\r
 \r
         // Update the parent's collection of children\r
@@ -428,13 +500,19 @@ YAHOO.widget.TreeView.prototype = {
             node.nextSibling.previousSibling = node.previousSibling;\r
         }\r
 \r
-        // Update the tree's node collection \r
+        node.parent = null;\r
+        node.previousSibling = null;\r
+        node.nextSibling = null;\r
+        node.tree = null;\r
+\r
+        // Update the tree's node collection\r
         delete this._nodes[node.index];\r
     },\r
 \r
 \r
     /**\r
-     * toString\r
+     * TreeView instance toString\r
+     * @method toString\r
      * @return {string} string representation of the tree\r
      */\r
     toString: function() {\r
@@ -442,14 +520,16 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * private\r
+     * Generates an unique id for an element if it doesn't yet have one\r
+     * @method generateId\r
+     * @private\r
      */\r
     generateId: function(el) {\r
         var id = el.id;\r
 \r
         if (!id) {\r
             id = "yui-tv-auto-id-" + YAHOO.widget.TreeView.counter;\r
-            YAHOO.widget.TreeView.counter++;\r
+            ++YAHOO.widget.TreeView.counter;\r
         }\r
 \r
         return id;\r
@@ -457,27 +537,45 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Abstract method that is executed when a node is expanded\r
+     * @method onExpand\r
      * @param node {Node} the node that was expanded\r
+     * @deprecated use treeobj.subscribe("expand") instead\r
      */\r
     onExpand: function(node) { },\r
 \r
     /**\r
-     * Abstract method that is executed when a node is collapsed\r
+     * Abstract method that is executed when a node is collapsed.\r
+     * @method onCollapse\r
      * @param node {Node} the node that was collapsed.\r
+     * @deprecated use treeobj.subscribe("collapse") instead\r
      */\r
     onCollapse: function(node) { }\r
 \r
 };\r
 \r
+YAHOO.augment(YAHOO.widget.TreeView, YAHOO.util.EventProvider);\r
+\r
+/**\r
+ * Count of all nodes in all trees\r
+ * @property YAHOO.widget.TreeView.nodeCount\r
+ * @type int\r
+ * @static\r
+ */\r
+YAHOO.widget.TreeView.nodeCount = 0;\r
+\r
 /**\r
  * Global cache of tree instances\r
- *\r
+ * @property YAHOO.widget.TreeView.trees\r
  * @type Array\r
+ * @static\r
  * @private\r
  */\r
 YAHOO.widget.TreeView.trees = [];\r
 \r
 /**\r
+ * Counter for generating a new unique element id\r
+ * @property YAHOO.widget.TreeView.counter\r
+ * @static\r
  * @private\r
  */\r
 YAHOO.widget.TreeView.counter = 0;\r
@@ -485,9 +583,10 @@ YAHOO.widget.TreeView.counter = 0;
 /**\r
  * Global method for getting a tree by its id.  Used in the generated\r
  * tree html.\r
- *\r
+ * @method YAHOO.widget.TreeView.getTree\r
  * @param treeId {String} the id of the tree instance\r
  * @return {TreeView} the tree instance requested, null if not found.\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.getTree = function(treeId) {\r
     var t = YAHOO.widget.TreeView.trees[treeId];\r
@@ -498,10 +597,11 @@ YAHOO.widget.TreeView.getTree = function(treeId) {
 /**\r
  * Global method for getting a node by its id.  Used in the generated\r
  * tree html.\r
- *\r
+ * @method YAHOO.widget.TreeView.getNode\r
  * @param treeId {String} the id of the tree instance\r
  * @param nodeIndex {String} the index of the node to return\r
  * @return {Node} the node instance requested, null if not found\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {\r
     var t = YAHOO.widget.TreeView.getTree(treeId);\r
@@ -509,39 +609,57 @@ YAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {
 };\r
 \r
 /**\r
- * Adds an event.  Replace with event manager when available\r
- *\r
+ * Add a DOM event\r
+ * @method YAHOO.widget.TreeView.addHandler\r
  * @param el the elment to bind the handler to\r
  * @param {string} sType the type of event handler\r
  * @param {function} fn the callback to invoke\r
- * @param {boolean} capture if true event is capture phase, bubble otherwise\r
+ * @static\r
  */\r
-YAHOO.widget.TreeView.addHandler = function (el, sType, fn, capture) {\r
-    capture = (capture) ? true : false;\r
+YAHOO.widget.TreeView.addHandler = function (el, sType, fn) {\r
     if (el.addEventListener) {\r
-        el.addEventListener(sType, fn, capture);\r
+        el.addEventListener(sType, fn, false);\r
     } else if (el.attachEvent) {\r
         el.attachEvent("on" + sType, fn);\r
-    } else {\r
-        el["on" + sType] = fn;\r
+    }\r
+};\r
+\r
+/**\r
+ * Remove a DOM event\r
+ * @method YAHOO.widget.TreeView.removeHandler\r
+ * @param el the elment to bind the handler to\r
+ * @param {string} sType the type of event handler\r
+ * @param {function} fn the callback to invoke\r
+ * @static\r
+ */\r
+\r
+YAHOO.widget.TreeView.removeHandler = function (el, sType, fn) {\r
+    if (el.removeEventListener) {\r
+        el.removeEventListener(sType, fn, false);\r
+    } else if (el.detachEvent) {\r
+        el.detachEvent("on" + sType, fn);\r
     }\r
 };\r
 \r
 /**\r
  * Attempts to preload the images defined in the styles used to draw the tree by\r
  * rendering off-screen elements that use the styles.\r
+ * @method YAHOO.widget.TreeView.preload\r
+ * @param {string} prefix the prefix to use to generate the names of the\r
+ * images to preload, default is ygtv\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.preload = function(prefix) {\r
     prefix = prefix || "ygtv";\r
     var styles = ["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];\r
 \r
     var sb = [];\r
-    \r
-    for (var i = 0; i < styles.length; ++i) { \r
+\r
+    for (var i = 0; i < styles.length; ++i) {\r
         sb[sb.length] = '<span class="' + prefix + styles[i] + '">&#160;</span>';\r
     }\r
 \r
-    var f = document.createElement("DIV");\r
+    var f = document.createElement("div");\r
     var s = f.style;\r
     s.position = "absolute";\r
     s.top = "-1000px";\r
@@ -549,15 +667,20 @@ YAHOO.widget.TreeView.preload = function(prefix) {
     f.innerHTML = sb.join("");\r
 \r
     document.body.appendChild(f);\r
+\r
+    YAHOO.widget.TreeView.removeHandler(window,\r
+                "load", YAHOO.widget.TreeView.preload);\r
+\r
 };\r
 \r
-YAHOO.widget.TreeView.addHandler(window, \r
+YAHOO.widget.TreeView.addHandler(window,\r
                 "load", YAHOO.widget.TreeView.preload);\r
 \r
 /**\r
  * The base class for all tree nodes.  The node's presentation and behavior in\r
  * response to mouse events is handled in Node subclasses.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class Node\r
  * @param oData {object} a string or object containing the data that will\r
  * be used to render this node\r
  * @param oParent {Node} this node's parent node\r
@@ -572,21 +695,21 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * The index for this instance obtained from global counter in YAHOO.widget.TreeView.\r
-     *\r
+     * @property index\r
      * @type int\r
      */\r
     index: 0,\r
 \r
     /**\r
      * This node's child node collection.\r
-     *\r
-     * @type Node[] \r
+     * @property children\r
+     * @type Node[]\r
      */\r
     children: null,\r
 \r
     /**\r
      * Tree instance this node is part of\r
-     *\r
+     * @property tree\r
      * @type TreeView\r
      */\r
     tree: null,\r
@@ -594,21 +717,21 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * The data linked to this node.  This can be any object or primitive\r
      * value, and the data can be used in getNodeHtml().\r
-     *\r
+     * @property data\r
      * @type object\r
      */\r
     data: null,\r
 \r
     /**\r
      * Parent node\r
-     *\r
+     * @property parent\r
      * @type Node\r
      */\r
     parent: null,\r
 \r
     /**\r
      * The depth of this node.  We start at -1 for the root node.\r
-     *\r
+     * @property depth\r
      * @type int\r
      */\r
     depth: -1,\r
@@ -616,37 +739,37 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * The href for the node's label.  If one is not specified, the href will\r
      * be set so that it toggles the node.\r
-     *\r
+     * @property href\r
      * @type string\r
      */\r
     href: null,\r
 \r
     /**\r
      * The label href target, defaults to current window\r
-     *\r
+     * @property target\r
      * @type string\r
      */\r
     target: "_self",\r
 \r
     /**\r
      * The node's expanded/collapsed state\r
-     *\r
+     * @property expanded\r
      * @type boolean\r
      */\r
     expanded: false,\r
 \r
     /**\r
      * Can multiple children be expanded at once?\r
-     *\r
+     * @property multiExpand\r
      * @type boolean\r
      */\r
     multiExpand: true,\r
 \r
     /**\r
      * Should we render children for a collapsed node?  It is possible that the\r
-     * implementer will want to render the hidden data...  @todo verify that we \r
+     * implementer will want to render the hidden data...  @todo verify that we\r
      * need this, and implement it if we do.\r
-     *\r
+     * @property renderHidden\r
      * @type boolean\r
      */\r
     renderHidden: false,\r
@@ -654,6 +777,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * This flag is set to true when the html is generated for this node's\r
      * children, and set to false when new children are added.\r
+     * @property childrenRendered\r
      * @type boolean\r
      */\r
     childrenRendered: false,\r
@@ -661,20 +785,21 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Dynamically loaded nodes only fetch the data the first time they are\r
      * expanded.  This flag is set to true once the data has been fetched.\r
+     * @property dynamicLoadComplete\r
      * @type boolean\r
      */\r
     dynamicLoadComplete: false,\r
 \r
     /**\r
      * This node's previous sibling\r
-     *\r
+     * @property previousSibling\r
      * @type Node\r
      */\r
     previousSibling: null,\r
 \r
     /**\r
      * This node's next sibling\r
-     *\r
+     * @property nextSibling\r
      * @type Node\r
      */\r
     nextSibling: null,\r
@@ -682,7 +807,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * We can set the node up to call an external method to get the child\r
      * data dynamically.\r
-     *\r
+     * @property _dynLoad\r
      * @type boolean\r
      * @private\r
      */\r
@@ -690,7 +815,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Function to execute when we need to get this node's child data.\r
-     *\r
+     * @property dataLoader\r
      * @type function\r
      */\r
     dataLoader: null,\r
@@ -698,7 +823,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * This is true for dynamically loading nodes while waiting for the\r
      * callback to return.\r
-     *\r
+     * @property isLoading\r
      * @type boolean\r
      */\r
     isLoading: false,\r
@@ -707,7 +832,7 @@ YAHOO.widget.Node.prototype = {
      * The toggle/branch icon will not show if this is set to false.  This\r
      * could be useful if the implementer wants to have the child contain\r
      * extra info about the parent, rather than an actual node.\r
-     *\r
+     * @property hasIcon\r
      * @type boolean\r
      */\r
     hasIcon: true,\r
@@ -717,12 +842,14 @@ YAHOO.widget.Node.prototype = {
      * and we discover that it does not have children.  By default, it is\r
      * treated as if it still could have children (plus/minus icon).  Set\r
      * iconMode to have it display like a leaf node instead.\r
+     * @property iconMode\r
      * @type int\r
      */\r
     iconMode: 0,\r
 \r
     /**\r
      * The node type\r
+     * @property _type\r
      * @private\r
      */\r
     _type: "Node",\r
@@ -736,13 +863,14 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Initializes this node, gets some of the properties from the parent\r
-     *\r
+     * @method init\r
      * @param oData {object} a string or object containing the data that will\r
      * be used to render this node\r
      * @param oParent {Node} this node's parent node\r
      * @param expanded {boolean} the initial expanded/collapsed state\r
      */\r
     init: function(oData, oParent, expanded) {\r
+\r
         this.data       = oData;\r
         this.children   = [];\r
         this.index      = YAHOO.widget.TreeView.nodeCount;\r
@@ -750,6 +878,17 @@ YAHOO.widget.Node.prototype = {
         this.expanded   = expanded;\r
         this.logger     = new YAHOO.widget.LogWriter(this.toString());\r
 \r
+        /**\r
+         * The parentChange event is fired when a parent element is applied\r
+         * to the node.  This is useful if you need to apply tree-level\r
+         * properties to a tree that need to happen if a node is moved from\r
+         * one tre to another.\r
+         *\r
+         * @event parentChange\r
+         * @type CustomEvent\r
+         */\r
+        this.createEvent("parentChange", this);\r
+\r
         // oParent should never be null except when we create the root node.\r
         if (oParent) {\r
             oParent.appendChild(this);\r
@@ -761,7 +900,9 @@ YAHOO.widget.Node.prototype = {
      * is known. This is called after the node is inserted into a tree.\r
      * the parent is also applied to this node's children in order to\r
      * make it possible to move a branch from one tree to another.\r
+     * @method applyParent\r
      * @param {Node} parentNode this node's parent node\r
+     * @return {boolean} true if the application was successful\r
      */\r
     applyParent: function(parentNode) {\r
         if (!parentNode) {\r
@@ -772,7 +913,7 @@ YAHOO.widget.Node.prototype = {
         this.parent = parentNode;\r
         this.depth  = parentNode.depth + 1;\r
 \r
-        if (! this.href) {\r
+        if (!this.href) {\r
             this.href = "javascript:" + this.getToggleLink();\r
         }\r
 \r
@@ -788,12 +929,14 @@ YAHOO.widget.Node.prototype = {
             this.children[i].applyParent(this);\r
         }\r
 \r
+        this.fireEvent("parentChange");\r
+\r
         return true;\r
     },\r
 \r
     /**\r
      * Appends a node to the child collection.\r
-     *\r
+     * @method appendChild\r
      * @param childNode {Node} the new node\r
      * @return {Node} the child node\r
      * @private\r
@@ -812,7 +955,9 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Appends this node to the supplied node's child collection\r
+     * @method appendTo\r
      * @param parentNode {Node} the node to append to.\r
+     * @return {Node} The appended node\r
      */\r
     appendTo: function(parentNode) {\r
         return parentNode.appendChild(this);\r
@@ -820,7 +965,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
     * Inserts this node before this supplied node\r
-    *\r
+    * @method insertBefore\r
     * @param node {Node} the node to insert this node before\r
     * @return {Node} the inserted node\r
     */\r
@@ -834,7 +979,7 @@ YAHOO.widget.Node.prototype = {
             }\r
 \r
             var refIndex = node.isChildOf(p);\r
-            this.logger.log(refIndex);\r
+            //this.logger.log(refIndex);\r
             p.children.splice(refIndex, 0, this);\r
             if (node.previousSibling) {\r
                 node.previousSibling.nextSibling = this;\r
@@ -848,10 +993,10 @@ YAHOO.widget.Node.prototype = {
 \r
         return this;\r
     },\r
\r
+\r
     /**\r
     * Inserts this node after the supplied node\r
-    *\r
+    * @method insertAfter\r
     * @param node {Node} the node to insert after\r
     * @return {Node} the inserted node\r
     */\r
@@ -886,9 +1031,9 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
     * Returns true if the Node is a child of supplied Node\r
-    *\r
+    * @method isChildOf\r
     * @param parentNode {Node} the Node to check\r
-    * @return {boolean} The node index if this Node is a child of \r
+    * @return {boolean} The node index if this Node is a child of\r
     *                   supplied Node, else -1.\r
     * @private\r
     */\r
@@ -906,7 +1051,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns a node array of this node's siblings, null if none.\r
-     *\r
+     * @method getSiblings\r
      * @return Node[]\r
      */\r
     getSiblings: function() {\r
@@ -915,9 +1060,10 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Shows this node's children\r
+     * @method showChildren\r
      */\r
     showChildren: function() {\r
-        if (!this.tree.animateExpand(this.getChildrenEl())) {\r
+        if (!this.tree.animateExpand(this.getChildrenEl(), this)) {\r
             if (this.hasChildren()) {\r
                 this.getChildrenEl().style.display = "";\r
             }\r
@@ -926,18 +1072,19 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Hides this node's children\r
+     * @method hideChildren\r
      */\r
     hideChildren: function() {\r
         this.logger.log("hiding " + this.index);\r
 \r
-        if (!this.tree.animateCollapse(this.getChildrenEl())) {\r
+        if (!this.tree.animateCollapse(this.getChildrenEl(), this)) {\r
             this.getChildrenEl().style.display = "none";\r
         }\r
     },\r
 \r
     /**\r
      * Returns the id for this node's container div\r
-     *\r
+     * @method getElId\r
      * @return {string} the element id\r
      */\r
     getElId: function() {\r
@@ -946,7 +1093,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the id for this node's children div\r
-     *\r
+     * @method getChildrenElId\r
      * @return {string} the element id for this node's children div\r
      */\r
     getChildrenElId: function() {\r
@@ -955,7 +1102,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the id for this node's toggle element\r
-     *\r
+     * @method getToggleElId\r
      * @return {string} the toggel element id\r
      */\r
     getToggleElId: function() {\r
@@ -963,19 +1110,21 @@ YAHOO.widget.Node.prototype = {
     },\r
 \r
 \r
-    /**\r
+    /*\r
      * Returns the id for this node's spacer image.  The spacer is positioned\r
      * over the toggle and provides feedback for screen readers.\r
+     * @method getSpacerId\r
      * @return {string} the id for the spacer image\r
      */\r
     /*\r
     getSpacerId: function() {\r
         return "ygtvspacer" + this.index;\r
-    }, \r
+    },\r
     */\r
 \r
     /**\r
      * Returns this node's container html element\r
+     * @method getEl\r
      * @return {HTMLElement} the container html element\r
      */\r
     getEl: function() {\r
@@ -984,6 +1133,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the div that was generated for this node's children\r
+     * @method getChildrenEl\r
      * @return {HTMLElement} this node's children div\r
      */\r
     getChildrenEl: function() {\r
@@ -992,14 +1142,16 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the element that is being used for this node's toggle.\r
+     * @method getToggleEl\r
      * @return {HTMLElement} this node's toggle html element\r
      */\r
     getToggleEl: function() {\r
         return document.getElementById(this.getToggleElId());\r
     },\r
 \r
-    /**\r
+    /*\r
      * Returns the element that is being used for this node's spacer.\r
+     * @method getSpacer\r
      * @return {HTMLElement} this node's spacer html element\r
      */\r
     /*\r
@@ -1026,15 +1178,17 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Generates the link that will invoke this node's toggle method\r
+     * @method getToggleLink\r
      * @return {string} the javascript url for toggling this node\r
      */\r
     getToggleLink: function() {\r
-        return "YAHOO.widget.TreeView.getNode(\'" + this.tree.id + "\'," + \r
+        return "YAHOO.widget.TreeView.getNode(\'" + this.tree.id + "\'," +\r
             this.index + ").toggle()";\r
     },\r
 \r
     /**\r
      * Hides this nodes children (creating them if necessary), changes the\r
+     * @method collapse\r
      * toggle style.\r
      */\r
     collapse: function() {\r
@@ -1044,11 +1198,19 @@ YAHOO.widget.Node.prototype = {
         // fire the collapse event handler\r
         var ret = this.tree.onCollapse(this);\r
 \r
-        if ("undefined" != typeof ret && !ret) {\r
-            this.logger.log("Collapse was stopped by the event handler");\r
+        if (false === ret) {\r
+            this.logger.log("Collapse was stopped by the abstract onCollapse");\r
+            return;\r
+        }\r
+\r
+        ret = this.tree.fireEvent("collapse", this);\r
+\r
+        if (false === ret) {\r
+            this.logger.log("Collapse was stopped by a custom event handler");\r
             return;\r
         }\r
 \r
+\r
         if (!this.getEl()) {\r
             this.expanded = false;\r
             return;\r
@@ -1058,9 +1220,7 @@ YAHOO.widget.Node.prototype = {
         this.hideChildren();\r
         this.expanded = false;\r
 \r
-        if (this.hasIcon) {\r
-            this.getToggleEl().className = this.getStyle();\r
-        }\r
+        this.updateIcon();\r
 \r
         // this.getSpacer().title = this.getStateText();\r
 \r
@@ -1069,6 +1229,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Shows this nodes children (creating them if necessary), changes the\r
      * toggle style, and collapses its siblings if multiExpand is not set.\r
+     * @method expand\r
      */\r
     expand: function() {\r
         // Only expand if currently collapsed.\r
@@ -1077,8 +1238,15 @@ YAHOO.widget.Node.prototype = {
         // fire the expand event handler\r
         var ret = this.tree.onExpand(this);\r
 \r
-        if ("undefined" != typeof ret && !ret) {\r
-            this.logger.log("Expand was stopped by the event handler");\r
+        if (false === ret) {\r
+            this.logger.log("Expand was stopped by the abstract onExpand");\r
+            return;\r
+        }\r
+\r
+        ret = this.tree.fireEvent("expand", this);\r
+\r
+        if (false === ret) {\r
+            this.logger.log("Expand was stopped by the custom event handler");\r
             return;\r
         }\r
 \r
@@ -1095,9 +1263,8 @@ YAHOO.widget.Node.prototype = {
         }\r
 \r
         this.expanded = true;\r
-        if (this.hasIcon) {\r
-            this.getToggleEl().className = this.getStyle();\r
-        }\r
+\r
+        this.updateIcon();\r
 \r
         // this.getSpacer().title = this.getStateText();\r
 \r
@@ -1113,8 +1280,8 @@ YAHOO.widget.Node.prototype = {
         if (! this.multiExpand) {\r
             var sibs = this.getSiblings();\r
             for (var i=0; i<sibs.length; ++i) {\r
-                if (sibs[i] != this && sibs[i].expanded) { \r
-                    sibs[i].collapse(); \r
+                if (sibs[i] != this && sibs[i].expanded) {\r
+                    sibs[i].collapse();\r
                 }\r
             }\r
         }\r
@@ -1122,9 +1289,18 @@ YAHOO.widget.Node.prototype = {
         this.showChildren();\r
     },\r
 \r
+    updateIcon: function() {\r
+        if (this.hasIcon) {\r
+            var el = this.getToggleEl();\r
+            if (el) {\r
+                el.className = this.getStyle();\r
+            }\r
+        }\r
+    },\r
+\r
     /**\r
      * Returns the css style name for the toggle\r
-     *\r
+     * @method getStyle\r
      * @return {string} the css class for this node's toggle\r
      */\r
     getStyle: function() {\r
@@ -1151,19 +1327,21 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Returns the hover style for the icon\r
      * @return {string} the css class hover state\r
+     * @method getHoverStyle\r
      */\r
-    getHoverStyle: function() { \r
+    getHoverStyle: function() {\r
         var s = this.getStyle();\r
-        if (this.hasChildren(true) && !this.isLoading) { \r
-            s += "h"; \r
+        if (this.hasChildren(true) && !this.isLoading) {\r
+            s += "h";\r
         }\r
         return s;\r
     },\r
 \r
     /**\r
      * Recursively expands all of this node's children.\r
+     * @method expandAll\r
      */\r
-    expandAll: function() { \r
+    expandAll: function() {\r
         for (var i=0;i<this.children.length;++i) {\r
             var c = this.children[i];\r
             if (c.isDynamic()) {\r
@@ -1181,8 +1359,9 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Recursively collapses all of this node's children.\r
+     * @method collapseAll\r
      */\r
-    collapseAll: function() { \r
+    collapseAll: function() {\r
         for (var i=0;i<this.children.length;++i) {\r
             this.children[i].collapse();\r
             this.children[i].collapseAll();\r
@@ -1193,14 +1372,14 @@ YAHOO.widget.Node.prototype = {
      * Configures this node for dynamically obtaining the child data\r
      * when the node is first expanded.  Calling it without the callback\r
      * will turn off dynamic load for the node.\r
-     *\r
+     * @method setDynamicLoad\r
      * @param fmDataLoader {function} the function that will be used to get the data.\r
      * @param iconMode {int} configures the icon that is displayed when a dynamic\r
-     * load node is expanded the first time without children.  By default, the \r
+     * load node is expanded the first time without children.  By default, the\r
      * "collapse" icon will be used.  If set to 1, the leaf node icon will be\r
      * displayed.\r
      */\r
-    setDynamicLoad: function(fnDataLoader, iconMode) { \r
+    setDynamicLoad: function(fnDataLoader, iconMode) {\r
         if (fnDataLoader) {\r
             this.dataLoader = fnDataLoader;\r
             this._dynLoad = true;\r
@@ -1216,10 +1395,10 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Evaluates if this node is the root node of the tree\r
-     *\r
+     * @method isRoot\r
      * @return {boolean} true if this is the root node\r
      */\r
-    isRoot: function() { \r
+    isRoot: function() {\r
         return (this == this.tree.root);\r
     },\r
 \r
@@ -1228,15 +1407,21 @@ YAHOO.widget.Node.prototype = {
      * the property both in this instance and the root node.  If the tree is\r
      * defined to load all children dynamically, the data callback function is\r
      * defined in the root node\r
-     *\r
+     * @method isDynamic\r
      * @return {boolean} true if this node's children are to be loaded dynamically\r
      */\r
-    isDynamic: function() { \r
+    isDynamic: function() {\r
         var lazy = (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));\r
         // this.logger.log("isDynamic: " + lazy);\r
         return lazy;\r
     },\r
 \r
+    /**\r
+     * Returns the current icon mode.  This refers to the way childless dynamic\r
+     * load nodes appear.\r
+     * @method getIconMode\r
+     * @return {int} 0 for collapse style, 1 for leaf node style\r
+     */\r
     getIconMode: function() {\r
         return (this.iconMode || this.tree.root.iconMode);\r
     },\r
@@ -1245,21 +1430,22 @@ YAHOO.widget.Node.prototype = {
      * Checks if this node has children.  If this node is lazy-loading and the\r
      * children have not been rendered, we do not know whether or not there\r
      * are actual children.  In most cases, we need to assume that there are\r
-     * children (for instance, the toggle needs to show the expandable \r
+     * children (for instance, the toggle needs to show the expandable\r
      * presentation state).  In other times we want to know if there are rendered\r
      * children.  For the latter, "checkForLazyLoad" should be false.\r
-     *\r
+     * @method hasChildren\r
      * @param checkForLazyLoad {boolean} should we check for unloaded children?\r
      * @return {boolean} true if this has children or if it might and we are\r
      * checking for this condition.\r
      */\r
-    hasChildren: function(checkForLazyLoad) { \r
-        return ( this.children.length > 0 || \r
+    hasChildren: function(checkForLazyLoad) {\r
+        return ( this.children.length > 0 ||\r
                 (checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );\r
     },\r
 \r
     /**\r
      * Expands if node is collapsed, collapses otherwise.\r
+     * @method toggle\r
      */\r
     toggle: function() {\r
         if (!this.tree.locked && ( this.hasChildren(true) || this.isDynamic()) ) {\r
@@ -1269,10 +1455,13 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the markup for this node and its children.\r
-     *\r
+     * @method getHtml\r
      * @return {string} the markup for this node and its expanded children.\r
      */\r
     getHtml: function() {\r
+\r
+        this.childrenRendered = false;\r
+\r
         var sb = [];\r
         sb[sb.length] = '<div class="ygtvitem" id="' + this.getElId() + '">';\r
         sb[sb.length] = this.getNodeHtml();\r
@@ -1285,7 +1474,7 @@ YAHOO.widget.Node.prototype = {
      * Called when first rendering the tree.  We always build the div that will\r
      * contain this nodes children, but we don't render the children themselves\r
      * unless this node is expanded.\r
-     *\r
+     * @method getChildrenHtml\r
      * @return {string} the children container div html and any expanded children\r
      * @private\r
      */\r
@@ -1313,7 +1502,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Generates the markup for the child nodes.  This is not done until the node\r
      * is expanded.\r
-     *\r
+     * @method renderChildren\r
      * @return {string} the html for this node's children\r
      * @private\r
      */\r
@@ -1330,22 +1519,22 @@ YAHOO.widget.Node.prototype = {
             if (this.dataLoader) {\r
                 this.logger.log("Using dynamic loader defined for this node");\r
 \r
-                setTimeout( \r
+                setTimeout(\r
                     function() {\r
-                        node.dataLoader(node, \r
-                            function() { \r
-                                node.loadComplete(); \r
+                        node.dataLoader(node,\r
+                            function() {\r
+                                node.loadComplete();\r
                             });\r
                     }, 10);\r
-                \r
+\r
             } else if (this.tree.root.dataLoader) {\r
                 this.logger.log("Using the tree-level dynamic loader");\r
 \r
-                setTimeout( \r
+                setTimeout(\r
                     function() {\r
-                        node.tree.root.dataLoader(node, \r
-                            function() { \r
-                                node.loadComplete(); \r
+                        node.tree.root.dataLoader(node,\r
+                            function() {\r
+                                node.loadComplete();\r
                             });\r
                     }, 10);\r
 \r
@@ -1363,6 +1552,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Called when we know we have all the child data.\r
+     * @method completeRender\r
      * @return {string} children html\r
      */\r
     completeRender: function() {\r
@@ -1370,10 +1560,10 @@ YAHOO.widget.Node.prototype = {
         var sb = [];\r
 \r
         for (var i=0; i < this.children.length; ++i) {\r
-            this.children[i].childrenRendered = false;\r
+            // this.children[i].childrenRendered = false;\r
             sb[sb.length] = this.children[i].getHtml();\r
         }\r
-        \r
+\r
         this.childrenRendered = true;\r
 \r
         return sb.join("");\r
@@ -1382,6 +1572,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Load complete is the callback function we pass to the data provider\r
      * in dynamic load situations.\r
+     * @method loadComplete\r
      */\r
     loadComplete: function() {\r
         this.logger.log("loadComplete: " + this.index);\r
@@ -1394,7 +1585,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns this node's ancestor at the specified depth.\r
-     *\r
+     * @method getAncestor\r
      * @param {int} depth the depth of the ancestor.\r
      * @return {Node} the ancestor\r
      */\r
@@ -1405,7 +1596,7 @@ YAHOO.widget.Node.prototype = {
         }\r
 \r
         var p = this.parent;\r
-        \r
+\r
         while (p.depth > depth) {\r
             p = p.parent;\r
         }\r
@@ -1418,29 +1609,30 @@ YAHOO.widget.Node.prototype = {
      * this node.  If this node's ancestor at the specified depth\r
      * has a next sibling the presentation is different than if it\r
      * does not have a next sibling\r
-     *\r
+     * @method getDepthStyle\r
      * @param {int} depth the depth of the ancestor.\r
      * @return {string} the css class for the spacer\r
      */\r
     getDepthStyle: function(depth) {\r
-        return (this.getAncestor(depth).nextSibling) ? \r
+        return (this.getAncestor(depth).nextSibling) ?\r
             "ygtvdepthcell" : "ygtvblankdepthcell";\r
     },\r
 \r
     /**\r
      * Get the markup for the node.  This is designed to be overrided so that we can\r
      * support different types of nodes.\r
-     *\r
+     * @method getNodeHtml\r
      * @return {string} The HTML that will render this node.\r
      */\r
-    getNodeHtml: function() { \r
+    getNodeHtml: function() {\r
         this.logger.log("Generating html");\r
-        return ""; \r
+        return "";\r
     },\r
 \r
     /**\r
      * Regenerates the html for this node and its children.  To be used when the\r
      * node is expanded and new children have been added.\r
+     * @method refresh\r
      */\r
     refresh: function() {\r
         // this.loadComplete();\r
@@ -1455,7 +1647,8 @@ YAHOO.widget.Node.prototype = {
     },\r
 \r
     /**\r
-     * toString\r
+     * Node toString\r
+     * @method toString\r
      * @return {string} string representation of the node\r
      */\r
     toString: function() {\r
@@ -1464,11 +1657,15 @@ YAHOO.widget.Node.prototype = {
 \r
 };\r
 \r
+YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);\r
+\r
 /**\r
- * A custom YAHOO.widget.Node that handles the unique nature of \r
+ * A custom YAHOO.widget.Node that handles the unique nature of\r
  * the virtual, presentationless root node.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class RootNode\r
  * @extends YAHOO.widget.Node\r
+ * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to\r
  * @constructor\r
  */\r
 YAHOO.widget.RootNode = function(oTree) {\r
@@ -1476,30 +1673,30 @@ YAHOO.widget.RootNode = function(oTree) {
        // special case where the node has no presentation.  So we have\r
        // to alter the standard properties a bit.\r
        this.init(null, null, true);\r
-       \r
-       /**\r
+\r
+       /*\r
         * For the root node, we get the tree reference from as a param\r
         * to the constructor instead of from the parent element.\r
-        *\r
-        * @type TreeView\r
         */\r
        this.tree = oTree;\r
 };\r
 \r
-YAHOO.widget.RootNode.prototype = new YAHOO.widget.Node();\r
+YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.RootNode.prototype.getNodeHtml = function() { \r
-       return ""; \r
-};\r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() {\r
+        return "";\r
+    },\r
 \r
-YAHOO.widget.RootNode.prototype.toString = function() { \r
-    return "RootNode";\r
-};\r
+    toString: function() {\r
+        return "RootNode";\r
+    },\r
 \r
-YAHOO.widget.RootNode.prototype.loadComplete = function() { \r
-    this.tree.draw();\r
-};\r
+    loadComplete: function() {\r
+        this.tree.draw();\r
+    }\r
+\r
+});\r
 /**\r
  * The default node presentation.  The first parameter should be\r
  * either a string that will be used as the node's label, or an object\r
@@ -1507,7 +1704,8 @@ YAHOO.widget.RootNode.prototype.loadComplete = function() {
  * label will toggle the expanded/collapsed state of the node.  By\r
  * changing the href property of the instance, this behavior can be\r
  * changed so that the label will go to the specified href.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class TextNode\r
  * @extends YAHOO.widget.Node\r
  * @constructor\r
  * @param oData {object} a string or object containing the data that will\r
@@ -1516,203 +1714,230 @@ YAHOO.widget.RootNode.prototype.loadComplete = function() {
  * @param expanded {boolean} the initial expanded/collapsed state\r
  */\r
 YAHOO.widget.TextNode = function(oData, oParent, expanded) {\r
-    // this.type = "TextNode";\r
 \r
-    if (oData) { \r
+    if (oData) {\r
         this.init(oData, oParent, expanded);\r
         this.setUpLabel(oData);\r
     }\r
 \r
-    /**\r
-     * @private\r
-     */\r
     this.logger     = new YAHOO.widget.LogWriter(this.toString());\r
 };\r
 \r
-YAHOO.widget.TextNode.prototype = new YAHOO.widget.Node();\r
+YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {\r
 \r
-/**\r
- * The CSS class for the label href.  Defaults to ygtvlabel, but can be\r
- * overridden to provide a custom presentation for a specific node.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.labelStyle = "ygtvlabel";\r
+    /**\r
    * The CSS class for the label href.  Defaults to ygtvlabel, but can be\r
    * overridden to provide a custom presentation for a specific node.\r
+     * @property labelStyle\r
    * @type string\r
    */\r
+    labelStyle: "ygtvlabel",\r
 \r
-/**\r
- * The derived element id of the label for this node\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.labelElId = null;\r
+    /**\r
    * The derived element id of the label for this node\r
+     * @property labelElId\r
    * @type string\r
    */\r
+    labelElId: null,\r
 \r
-/**\r
- * The text for the label.  It is assumed that the oData parameter will\r
- * either be a string that will be used as the label, or an object that\r
- * has a property called "label" that we will use.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.label = null;\r
+    /**\r
    * The text for the label.  It is assumed that the oData parameter will\r
    * either be a string that will be used as the label, or an object that\r
    * has a property called "label" that we will use.\r
+     * @property label\r
    * @type string\r
    */\r
+    label: null,\r
 \r
-/**\r
- * Sets up the node label\r
- * \r
- * @param oData string containing the label, or an object with a label property\r
- */\r
-YAHOO.widget.TextNode.prototype.setUpLabel = function(oData) { \r
-    if (typeof oData == "string") {\r
-        oData = { label: oData };\r
-    }\r
-    this.label = oData.label;\r
-    \r
-    // update the link\r
-    if (oData.href) {\r
-        this.href = oData.href;\r
-    }\r
+    textNodeParentChange: function() {\r
 \r
-    // set the target\r
-    if (oData.target) {\r
-        this.target = oData.target;\r
-    }\r
+        /**\r
+         * Custom event that is fired when the text node label is clicked.  The\r
+         * custom event is defined on the tree instance, so there is a single\r
+         * event that handles all nodes in the tree.  The node clicked is\r
+         * provided as an argument\r
+         *\r
+         * @event labelClick\r
+         * @for YAHOO.widget.TreeView\r
+         * @param {YAHOO.widget.Node} node the node clicked\r
+         */\r
+        if (this.tree && !this.tree.hasEvent("labelClick")) {\r
+            this.tree.createEvent("labelClick", this.tree);\r
+        }\r
 \r
-    if (oData.style) {\r
-        this.labelStyle = oData.style;\r
-    }\r
+    },\r
 \r
-    this.labelElId = "ygtvlabelel" + this.index;\r
-};\r
+    /**\r
+     * Sets up the node label\r
+     * @method setUpLabel\r
+     * @param oData string containing the label, or an object with a label property\r
+     */\r
+    setUpLabel: function(oData) {\r
 \r
-/**\r
- * Returns the label element\r
- *\r
- * @return {object} the element\r
- */\r
-YAHOO.widget.TextNode.prototype.getLabelEl = function() { \r
-    return document.getElementById(this.labelElId);\r
-};\r
+        // set up the custom event on the tree\r
+        this.textNodeParentChange();\r
+        this.subscribe("parentChange", this.textNodeParentChange);\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.TextNode.prototype.getNodeHtml = function() { \r
-    this.logger.log("Generating html");\r
-    var sb = [];\r
+        if (typeof oData == "string") {\r
+            oData = { label: oData };\r
+        }\r
+        this.label = oData.label;\r
 \r
-    sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
-    sb[sb.length] = '<tr>';\r
-    \r
-    for (i=0;i<this.depth;++i) {\r
-        // sb[sb.length] = '<td class="ygtvdepthcell">&#160;</td>';\r
-        sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
-    }\r
+        // update the link\r
+        if (oData.href) {\r
+            this.href = oData.href;\r
+        }\r
 \r
-    var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
-                    this.tree.id + '\',' + this.index + ')';\r
-\r
-    sb[sb.length] = '<td';\r
-    // sb[sb.length] = ' onselectstart="return false"';\r
-    sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
-    sb[sb.length] = ' class="' + this.getStyle() + '"';\r
-    if (this.hasChildren(true)) {\r
-        sb[sb.length] = ' onmouseover="this.className=';\r
-        sb[sb.length] = getNode + '.getHoverStyle()"';\r
-        sb[sb.length] = ' onmouseout="this.className=';\r
-        sb[sb.length] = getNode + '.getStyle()"';\r
-    }\r
-    sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
+        // set the target\r
+        if (oData.target) {\r
+            this.target = oData.target;\r
+        }\r
 \r
-    /*\r
-    sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
-    sb[sb.length] = ' alt=""';\r
-    sb[sb.length] = ' tabindex=0';\r
-    sb[sb.length] = ' src="' + this.spacerPath + '"';\r
-    sb[sb.length] = ' title="' + this.getStateText() + '"';\r
-    sb[sb.length] = ' class="ygtvspacer"';\r
-    // sb[sb.length] = ' onkeypress="return ' + getNode + '".onKeyPress()"';\r
-    sb[sb.length] = ' />';\r
-    */\r
+        if (oData.style) {\r
+            this.labelStyle = oData.style;\r
+        }\r
 \r
-    sb[sb.length] = '&#160;';\r
-\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '<td>';\r
-    sb[sb.length] = '<a';\r
-    sb[sb.length] = ' id="' + this.labelElId + '"';\r
-    sb[sb.length] = ' class="' + this.labelStyle + '"';\r
-    sb[sb.length] = ' href="' + this.href + '"';\r
-    sb[sb.length] = ' target="' + this.target + '"';\r
-    sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';\r
-    if (this.hasChildren(true)) {\r
-        sb[sb.length] = ' onmouseover="document.getElementById(\'';\r
-        sb[sb.length] = this.getToggleElId() + '\').className=';\r
-        sb[sb.length] = getNode + '.getHoverStyle()"';\r
-        sb[sb.length] = ' onmouseout="document.getElementById(\'';\r
-        sb[sb.length] = this.getToggleElId() + '\').className=';\r
-        sb[sb.length] = getNode + '.getStyle()"';\r
-    }\r
-    sb[sb.length] = ' >';\r
-    sb[sb.length] = this.label;\r
-    sb[sb.length] = '</a>';\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '</tr>';\r
-    sb[sb.length] = '</table>';\r
-\r
-    return sb.join("");\r
-};\r
+        this.labelElId = "ygtvlabelel" + this.index;\r
+    },\r
 \r
+    /**\r
+     * Returns the label element\r
+     * @for YAHOO.widget.TextNode\r
+     * @method getLabelEl\r
+     * @return {object} the element\r
+     */\r
+    getLabelEl: function() {\r
+        return document.getElementById(this.labelElId);\r
+    },\r
 \r
-/**\r
- * Executed when the label is clicked\r
- * @param me {Node} this node\r
- * @scope the anchor tag clicked\r
- * @return false to cancel the anchor click\r
- */\r
-YAHOO.widget.TextNode.prototype.onLabelClick = function(me) { \r
-    me.logger.log("onLabelClick " + this.label);\r
-    //return true;\r
-};\r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() {\r
+        this.logger.log("Generating html");\r
+        var sb = [];\r
 \r
-YAHOO.widget.TextNode.prototype.toString = function() { \r
-    return "TextNode (" + this.index + ") " + this.label;\r
-};\r
+        sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
+        sb[sb.length] = '<tr>';\r
+\r
+        for (var i=0;i<this.depth;++i) {\r
+            // sb[sb.length] = '<td class="ygtvdepthcell">&#160;</td>';\r
+            sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
+        }\r
+\r
+        var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
+                        this.tree.id + '\',' + this.index + ')';\r
+\r
+        sb[sb.length] = '<td';\r
+        // sb[sb.length] = ' onselectstart="return false"';\r
+        sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
+        sb[sb.length] = ' class="' + this.getStyle() + '"';\r
+        if (this.hasChildren(true)) {\r
+            sb[sb.length] = ' onmouseover="this.className=';\r
+            sb[sb.length] = getNode + '.getHoverStyle()"';\r
+            sb[sb.length] = ' onmouseout="this.className=';\r
+            sb[sb.length] = getNode + '.getStyle()"';\r
+        }\r
+        sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
+\r
+        /*\r
+        sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
+        sb[sb.length] = ' alt=""';\r
+        sb[sb.length] = ' tabindex=0';\r
+        sb[sb.length] = ' src="' + this.spacerPath + '"';\r
+        sb[sb.length] = ' title="' + this.getStateText() + '"';\r
+        sb[sb.length] = ' class="ygtvspacer"';\r
+        // sb[sb.length] = ' onkeypress="return ' + getNode + '".onKeyPress()"';\r
+        sb[sb.length] = ' />';\r
+        */\r
+\r
+        sb[sb.length] = '&#160;';\r
+\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '<td>';\r
+        sb[sb.length] = '<a';\r
+        sb[sb.length] = ' id="' + this.labelElId + '"';\r
+        sb[sb.length] = ' class="' + this.labelStyle + '"';\r
+        sb[sb.length] = ' href="' + this.href + '"';\r
+        sb[sb.length] = ' target="' + this.target + '"';\r
+        sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';\r
+        if (this.hasChildren(true)) {\r
+            sb[sb.length] = ' onmouseover="document.getElementById(\'';\r
+            sb[sb.length] = this.getToggleElId() + '\').className=';\r
+            sb[sb.length] = getNode + '.getHoverStyle()"';\r
+            sb[sb.length] = ' onmouseout="document.getElementById(\'';\r
+            sb[sb.length] = this.getToggleElId() + '\').className=';\r
+            sb[sb.length] = getNode + '.getStyle()"';\r
+        }\r
+        sb[sb.length] = ' >';\r
+        sb[sb.length] = this.label;\r
+        sb[sb.length] = '</a>';\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '</tr>';\r
+        sb[sb.length] = '</table>';\r
 \r
+        return sb.join("");\r
+    },\r
+\r
+\r
+    /**\r
+     * Executed when the label is clicked.  Fires the labelClick custom event.\r
+     * @method onLabelClick\r
+     * @param me {Node} this node\r
+     * @scope the anchor tag clicked\r
+     * @return false to cancel the anchor click\r
+     */\r
+    onLabelClick: function(me) {\r
+        me.logger.log("onLabelClick " + me.label);\r
+        return me.tree.fireEvent("labelClick", me);\r
+        //return true;\r
+    },\r
+\r
+    toString: function() {\r
+        return "TextNode (" + this.index + ") " + this.label;\r
+    }\r
+\r
+});\r
 /**\r
- * A menu-specific implementation that differs from TextNode in that only \r
+ * A menu-specific implementation that differs from TextNode in that only\r
  * one sibling can be expanded at a time.\r
+ * @namespace YAHOO.widget\r
+ * @class MenuNode\r
  * @extends YAHOO.widget.TextNode\r
+ * @param oData {object} a string or object containing the data that will\r
+ * be used to render this node\r
+ * @param oParent {YAHOO.widget.Node} this node's parent node\r
+ * @param expanded {boolean} the initial expanded/collapsed state\r
  * @constructor\r
  */\r
 YAHOO.widget.MenuNode = function(oData, oParent, expanded) {\r
-       if (oData) { \r
+       if (oData) {\r
                this.init(oData, oParent, expanded);\r
                this.setUpLabel(oData);\r
        }\r
 \r
-    /**\r
+    /*\r
      * Menus usually allow only one branch to be open at a time.\r
-     * @type boolean\r
      */\r
        this.multiExpand = false;\r
 \r
-    /**\r
-     * @private\r
-     */\r
     this.logger     = new YAHOO.widget.LogWriter(this.toString());\r
 \r
 };\r
 \r
-YAHOO.widget.MenuNode.prototype = new YAHOO.widget.TextNode();\r
+YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {\r
 \r
-YAHOO.widget.MenuNode.prototype.toString = function() { \r
-    return "MenuNode (" + this.index + ") " + this.label;\r
-};\r
+    toString: function() {\r
+        return "MenuNode (" + this.index + ") " + this.label;\r
+    }\r
 \r
+});\r
 /**\r
  * This implementation takes either a string or object for the\r
  * oData argument.  If is it a string, we will use it for the display\r
  * of this node (and it can contain any html code).  If the parameter\r
  * is an object, we look for a parameter called "html" that will be\r
  * used for this node's display.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class HTMLNode\r
  * @extends YAHOO.widget.Node\r
  * @constructor\r
  * @param oData {object} a string or object containing the data that will\r
@@ -1723,139 +1948,140 @@ YAHOO.widget.MenuNode.prototype.toString = function() {
  * have an icon\r
  */\r
 YAHOO.widget.HTMLNode = function(oData, oParent, expanded, hasIcon) {\r
-    if (oData) { \r
+    if (oData) {\r
         this.init(oData, oParent, expanded);\r
         this.initContent(oData, hasIcon);\r
     }\r
 };\r
 \r
-YAHOO.widget.HTMLNode.prototype = new YAHOO.widget.Node();\r
+YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {\r
 \r
-/**\r
- * The CSS class for the html content container.  Defaults to ygtvhtml, but \r
- * can be overridden to provide a custom presentation for a specific node.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.contentStyle = "ygtvhtml";\r
+    /**\r
+     * The CSS class for the html content container.  Defaults to ygtvhtml, but\r
    * can be overridden to provide a custom presentation for a specific node.\r
+     * @property contentStyle\r
    * @type string\r
    */\r
+    contentStyle: "ygtvhtml",\r
 \r
-/**\r
- * The generated id that will contain the data passed in by the implementer.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.contentElId = null;\r
+    /**\r
    * The generated id that will contain the data passed in by the implementer.\r
+     * @property contentElId\r
    * @type string\r
    */\r
+    contentElId: null,\r
 \r
-/**\r
- * The HTML content to use for this node's display\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.content = null;\r
+    /**\r
    * The HTML content to use for this node's display\r
+     * @property content\r
    * @type string\r
    */\r
+    content: null,\r
 \r
-/**\r
- * Sets up the node label\r
- *\r
- * @param {object} An html string or object containing an html property\r
- * @param {boolean} hasIcon determines if the node will be rendered with an\r
- * icon or not\r
- */\r
-YAHOO.widget.HTMLNode.prototype.initContent = function(oData, hasIcon) { \r
-    if (typeof oData == "string") {\r
-        oData = { html: oData };\r
-    }\r
+    /**\r
+     * Sets up the node label\r
+     * @property initContent\r
+     * @param {object} An html string or object containing an html property\r
+     * @param {boolean} hasIcon determines if the node will be rendered with an\r
+     * icon or not\r
+     */\r
+    initContent: function(oData, hasIcon) {\r
+        if (typeof oData == "string") {\r
+            oData = { html: oData };\r
+        }\r
+\r
+        this.html = oData.html;\r
+        this.contentElId = "ygtvcontentel" + this.index;\r
+        this.hasIcon = hasIcon;\r
 \r
-    this.html = oData.html;\r
-    this.contentElId = "ygtvcontentel" + this.index;\r
-    this.hasIcon = hasIcon;\r
+        this.logger = new YAHOO.widget.LogWriter(this.toString());\r
+    },\r
 \r
     /**\r
-     * @private\r
+     * Returns the outer html element for this node's content\r
+     * @method getContentEl\r
+     * @return {HTMLElement} the element\r
      */\r
-    this.logger = new YAHOO.widget.LogWriter(this.toString());\r
-};\r
+    getContentEl: function() {\r
+        return document.getElementById(this.contentElId);\r
+    },\r
 \r
-/**\r
- * Returns the outer html element for this node's content\r
- *\r
- * @return {HTMLElement} the element\r
- */\r
-YAHOO.widget.HTMLNode.prototype.getContentEl = function() { \r
-    return document.getElementById(this.contentElId);\r
-};\r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() {\r
+        this.logger.log("Generating html");\r
+        var sb = [];\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.HTMLNode.prototype.getNodeHtml = function() { \r
-    this.logger.log("Generating html");\r
-    var sb = [];\r
+        sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
+        sb[sb.length] = '<tr>';\r
 \r
-    sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
-    sb[sb.length] = '<tr>';\r
-    \r
-    for (i=0;i<this.depth;++i) {\r
-        sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
-    }\r
+        for (var i=0;i<this.depth;++i) {\r
+            sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
+        }\r
 \r
-    if (this.hasIcon) {\r
-        sb[sb.length] = '<td';\r
-        sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
-        sb[sb.length] = ' class="' + this.getStyle() + '"';\r
-        sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '"';\r
-        if (this.hasChildren(true)) {\r
-            sb[sb.length] = ' onmouseover="this.className=';\r
-            sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
-            sb[sb.length] = this.tree.id + '\',' + this.index +  ').getHoverStyle()"';\r
-            sb[sb.length] = ' onmouseout="this.className=';\r
-            sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
-            sb[sb.length] = this.tree.id + '\',' + this.index +  ').getStyle()"';\r
+        if (this.hasIcon) {\r
+            sb[sb.length] = '<td';\r
+            sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
+            sb[sb.length] = ' class="' + this.getStyle() + '"';\r
+            sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '"';\r
+            if (this.hasChildren(true)) {\r
+                sb[sb.length] = ' onmouseover="this.className=';\r
+                sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
+                sb[sb.length] = this.tree.id + '\',' + this.index +  ').getHoverStyle()"';\r
+                sb[sb.length] = ' onmouseout="this.className=';\r
+                sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
+                sb[sb.length] = this.tree.id + '\',' + this.index +  ').getStyle()"';\r
+            }\r
+            sb[sb.length] = '>&#160;</td>';\r
         }\r
-        sb[sb.length] = '>&#160;</td>';\r
-    }\r
 \r
-    sb[sb.length] = '<td';\r
-    sb[sb.length] = ' id="' + this.contentElId + '"';\r
-    sb[sb.length] = ' class="' + this.contentStyle + '"';\r
-    sb[sb.length] = ' >';\r
-    sb[sb.length] = this.html;\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '</tr>';\r
-    sb[sb.length] = '</table>';\r
+        sb[sb.length] = '<td';\r
+        sb[sb.length] = ' id="' + this.contentElId + '"';\r
+        sb[sb.length] = ' class="' + this.contentStyle + '"';\r
+        sb[sb.length] = ' >';\r
+        sb[sb.length] = this.html;\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '</tr>';\r
+        sb[sb.length] = '</table>';\r
 \r
-    return sb.join("");\r
-};\r
+        return sb.join("");\r
+    },\r
 \r
-YAHOO.widget.HTMLNode.prototype.toString = function() { \r
-    return "HTMLNode (" + this.index + ")";\r
-};\r
+    toString: function() {\r
+        return "HTMLNode (" + this.index + ")";\r
+    }\r
 \r
+});\r
 /**\r
  * A static factory class for tree view expand/collapse animations\r
- *\r
- * @constructor\r
+ * @class TVAnim\r
+ * @static\r
  */\r
 YAHOO.widget.TVAnim = function() {\r
     return {\r
         /**\r
          * Constant for the fade in animation\r
-         * \r
+         * @property FADE_IN\r
          * @type string\r
+         * @static\r
          */\r
         FADE_IN: "TVFadeIn",\r
 \r
         /**\r
          * Constant for the fade out animation\r
-         * \r
+         * @property FADE_OUT\r
          * @type string\r
+         * @static\r
          */\r
         FADE_OUT: "TVFadeOut",\r
 \r
         /**\r
          * Returns a ygAnim instance of the given type\r
-         *\r
+         * @method getAnim\r
          * @param type {string} the type of animation\r
          * @param el {HTMLElement} the element to element (probably the children div)\r
          * @param callback {function} function to invoke when the animation is done.\r
          * @return {YAHOO.util.Animation} the animation instance\r
+         * @static\r
          */\r
         getAnim: function(type, el, callback) {\r
             if (YAHOO.widget[type]) {\r
@@ -1867,9 +2093,10 @@ YAHOO.widget.TVAnim = function() {
 \r
         /**\r
          * Returns true if the specified animation class is available\r
-         *\r
+         * @method isValid\r
          * @param type {string} the type of animation\r
          * @return {boolean} true if valid, false if not\r
+         * @static\r
          */\r
         isValid: function(type) {\r
             return (YAHOO.widget[type]);\r
@@ -1879,7 +2106,7 @@ YAHOO.widget.TVAnim = function() {
 \r
 /**\r
  * A 1/2 second fade-in animation.\r
- *\r
+ * @class TVFadeIn\r
  * @constructor\r
  * @param el {HTMLElement} the element to animate\r
  * @param callback {function} function to invoke when the animation is finished\r
@@ -1887,27 +2114,26 @@ YAHOO.widget.TVAnim = function() {
 YAHOO.widget.TVFadeIn = function(el, callback) {\r
     /**\r
      * The element to animate\r
+     * @property el\r
      * @type HTMLElement\r
      */\r
     this.el = el;\r
 \r
     /**\r
      * the callback to invoke when the animation is complete\r
-     *\r
+     * @property callback\r
      * @type function\r
      */\r
     this.callback = callback;\r
 \r
-    /**\r
-     * @private\r
-     */\r
     this.logger = new YAHOO.widget.LogWriter(this.toString());\r
 };\r
 \r
-/**\r
- * Performs the animation\r
- */\r
 YAHOO.widget.TVFadeIn.prototype = {\r
+    /**\r
+     * Performs the animation\r
+     * @method animate\r
+     */\r
     animate: function() {\r
         var tvanim = this;\r
 \r
@@ -1916,14 +2142,7 @@ YAHOO.widget.TVFadeIn.prototype = {
         s.filter = "alpha(opacity=10)";\r
         s.display = "";\r
 \r
-        // var dur = ( navigator.userAgent.match(/msie/gi) ) ? 0.05 : 0.4;\r
-        var dur = 0.4; \r
-        // this.logger.log("duration: " + dur);\r
-        // var a = new ygAnim_Fade(this.el, dur, 1);\r
-        // a.setStart(0.1);\r
-        // a.onComplete = function() { tvanim.onComplete(); };\r
-\r
-        // var a = new YAHOO.util.Anim(this.el, 'opacity', 0.1, 1);\r
+        var dur = 0.4;\r
         var a = new YAHOO.util.Anim(this.el, {opacity: {from: 0.1, to: 1, unit:""}}, dur);\r
         a.onComplete.subscribe( function() { tvanim.onComplete(); } );\r
         a.animate();\r
@@ -1931,11 +2150,17 @@ YAHOO.widget.TVFadeIn.prototype = {
 \r
     /**\r
      * Clean up and invoke callback\r
+     * @method onComplete\r
      */\r
     onComplete: function() {\r
         this.callback();\r
     },\r
 \r
+    /**\r
+     * toString\r
+     * @method toString\r
+     * @return {string} the string representation of the instance\r
+     */\r
     toString: function() {\r
         return "TVFadeIn";\r
     }\r
@@ -1943,7 +2168,7 @@ YAHOO.widget.TVFadeIn.prototype = {
 \r
 /**\r
  * A 1/2 second fade out animation.\r
- *\r
+ * @class TVFadeOut\r
  * @constructor\r
  * @param el {HTMLElement} the element to animate\r
  * @param callback {Function} function to invoke when the animation is finished\r
@@ -1951,36 +2176,29 @@ YAHOO.widget.TVFadeIn.prototype = {
 YAHOO.widget.TVFadeOut = function(el, callback) {\r
     /**\r
      * The element to animate\r
+     * @property el\r
      * @type HTMLElement\r
      */\r
     this.el = el;\r
 \r
     /**\r
      * the callback to invoke when the animation is complete\r
-     *\r
+     * @property callback\r
      * @type function\r
      */\r
     this.callback = callback;\r
 \r
-    /**\r
-     * @private\r
-     */\r
     this.logger = new YAHOO.widget.LogWriter(this.toString());\r
 };\r
 \r
-/**\r
- * Performs the animation\r
- */\r
 YAHOO.widget.TVFadeOut.prototype = {\r
+    /**\r
+     * Performs the animation\r
+     * @method animate\r
+     */\r
     animate: function() {\r
         var tvanim = this;\r
-        // var dur = ( navigator.userAgent.match(/msie/gi) ) ? 0.05 : 0.4;\r
         var dur = 0.4;\r
-        // this.logger.log("duration: " + dur);\r
-        // var a = new ygAnim_Fade(this.el, dur, 0.1);\r
-        // a.onComplete = function() { tvanim.onComplete(); };\r
-\r
-        // var a = new YAHOO.util.Anim(this.el, 'opacity', 1, 0.1);\r
         var a = new YAHOO.util.Anim(this.el, {opacity: {from: 1, to: 0.1, unit:""}}, dur);\r
         a.onComplete.subscribe( function() { tvanim.onComplete(); } );\r
         a.animate();\r
@@ -1988,6 +2206,7 @@ YAHOO.widget.TVFadeOut.prototype = {
 \r
     /**\r
      * Clean up and invoke callback\r
+     * @method onComplete\r
      */\r
     onComplete: function() {\r
         var s = this.el.style;\r
@@ -1997,6 +2216,11 @@ YAHOO.widget.TVFadeOut.prototype = {
         this.callback();\r
     },\r
 \r
+    /**\r
+     * toString\r
+     * @method toString\r
+     * @return {string} the string representation of the instance\r
+     */\r
     toString: function() {\r
         return "TVFadeOut";\r
     }\r
index 1cac0b65fbc723523d7bebb70ad6e1a3c6430bd3..9d808ff5250749675869c310cc2820139353bbd7 100755 (executable)
@@ -1 +1 @@
-/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(_2){if(YAHOO.widget.TVAnim.isValid(_2)){this._expandAnim=_2;}},setCollapseAnim:function(_3){if(YAHOO.widget.TVAnim.isValid(_3)){this._collapseAnim=_3;}},animateExpand:function(el){if(this._expandAnim&&this._animCount<this.maxAnim){var _5=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){_5.expandComplete();});if(a){++this._animCount;a.animate();}return true;}return false;},animateCollapse:function(el){if(this._collapseAnim&&this._animCount<this.maxAnim){var _7=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){_7.collapseComplete();});if(a){++this._animCount;a.animate();}return true;}return false;},expandComplete:function(){--this._animCount;},collapseComplete:function(){--this._animCount;},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);},draw:function(){var _8=this.root.getHtml();this.getEl().innerHTML=_8;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}return this._el;},regNode:function(_9){this._nodes[_9.index]=_9;},getRoot:function(){return this.root;},setDynamicLoad:function(_10,_11){this.root.setDynamicLoad(_10,_11);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(_12){var n=this._nodes[_12];return (n)?n:null;},getNodeByProperty:function(_14,_15){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_15==n.data[_14]){return n;}}return null;},getNodesByProperty:function(_17,_18){var _19=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_18==n.data[_17]){_19.push(n);}}return (_19.length)?_19:null;},removeNode:function(_20,_21){if(_20.isRoot()){return false;}var p=_20.parent;if(p.parent){p=p.parent;}this._deleteNode(_20);if(_21&&p&&p.childrenRendered){p.refresh();}return true;},removeChildren:function(_23){while(_23.children.length){this._deleteNode(_23.children[0]);}_23.childrenRendered=false;_23.dynamicLoadComplete=false;_23.expand();_23.collapse();},_deleteNode:function(_24){this.removeChildren(_24);this.popNode(_24);},popNode:function(_25){var p=_25.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=_25){a[a.length]=p.children[i];}}p.children=a;p.childrenRendered=false;if(_25.previousSibling){_25.previousSibling.nextSibling=_25.nextSibling;}if(_25.nextSibling){_25.nextSibling.previousSibling=_25.previousSibling;}delete this._nodes[_25.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(_26){},onCollapse:function(_27){}};YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(_28){var t=YAHOO.widget.TreeView.trees[_28];return (t)?t:null;};YAHOO.widget.TreeView.getNode=function(_30,_31){var t=YAHOO.widget.TreeView.getTree(_30);return (t)?t.getNodeByIndex(_31):null;};YAHOO.widget.TreeView.addHandler=function(el,_32,fn,_34){_34=(_34)?true:false;if(el.addEventListener){el.addEventListener(_32,fn,_34);}else{if(el.attachEvent){el.attachEvent("on"+_32,fn);}else{el["on"+_32]=fn;}}};YAHOO.widget.TreeView.preload=function(_35){_35=_35||"ygtv";var _36=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<_36.length;++i){sb[sb.length]="<span class=\""+_35+_36[i]+"\">&#160;</span>";}var f=document.createElement("DIV");var s=f.style;s.position="absolute";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(_40,_41,_42){if(_40){this.init(_40,_41,_42);}};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,_type:"Node",init:function(_43,_44,_45){this.data=_43;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=_45;if(_44){_44.appendChild(this);}},applyParent:function(_46){if(!_46){return false;}this.tree=_46.tree;this.parent=_46;this.depth=_46.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}if(!this.multiExpand){this.multiExpand=_46.multiExpand;}this.tree.regNode(this);_46.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}return true;},appendChild:function(_47){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=_47;_47.previousSibling=sib;}this.children[this.children.length]=_47;_47.applyParent(this);return _47;},appendTo:function(_49){return _49.appendChild(this);},insertBefore:function(_50){var p=_50.parent;if(p){if(this.tree){this.tree.popNode(this);}var _51=_50.isChildOf(p);p.children.splice(_51,0,this);if(_50.previousSibling){_50.previousSibling.nextSibling=this;}this.previousSibling=_50.previousSibling;this.nextSibling=_50;_50.previousSibling=this;this.applyParent(p);}return this;},insertAfter:function(_52){var p=_52.parent;if(p){if(this.tree){this.tree.popNode(this);}var _53=_52.isChildOf(p);if(!_52.nextSibling){return this.appendTo(p);}p.children.splice(_53+1,0,this);_52.nextSibling.previousSibling=this;this.previousSibling=_52;this.nextSibling=_52.nextSibling;_52.nextSibling=this;this.applyParent(p);}return this;},isChildOf:function(_54){if(_54&&_54.children){for(var i=0,len=_54.children.length;i<len;++i){if(_54.children[i]===this){return i;}}}return -1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl())){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl())){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("undefined"!=typeof ret&&!ret){return;}if(!this.getEl()){this.expanded=false;return;}this.hideChildren();this.expanded=false;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}},expand:function(){if(this.expanded){return;}var ret=this.tree.onExpand(this);if("undefined"!=typeof ret&&!ret){return;}if(!this.getEl()){this.expanded=true;return;}if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}this.expanded=true;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}if(this.isLoading){this.expanded=false;return;}if(!this.multiExpand){var _56=this.getSiblings();for(var i=0;i<_56.length;++i){if(_56[i]!=this&&_56[i].expanded){_56[i].collapse();}}}this.showChildren();},getStyle:function(){if(this.isLoading){return "ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var _58="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){_58=(this.expanded)?"m":"p";}return "ygtv"+loc+_58;}},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(_60,_61){if(_60){this.dataLoader=_60;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}if(_61){this.iconMode=_61;}},isRoot:function(){return (this==this.tree.root);},isDynamic:function(){var _62=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return _62;},getIconMode:function(){return (this.iconMode||this.tree.root.iconMode);},hasChildren:function(_63){return (this.children.length>0||(_63&&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(){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){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 _64=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){_64.dataLoader(_64,function(){_64.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){_64.tree.root.dataLoader(_64,function(){_64.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){this.children[i].childrenRendered=false;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(_65){if(_65>=this.depth||_65<0){return null;}var p=this.parent;while(p.depth>_65){p=p.parent;}return p;},getDepthStyle:function(_66){return (this.getAncestor(_66).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.widget.RootNode=function(_67){this.init(null,null,true);this.tree=_67;};YAHOO.widget.RootNode.prototype=new YAHOO.widget.Node();YAHOO.widget.RootNode.prototype.getNodeHtml=function(){return "";};YAHOO.widget.RootNode.prototype.toString=function(){return "RootNode";};YAHOO.widget.RootNode.prototype.loadComplete=function(){this.tree.draw();};YAHOO.widget.TextNode=function(_68,_69,_70){if(_68){this.init(_68,_69,_70);this.setUpLabel(_68);}};YAHOO.widget.TextNode.prototype=new YAHOO.widget.Node();YAHOO.widget.TextNode.prototype.labelStyle="ygtvlabel";YAHOO.widget.TextNode.prototype.labelElId=null;YAHOO.widget.TextNode.prototype.label=null;YAHOO.widget.TextNode.prototype.setUpLabel=function(_71){if(typeof _71=="string"){_71={label:_71};}this.label=_71.label;if(_71.href){this.href=_71.href;}if(_71.target){this.target=_71.target;}if(_71.style){this.labelStyle=_71.style;}this.labelElId="ygtvlabelel"+this.index;};YAHOO.widget.TextNode.prototype.getLabelEl=function(){return document.getElementById(this.labelElId);};YAHOO.widget.TextNode.prototype.getNodeHtml=function(){var sb=[];sb[sb.length]="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";sb[sb.length]="<tr>";for(i=0;i<this.depth;++i){sb[sb.length]="<td class=\""+this.getDepthStyle(i)+"\">&#160;</td>";}var _72="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]=_72+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"this.className=";sb[sb.length]=_72+".getStyle()\"";}sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\">";sb[sb.length]="&#160;";sb[sb.length]="</td>";sb[sb.length]="<td>";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 "+_72+".onLabelClick("+_72+")\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_72+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_72+".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("");};YAHOO.widget.TextNode.prototype.onLabelClick=function(me){};YAHOO.widget.TextNode.prototype.toString=function(){return "TextNode ("+this.index+") "+this.label;};YAHOO.widget.MenuNode=function(_74,_75,_76){if(_74){this.init(_74,_75,_76);this.setUpLabel(_74);}this.multiExpand=false;};YAHOO.widget.MenuNode.prototype=new YAHOO.widget.TextNode();YAHOO.widget.MenuNode.prototype.toString=function(){return "MenuNode ("+this.index+") "+this.label;};YAHOO.widget.HTMLNode=function(_77,_78,_79,_80){if(_77){this.init(_77,_78,_79);this.initContent(_77,_80);}};YAHOO.widget.HTMLNode.prototype=new YAHOO.widget.Node();YAHOO.widget.HTMLNode.prototype.contentStyle="ygtvhtml";YAHOO.widget.HTMLNode.prototype.contentElId=null;YAHOO.widget.HTMLNode.prototype.content=null;YAHOO.widget.HTMLNode.prototype.initContent=function(_81,_82){if(typeof _81=="string"){_81={html:_81};}this.html=_81.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=_82;};YAHOO.widget.HTMLNode.prototype.getContentEl=function(){return document.getElementById(this.contentElId);};YAHOO.widget.HTMLNode.prototype.getNodeHtml=function(){var sb=[];sb[sb.length]="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";sb[sb.length]="<tr>";for(i=0;i<this.depth;++i){sb[sb.length]="<td class=\""+this.getDepthStyle(i)+"\">&#160;</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]=">&#160;</td>";}sb[sb.length]="<td";sb[sb.length]=" id=\""+this.contentElId+"\"";sb[sb.length]=" class=\""+this.contentStyle+"\"";sb[sb.length]=" >";sb[sb.length]=this.html;sb[sb.length]="</td>";sb[sb.length]="</tr>";sb[sb.length]="</table>";return sb.join("");};YAHOO.widget.HTMLNode.prototype.toString=function(){return "HTMLNode ("+this.index+")";};YAHOO.widget.TVAnim=function(){return {FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(_83,el,_84){if(YAHOO.widget[_83]){return new YAHOO.widget[_83](el,_84);}else{return null;}},isValid:function(_85){return (YAHOO.widget[_85]);}};}();YAHOO.widget.TVFadeIn=function(el,_86){this.el=el;this.callback=_86;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var _87=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(){_87.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return "TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,_89){this.el=el;this.callback=_89;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var _90=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(){_90.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return "TVFadeOut";}};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.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(_2){if(YAHOO.widget.TVAnim.isValid(_2)){this._expandAnim=_2;}},setCollapseAnim:function(_3){if(YAHOO.widget.TVAnim.isValid(_3)){this._collapseAnim=_3;}},animateExpand:function(el,_5){if(this._expandAnim&&this._animCount<this.maxAnim){var _6=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){_6.expandComplete(_5);});if(a){++this._animCount;this.fireEvent("animStart",{"node":_5,"type":"expand"});a.animate();}return true;}return false;},animateCollapse:function(el,_8){if(this._collapseAnim&&this._animCount<this.maxAnim){var _9=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){_9.collapseComplete(_8);});if(a){++this._animCount;this.fireEvent("animStart",{"node":_8,"type":"collapse"});a.animate();}return true;}return false;},expandComplete:function(_10){--this._animCount;this.fireEvent("animComplete",{"node":_10,"type":"expand"});},collapseComplete:function(_11){--this._animCount;this.fireEvent("animComplete",{"node":_11,"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("expand",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);},draw:function(){var _12=this.root.getHtml();this.getEl().innerHTML=_12;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}return this._el;},regNode:function(_13){this._nodes[_13.index]=_13;},getRoot:function(){return this.root;},setDynamicLoad:function(_14,_15){this.root.setDynamicLoad(_14,_15);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(_16){var n=this._nodes[_16];return (n)?n:null;},getNodeByProperty:function(_18,_19){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_19==n.data[_18]){return n;}}return null;},getNodesByProperty:function(_21,_22){var _23=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_22==n.data[_21]){_23.push(n);}}return (_23.length)?_23:null;},removeNode:function(_24,_25){if(_24.isRoot()){return false;}var p=_24.parent;if(p.parent){p=p.parent;}this._deleteNode(_24);if(_25&&p&&p.childrenRendered){p.refresh();}return true;},removeChildren:function(_27){while(_27.children.length){this._deleteNode(_27.children[0]);}_27.childrenRendered=false;_27.dynamicLoadComplete=false;if(_27.expanded){_27.collapse();}else{_27.updateIcon();}},_deleteNode:function(_28){this.removeChildren(_28);this.popNode(_28);},popNode:function(_29){var p=_29.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=_29){a[a.length]=p.children[i];}}p.children=a;p.childrenRendered=false;if(_29.previousSibling){_29.previousSibling.nextSibling=_29.nextSibling;}if(_29.nextSibling){_29.nextSibling.previousSibling=_29.previousSibling;}_29.parent=null;_29.previousSibling=null;_29.nextSibling=null;_29.tree=null;delete this._nodes[_29.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(_30){},onCollapse:function(_31){}};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(_32){var t=YAHOO.widget.TreeView.trees[_32];return (t)?t:null;};YAHOO.widget.TreeView.getNode=function(_34,_35){var t=YAHOO.widget.TreeView.getTree(_34);return (t)?t.getNodeByIndex(_35):null;};YAHOO.widget.TreeView.addHandler=function(el,_36,fn){if(el.addEventListener){el.addEventListener(_36,fn,false);}else{if(el.attachEvent){el.attachEvent("on"+_36,fn);}}};YAHOO.widget.TreeView.removeHandler=function(el,_38,fn){if(el.removeEventListener){el.removeEventListener(_38,fn,false);}else{if(el.detachEvent){el.detachEvent("on"+_38,fn);}}};YAHOO.widget.TreeView.preload=function(_39){_39=_39||"ygtv";var _40=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<_40.length;++i){sb[sb.length]="<span class=\""+_39+_40[i]+"\">&#160;</span>";}var f=document.createElement("div");var s=f.style;s.position="absolute";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(_44,_45,_46){if(_44){this.init(_44,_45,_46);}};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,_type:"Node",init:function(_47,_48,_49){this.data=_47;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=_49;this.createEvent("parentChange",this);if(_48){_48.appendChild(this);}},applyParent:function(_50){if(!_50){return false;}this.tree=_50.tree;this.parent=_50;this.depth=_50.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}if(!this.multiExpand){this.multiExpand=_50.multiExpand;}this.tree.regNode(this);_50.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(_51){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=_51;_51.previousSibling=sib;}this.children[this.children.length]=_51;_51.applyParent(this);return _51;},appendTo:function(_53){return _53.appendChild(this);},insertBefore:function(_54){var p=_54.parent;if(p){if(this.tree){this.tree.popNode(this);}var _55=_54.isChildOf(p);p.children.splice(_55,0,this);if(_54.previousSibling){_54.previousSibling.nextSibling=this;}this.previousSibling=_54.previousSibling;this.nextSibling=_54;_54.previousSibling=this;this.applyParent(p);}return this;},insertAfter:function(_56){var p=_56.parent;if(p){if(this.tree){this.tree.popNode(this);}var _57=_56.isChildOf(p);if(!_56.nextSibling){return this.appendTo(p);}p.children.splice(_57+1,0,this);_56.nextSibling.previousSibling=this;this.previousSibling=_56;this.nextSibling=_56.nextSibling;_56.nextSibling=this;this.applyParent(p);}return this;},isChildOf:function(_58){if(_58&&_58.children){for(var i=0,len=_58.children.length;i<len;++i){if(_58.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;return;}this.hideChildren();this.expanded=false;this.updateIcon();},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 _60=this.getSiblings();for(var i=0;i<_60.length;++i){if(_60[i]!=this&&_60[i].expanded){_60[i].collapse();}}}this.showChildren();},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 _62="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){_62=(this.expanded)?"m":"p";}return "ygtv"+loc+_62;}},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(_64,_65){if(_64){this.dataLoader=_64;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}if(_65){this.iconMode=_65;}},isRoot:function(){return (this==this.tree.root);},isDynamic:function(){var _66=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return _66;},getIconMode:function(){return (this.iconMode||this.tree.root.iconMode);},hasChildren:function(_67){return (this.children.length>0||(_67&&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){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 _68=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){_68.dataLoader(_68,function(){_68.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){_68.tree.root.dataLoader(_68,function(){_68.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(_69){if(_69>=this.depth||_69<0){return null;}var p=this.parent;while(p.depth>_69){p=p.parent;}return p;},getDepthStyle:function(_70){return (this.getAncestor(_70).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.RootNode=function(_71){this.init(null,null,true);this.tree=_71;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return "";},toString:function(){return "RootNode";},loadComplete:function(){this.tree.draw();}});YAHOO.widget.TextNode=function(_72,_73,_74){if(_72){this.init(_72,_73,_74);this.setUpLabel(_72);}};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(_75){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof _75=="string"){_75={label:_75};}this.label=_75.label;if(_75.href){this.href=_75.href;}if(_75.target){this.target=_75.target;}if(_75.style){this.labelStyle=_75.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)+"\">&#160;</td>";}var _76="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]=_76+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"this.className=";sb[sb.length]=_76+".getStyle()\"";}sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\">";sb[sb.length]="&#160;";sb[sb.length]="</td>";sb[sb.length]="<td>";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 "+_76+".onLabelClick("+_76+")\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_76+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_76+".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.MenuNode=function(_78,_79,_80){if(_78){this.init(_78,_79,_80);this.setUpLabel(_78);}this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return "MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.HTMLNode=function(_81,_82,_83,_84){if(_81){this.init(_81,_82,_83);this.initContent(_81,_84);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(_85,_86){if(typeof _85=="string"){_85={html:_85};}this.html=_85.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=_86;},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)+"\">&#160;</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]=">&#160;</td>";}sb[sb.length]="<td";sb[sb.length]=" id=\""+this.contentElId+"\"";sb[sb.length]=" class=\""+this.contentStyle+"\"";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.TVAnim=function(){return {FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(_87,el,_88){if(YAHOO.widget[_87]){return new YAHOO.widget[_87](el,_88);}else{return null;}},isValid:function(_89){return (YAHOO.widget[_89]);}};}();YAHOO.widget.TVFadeIn=function(el,_90){this.el=el;this.callback=_90;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var _91=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(){_91.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return "TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,_93){this.el=el;this.callback=_93;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var _94=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(){_94.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return "TVFadeOut";}};
\ No newline at end of file
index 62d9a77ef3772f2fb509f0c46c677087c862f104..ea6b6ef506aedd46954c5bf4f54d0bd6c69640f3 100755 (executable)
@@ -1,15 +1,23 @@
 /*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
 */ \r
 \r
 /**\r
- * Contains the tree view state data and the root node.  This is an\r
- * ordered tree; child nodes will be displayed in the order created, and\r
- * there currently is no way to change this.\r
+ * The treeview widget is a generic tree building tool.\r
+ * @module treeview\r
+ * @title TreeView Widget\r
+ * @requires yahoo\r
+ * @optional animation\r
+ * @namespace YAHOO.widget\r
+ */\r
+\r
+/**\r
+ * Contains the tree view state data and the root node.\r
  *\r
+ * @class TreeView\r
  * @constructor\r
  * @param {string|HTMLElement} id The id of the element, or the element\r
  * itself that the tree will be inserted into.\r
@@ -18,30 +26,25 @@ YAHOO.widget.TreeView = function(id) {
     if (id) { this.init(id); }\r
 };\r
 \r
-/**\r
- * Count of all nodes in all trees\r
- * @type int\r
- */\r
-YAHOO.widget.TreeView.nodeCount = 0;\r
-\r
 YAHOO.widget.TreeView.prototype = {\r
 \r
     /**\r
      * The id of tree container element\r
-     *\r
+     * @property id\r
      * @type String\r
      */\r
     id: null,\r
 \r
     /**\r
      * The host element for this tree\r
+     * @property _el\r
      * @private\r
      */\r
     _el: null,\r
 \r
      /**\r
      * Flat collection of all nodes in this tree\r
-     *\r
+     * @property _nodes\r
      * @type Node[]\r
      * @private\r
      */\r
@@ -49,14 +52,14 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * We lock the tree control while waiting for the dynamic loader to return\r
-     *\r
+     * @property locked\r
      * @type boolean\r
      */\r
     locked: false,\r
 \r
     /**\r
      * The animation to use for expanding children, if any\r
-     *\r
+     * @property _expandAnim\r
      * @type string\r
      * @private\r
      */\r
@@ -64,7 +67,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The animation to use for collapsing children, if any\r
-     *\r
+     * @property _collapseAnim\r
      * @type string\r
      * @private\r
      */\r
@@ -72,7 +75,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The current number of animations that are executing\r
-     *\r
+     * @property _animCount\r
      * @type int\r
      * @private\r
      */\r
@@ -80,16 +83,16 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * The maximum number of animations to run at one time.\r
-     *\r
+     * @property maxAnim\r
      * @type int\r
      */\r
     maxAnim: 2,\r
 \r
     /**\r
      * Sets up the animation for expanding children\r
-     *\r
-     * @param {string} the type of animation (acceptable values defined in \r
-     * YAHOO.widget.TVAnim)\r
+     * @method setExpandAnim\r
+     * @param {string} type the type of animation (acceptable values defined \r
+     * in YAHOO.widget.TVAnim)\r
      */\r
     setExpandAnim: function(type) {\r
         if (YAHOO.widget.TVAnim.isValid(type)) {\r
@@ -99,7 +102,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Sets up the animation for collapsing children\r
-     *\r
+     * @method setCollapseAnim\r
      * @param {string} the type of animation (acceptable values defined in \r
      * YAHOO.widget.TVAnim)\r
      */\r
@@ -112,19 +115,24 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Perform the expand animation if configured, or just show the\r
      * element if not configured or too many animations are in progress\r
-     *\r
+     * @method animateExpand\r
      * @param el {HTMLElement} the element to animate\r
+     * @param node {YAHOO.util.Node} the node that was expanded\r
      * @return {boolean} true if animation could be invoked, false otherwise\r
      */\r
-    animateExpand: function(el) {\r
+    animateExpand: function(el, node) {\r
 \r
         if (this._expandAnim && this._animCount < this.maxAnim) {\r
             // this.locked = true;\r
             var tree = this;\r
             var a = YAHOO.widget.TVAnim.getAnim(this._expandAnim, el, \r
-                            function() { tree.expandComplete(); });\r
+                            function() { tree.expandComplete(node); });\r
             if (a) { \r
                 ++this._animCount;\r
+                this.fireEvent("animStart", {\r
+                        "node": node, \r
+                        "type": "expand"\r
+                    });\r
                 a.animate();\r
             }\r
 \r
@@ -137,19 +145,24 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Perform the collapse animation if configured, or just show the\r
      * element if not configured or too many animations are in progress\r
-     *\r
+     * @method animateCollapse\r
      * @param el {HTMLElement} the element to animate\r
+     * @param node {YAHOO.util.Node} the node that was expanded\r
      * @return {boolean} true if animation could be invoked, false otherwise\r
      */\r
-    animateCollapse: function(el) {\r
+    animateCollapse: function(el, node) {\r
 \r
         if (this._collapseAnim && this._animCount < this.maxAnim) {\r
             // this.locked = true;\r
             var tree = this;\r
             var a = YAHOO.widget.TVAnim.getAnim(this._collapseAnim, el, \r
-                            function() { tree.collapseComplete(); });\r
+                            function() { tree.collapseComplete(node); });\r
             if (a) { \r
                 ++this._animCount;\r
+                this.fireEvent("animStart", {\r
+                        "node": node, \r
+                        "type": "collapse"\r
+                    });\r
                 a.animate();\r
             }\r
 \r
@@ -161,23 +174,33 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Function executed when the expand animation completes\r
+     * @method expandComplete\r
      */\r
-    expandComplete: function() {\r
+    expandComplete: function(node) {\r
         --this._animCount;\r
+        this.fireEvent("animComplete", {\r
+                "node": node, \r
+                "type": "expand"\r
+            });\r
         // this.locked = false;\r
     },\r
 \r
     /**\r
      * Function executed when the collapse animation completes\r
+     * @method collapseComplete\r
      */\r
-    collapseComplete: function() {\r
+    collapseComplete: function(node) {\r
         --this._animCount;\r
+        this.fireEvent("animComplete", {\r
+                "node": node, \r
+                "type": "collapse"\r
+            });\r
         // this.locked = false;\r
     },\r
 \r
     /**\r
      * Initializes the tree\r
-     *\r
+     * @method init\r
      * @parm {string|HTMLElement} id the id of the element that will hold the tree\r
      * @private\r
      */\r
@@ -190,6 +213,44 @@ YAHOO.widget.TreeView.prototype = {
             this.id = this.generateId(id);\r
         }\r
 \r
+        /**\r
+         * When animation is enabled, this event fires when the animation\r
+         * starts\r
+         * @event animStart\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         * @parm {String} type the type of animation ("expand" or "collapse")\r
+         */\r
+        this.createEvent("animStart", this);\r
+\r
+        /**\r
+         * When animation is enabled, this event fires when the animation\r
+         * completes\r
+         * @event animComplete\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         * @parm {String} type the type of animation ("expand" or "collapse")\r
+         */\r
+        this.createEvent("animComplete", this);\r
+\r
+        /**\r
+         * Fires when a node is going to be expanded.  Return false to stop\r
+         * the expand.\r
+         * @event collapse\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         */\r
+        this.createEvent("collapse", this);\r
+\r
+        /**\r
+         * Fires when a node is going to be collapsed.  Return false to stop\r
+         * the collapse.\r
+         * @event expand\r
+         * @type CustomEvent\r
+         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+         */\r
+        this.createEvent("expand", this);\r
+\r
         this._nodes = [];\r
 \r
         // store a global reference\r
@@ -203,6 +264,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Renders the tree boilerplate and visible nodes\r
+     * @method draw\r
      */\r
     draw: function() {\r
         var html = this.root.getHtml();\r
@@ -212,6 +274,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Returns the tree's host element\r
+     * @method getEl\r
      * @return {HTMLElement} the host element\r
      */\r
     getEl: function() {\r
@@ -223,7 +286,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Nodes register themselves with the tree instance when they are created.\r
-     *\r
+     * @method regNode\r
      * @param node {Node} the node to register\r
      * @private\r
      */\r
@@ -233,7 +296,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Returns the root node of this tree\r
-     *\r
+     * @method getRoot\r
      * @return {Node} the root node\r
      */\r
     getRoot: function() {\r
@@ -242,7 +305,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Configures this tree to dynamically load all child data\r
-     *\r
+     * @method setDynamicLoad\r
      * @param {function} fnDataLoader the function that will be called to get the data\r
      * @param iconMode {int} configures the icon that is displayed when a dynamic\r
      * load node is expanded the first time without children.  By default, the \r
@@ -258,6 +321,7 @@ YAHOO.widget.TreeView.prototype = {
      * node property.  If expand all is called in a tree with nodes that\r
      * do not allow multiple siblings to be displayed, only the last sibling\r
      * will be expanded.\r
+     * @method expandAll\r
      */\r
     expandAll: function() { \r
         if (!this.locked) {\r
@@ -267,6 +331,7 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Collapses all expanded child nodes in the entire tree.\r
+     * @method collapseAll\r
      */\r
     collapseAll: function() { \r
         if (!this.locked) {\r
@@ -278,7 +343,7 @@ YAHOO.widget.TreeView.prototype = {
      * Returns a node in the tree that has the specified index (this index\r
      * is created internally, so this function probably will only be used\r
      * in html generated for a given node.)\r
-     *\r
+     * @method getNodeByIndex\r
      * @param {int} nodeIndex the index of the node wanted\r
      * @return {Node} the node with index=nodeIndex, null if no match\r
      */\r
@@ -290,7 +355,7 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Returns a node that has a matching property and value in the data\r
      * object that was passed into its constructor.\r
-     *\r
+     * @method getNodeByProperty\r
      * @param {object} property the property to search (usually a string)\r
      * @param {object} value the value we want to find (usuall an int or string)\r
      * @return {Node} the matching node, null if no match\r
@@ -309,7 +374,7 @@ YAHOO.widget.TreeView.prototype = {
     /**\r
      * Returns a collection of nodes that have a matching property \r
      * and value in the data object that was passed into its constructor.  \r
-     *\r
+     * @method getNodesByProperty\r
      * @param {object} property the property to search (usually a string)\r
      * @param {object} value the value we want to find (usuall an int or string)\r
      * @return {Array} the matching collection of nodes, null if no match\r
@@ -327,8 +392,9 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * Removes the node and its children, and optionally refreshes the branch \r
-     * of the tree that was affected.\r
+     * Removes the node and its children, and optionally refreshes the \r
+     * branch of the tree that was affected.\r
+     * @method removeNode\r
      * @param {Node} The node to remove\r
      * @param {boolean} autoRefresh automatically refreshes branch if true\r
      * @return {boolean} False is there was a problem, true otherwise.\r
@@ -362,6 +428,7 @@ YAHOO.widget.TreeView.prototype = {
      * the node, and resets the dynamic load flag.  The primary use for\r
      * this method is to purge a node and allow it to fetch its data\r
      * dynamically again.\r
+     * @method removeChildren\r
      * @param {Node} node the node to purge\r
      */\r
     removeChildren: function(node) { \r
@@ -371,13 +438,16 @@ YAHOO.widget.TreeView.prototype = {
 \r
         node.childrenRendered = false;\r
         node.dynamicLoadComplete = false;\r
-        // node.collapse();\r
-        node.expand();\r
-        node.collapse();\r
+        if (node.expanded) {\r
+            node.collapse();\r
+        } else {\r
+            node.updateIcon();\r
+        }\r
     },\r
 \r
     /**\r
      * Deletes the node and recurses children\r
+     * @method _deleteNode\r
      * @private\r
      */\r
     _deleteNode: function(node) { \r
@@ -389,9 +459,10 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * Removes the branch from the tree.  This differs from removeNode in\r
-     * that the child collection is preserved to make it possible to\r
-     * insert the branch into another part of the tree, or another tree.\r
+     * Removes the node from the tree, preserving the child collection \r
+     * to make it possible to insert the branch into another part of the \r
+     * tree, or another tree.\r
+     * @method popNode\r
      * @param {Node} the node to remove\r
      */\r
     popNode: function(node) { \r
@@ -420,12 +491,18 @@ YAHOO.widget.TreeView.prototype = {
             node.nextSibling.previousSibling = node.previousSibling;\r
         }\r
 \r
+        node.parent = null;\r
+        node.previousSibling = null;\r
+        node.nextSibling = null;\r
+        node.tree = null;\r
+\r
         // Update the tree's node collection \r
         delete this._nodes[node.index];\r
     },\r
 \r
     /**\r
-     * toString\r
+     * TreeView instance toString\r
+     * @method toString\r
      * @return {string} string representation of the tree\r
      */\r
     toString: function() {\r
@@ -433,14 +510,16 @@ YAHOO.widget.TreeView.prototype = {
     },\r
 \r
     /**\r
-     * private\r
+     * Generates an unique id for an element if it doesn't yet have one\r
+     * @method generateId\r
+     * @private\r
      */\r
     generateId: function(el) {\r
         var id = el.id;\r
 \r
         if (!id) {\r
             id = "yui-tv-auto-id-" + YAHOO.widget.TreeView.counter;\r
-            YAHOO.widget.TreeView.counter++;\r
+            ++YAHOO.widget.TreeView.counter;\r
         }\r
 \r
         return id;\r
@@ -448,27 +527,45 @@ YAHOO.widget.TreeView.prototype = {
 \r
     /**\r
      * Abstract method that is executed when a node is expanded\r
+     * @method onExpand\r
      * @param node {Node} the node that was expanded\r
+     * @deprecated use treeobj.subscribe("expand") instead\r
      */\r
     onExpand: function(node) { },\r
 \r
     /**\r
-     * Abstract method that is executed when a node is collapsed\r
+     * Abstract method that is executed when a node is collapsed.\r
+     * @method onCollapse\r
      * @param node {Node} the node that was collapsed.\r
+     * @deprecated use treeobj.subscribe("collapse") instead\r
      */\r
     onCollapse: function(node) { }\r
 \r
 };\r
 \r
+YAHOO.augment(YAHOO.widget.TreeView, YAHOO.util.EventProvider);\r
+\r
+/**\r
+ * Count of all nodes in all trees\r
+ * @property YAHOO.widget.TreeView.nodeCount\r
+ * @type int\r
+ * @static\r
+ */\r
+YAHOO.widget.TreeView.nodeCount = 0;\r
+\r
 /**\r
  * Global cache of tree instances\r
- *\r
+ * @property YAHOO.widget.TreeView.trees\r
  * @type Array\r
+ * @static\r
  * @private\r
  */\r
 YAHOO.widget.TreeView.trees = [];\r
 \r
 /**\r
+ * Counter for generating a new unique element id\r
+ * @property YAHOO.widget.TreeView.counter\r
+ * @static\r
  * @private\r
  */\r
 YAHOO.widget.TreeView.counter = 0;\r
@@ -476,9 +573,10 @@ YAHOO.widget.TreeView.counter = 0;
 /**\r
  * Global method for getting a tree by its id.  Used in the generated\r
  * tree html.\r
- *\r
+ * @method YAHOO.widget.TreeView.getTree\r
  * @param treeId {String} the id of the tree instance\r
  * @return {TreeView} the tree instance requested, null if not found.\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.getTree = function(treeId) {\r
     var t = YAHOO.widget.TreeView.trees[treeId];\r
@@ -488,10 +586,11 @@ YAHOO.widget.TreeView.getTree = function(treeId) {
 /**\r
  * Global method for getting a node by its id.  Used in the generated\r
  * tree html.\r
- *\r
+ * @method YAHOO.widget.TreeView.getNode\r
  * @param treeId {String} the id of the tree instance\r
  * @param nodeIndex {String} the index of the node to return\r
  * @return {Node} the node instance requested, null if not found\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {\r
     var t = YAHOO.widget.TreeView.getTree(treeId);\r
@@ -499,27 +598,45 @@ YAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {
 };\r
 \r
 /**\r
- * Adds an event.  Replace with event manager when available\r
- *\r
+ * Add a DOM event\r
+ * @method YAHOO.widget.TreeView.addHandler\r
  * @param el the elment to bind the handler to\r
  * @param {string} sType the type of event handler\r
  * @param {function} fn the callback to invoke\r
- * @param {boolean} capture if true event is capture phase, bubble otherwise\r
+ * @static\r
  */\r
-YAHOO.widget.TreeView.addHandler = function (el, sType, fn, capture) {\r
-    capture = (capture) ? true : false;\r
+YAHOO.widget.TreeView.addHandler = function (el, sType, fn) {\r
     if (el.addEventListener) {\r
-        el.addEventListener(sType, fn, capture);\r
+        el.addEventListener(sType, fn, false);\r
     } else if (el.attachEvent) {\r
         el.attachEvent("on" + sType, fn);\r
-    } else {\r
-        el["on" + sType] = fn;\r
+    }\r
+};\r
+\r
+/**\r
+ * Remove a DOM event\r
+ * @method YAHOO.widget.TreeView.removeHandler\r
+ * @param el the elment to bind the handler to\r
+ * @param {string} sType the type of event handler\r
+ * @param {function} fn the callback to invoke\r
+ * @static\r
+ */\r
+\r
+YAHOO.widget.TreeView.removeHandler = function (el, sType, fn) {\r
+    if (el.removeEventListener) {\r
+        el.removeEventListener(sType, fn, false);\r
+    } else if (el.detachEvent) {\r
+        el.detachEvent("on" + sType, fn);\r
     }\r
 };\r
 \r
 /**\r
  * Attempts to preload the images defined in the styles used to draw the tree by\r
  * rendering off-screen elements that use the styles.\r
+ * @method YAHOO.widget.TreeView.preload\r
+ * @param {string} prefix the prefix to use to generate the names of the\r
+ * images to preload, default is ygtv\r
+ * @static\r
  */\r
 YAHOO.widget.TreeView.preload = function(prefix) {\r
     prefix = prefix || "ygtv";\r
@@ -531,7 +648,7 @@ YAHOO.widget.TreeView.preload = function(prefix) {
         sb[sb.length] = '<span class="' + prefix + styles[i] + '">&#160;</span>';\r
     }\r
 \r
-    var f = document.createElement("DIV");\r
+    var f = document.createElement("div");\r
     var s = f.style;\r
     s.position = "absolute";\r
     s.top = "-1000px";\r
@@ -539,6 +656,10 @@ YAHOO.widget.TreeView.preload = function(prefix) {
     f.innerHTML = sb.join("");\r
 \r
     document.body.appendChild(f);\r
+\r
+    YAHOO.widget.TreeView.removeHandler(window, \r
+                "load", YAHOO.widget.TreeView.preload);\r
+\r
 };\r
 \r
 YAHOO.widget.TreeView.addHandler(window, \r
@@ -547,7 +668,8 @@ YAHOO.widget.TreeView.addHandler(window,
 /**\r
  * The base class for all tree nodes.  The node's presentation and behavior in\r
  * response to mouse events is handled in Node subclasses.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class Node\r
  * @param oData {object} a string or object containing the data that will\r
  * be used to render this node\r
  * @param oParent {Node} this node's parent node\r
@@ -562,21 +684,21 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * The index for this instance obtained from global counter in YAHOO.widget.TreeView.\r
-     *\r
+     * @property index\r
      * @type int\r
      */\r
     index: 0,\r
 \r
     /**\r
      * This node's child node collection.\r
-     *\r
+     * @property children\r
      * @type Node[] \r
      */\r
     children: null,\r
 \r
     /**\r
      * Tree instance this node is part of\r
-     *\r
+     * @property tree\r
      * @type TreeView\r
      */\r
     tree: null,\r
@@ -584,21 +706,21 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * The data linked to this node.  This can be any object or primitive\r
      * value, and the data can be used in getNodeHtml().\r
-     *\r
+     * @property data\r
      * @type object\r
      */\r
     data: null,\r
 \r
     /**\r
      * Parent node\r
-     *\r
+     * @property parent\r
      * @type Node\r
      */\r
     parent: null,\r
 \r
     /**\r
      * The depth of this node.  We start at -1 for the root node.\r
-     *\r
+     * @property depth\r
      * @type int\r
      */\r
     depth: -1,\r
@@ -606,28 +728,28 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * The href for the node's label.  If one is not specified, the href will\r
      * be set so that it toggles the node.\r
-     *\r
+     * @property href\r
      * @type string\r
      */\r
     href: null,\r
 \r
     /**\r
      * The label href target, defaults to current window\r
-     *\r
+     * @property target\r
      * @type string\r
      */\r
     target: "_self",\r
 \r
     /**\r
      * The node's expanded/collapsed state\r
-     *\r
+     * @property expanded\r
      * @type boolean\r
      */\r
     expanded: false,\r
 \r
     /**\r
      * Can multiple children be expanded at once?\r
-     *\r
+     * @property multiExpand\r
      * @type boolean\r
      */\r
     multiExpand: true,\r
@@ -636,7 +758,7 @@ YAHOO.widget.Node.prototype = {
      * Should we render children for a collapsed node?  It is possible that the\r
      * implementer will want to render the hidden data...  @todo verify that we \r
      * need this, and implement it if we do.\r
-     *\r
+     * @property renderHidden\r
      * @type boolean\r
      */\r
     renderHidden: false,\r
@@ -644,6 +766,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * This flag is set to true when the html is generated for this node's\r
      * children, and set to false when new children are added.\r
+     * @property childrenRendered\r
      * @type boolean\r
      */\r
     childrenRendered: false,\r
@@ -651,20 +774,21 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Dynamically loaded nodes only fetch the data the first time they are\r
      * expanded.  This flag is set to true once the data has been fetched.\r
+     * @property dynamicLoadComplete\r
      * @type boolean\r
      */\r
     dynamicLoadComplete: false,\r
 \r
     /**\r
      * This node's previous sibling\r
-     *\r
+     * @property previousSibling\r
      * @type Node\r
      */\r
     previousSibling: null,\r
 \r
     /**\r
      * This node's next sibling\r
-     *\r
+     * @property nextSibling\r
      * @type Node\r
      */\r
     nextSibling: null,\r
@@ -672,7 +796,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * We can set the node up to call an external method to get the child\r
      * data dynamically.\r
-     *\r
+     * @property _dynLoad\r
      * @type boolean\r
      * @private\r
      */\r
@@ -680,7 +804,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Function to execute when we need to get this node's child data.\r
-     *\r
+     * @property dataLoader\r
      * @type function\r
      */\r
     dataLoader: null,\r
@@ -688,7 +812,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * This is true for dynamically loading nodes while waiting for the\r
      * callback to return.\r
-     *\r
+     * @property isLoading\r
      * @type boolean\r
      */\r
     isLoading: false,\r
@@ -697,7 +821,7 @@ YAHOO.widget.Node.prototype = {
      * The toggle/branch icon will not show if this is set to false.  This\r
      * could be useful if the implementer wants to have the child contain\r
      * extra info about the parent, rather than an actual node.\r
-     *\r
+     * @property hasIcon\r
      * @type boolean\r
      */\r
     hasIcon: true,\r
@@ -707,12 +831,14 @@ YAHOO.widget.Node.prototype = {
      * and we discover that it does not have children.  By default, it is\r
      * treated as if it still could have children (plus/minus icon).  Set\r
      * iconMode to have it display like a leaf node instead.\r
+     * @property iconMode\r
      * @type int\r
      */\r
     iconMode: 0,\r
 \r
     /**\r
      * The node type\r
+     * @property _type\r
      * @private\r
      */\r
     _type: "Node",\r
@@ -726,19 +852,31 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Initializes this node, gets some of the properties from the parent\r
-     *\r
+     * @method init\r
      * @param oData {object} a string or object containing the data that will\r
      * be used to render this node\r
      * @param oParent {Node} this node's parent node\r
      * @param expanded {boolean} the initial expanded/collapsed state\r
      */\r
     init: function(oData, oParent, expanded) {\r
+\r
         this.data       = oData;\r
         this.children   = [];\r
         this.index      = YAHOO.widget.TreeView.nodeCount;\r
         ++YAHOO.widget.TreeView.nodeCount;\r
         this.expanded   = expanded;\r
 \r
+        /**\r
+         * The parentChange event is fired when a parent element is applied\r
+         * to the node.  This is useful if you need to apply tree-level\r
+         * properties to a tree that need to happen if a node is moved from\r
+         * one tre to another.\r
+         *\r
+         * @event parentChange\r
+         * @type CustomEvent\r
+         */\r
+        this.createEvent("parentChange", this);\r
+\r
         // oParent should never be null except when we create the root node.\r
         if (oParent) {\r
             oParent.appendChild(this);\r
@@ -750,7 +888,9 @@ YAHOO.widget.Node.prototype = {
      * is known. This is called after the node is inserted into a tree.\r
      * the parent is also applied to this node's children in order to\r
      * make it possible to move a branch from one tree to another.\r
+     * @method applyParent\r
      * @param {Node} parentNode this node's parent node\r
+     * @return {boolean} true if the application was successful\r
      */\r
     applyParent: function(parentNode) {\r
         if (!parentNode) {\r
@@ -761,7 +901,7 @@ YAHOO.widget.Node.prototype = {
         this.parent = parentNode;\r
         this.depth  = parentNode.depth + 1;\r
 \r
-        if (! this.href) {\r
+        if (!this.href) {\r
             this.href = "javascript:" + this.getToggleLink();\r
         }\r
 \r
@@ -777,12 +917,14 @@ YAHOO.widget.Node.prototype = {
             this.children[i].applyParent(this);\r
         }\r
 \r
+        this.fireEvent("parentChange");\r
+\r
         return true;\r
     },\r
 \r
     /**\r
      * Appends a node to the child collection.\r
-     *\r
+     * @method appendChild\r
      * @param childNode {Node} the new node\r
      * @return {Node} the child node\r
      * @private\r
@@ -801,7 +943,9 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Appends this node to the supplied node's child collection\r
+     * @method appendTo\r
      * @param parentNode {Node} the node to append to.\r
+     * @return {Node} The appended node\r
      */\r
     appendTo: function(parentNode) {\r
         return parentNode.appendChild(this);\r
@@ -809,7 +953,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
     * Inserts this node before this supplied node\r
-    *\r
+    * @method insertBefore\r
     * @param node {Node} the node to insert this node before\r
     * @return {Node} the inserted node\r
     */\r
@@ -838,7 +982,7 @@ YAHOO.widget.Node.prototype = {
  \r
     /**\r
     * Inserts this node after the supplied node\r
-    *\r
+    * @method insertAfter\r
     * @param node {Node} the node to insert after\r
     * @return {Node} the inserted node\r
     */\r
@@ -871,7 +1015,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
     * Returns true if the Node is a child of supplied Node\r
-    *\r
+    * @method isChildOf\r
     * @param parentNode {Node} the Node to check\r
     * @return {boolean} The node index if this Node is a child of \r
     *                   supplied Node, else -1.\r
@@ -891,7 +1035,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns a node array of this node's siblings, null if none.\r
-     *\r
+     * @method getSiblings\r
      * @return Node[]\r
      */\r
     getSiblings: function() {\r
@@ -900,9 +1044,10 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Shows this node's children\r
+     * @method showChildren\r
      */\r
     showChildren: function() {\r
-        if (!this.tree.animateExpand(this.getChildrenEl())) {\r
+        if (!this.tree.animateExpand(this.getChildrenEl(), this)) {\r
             if (this.hasChildren()) {\r
                 this.getChildrenEl().style.display = "";\r
             }\r
@@ -911,17 +1056,18 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Hides this node's children\r
+     * @method hideChildren\r
      */\r
     hideChildren: function() {\r
 \r
-        if (!this.tree.animateCollapse(this.getChildrenEl())) {\r
+        if (!this.tree.animateCollapse(this.getChildrenEl(), this)) {\r
             this.getChildrenEl().style.display = "none";\r
         }\r
     },\r
 \r
     /**\r
      * Returns the id for this node's container div\r
-     *\r
+     * @method getElId\r
      * @return {string} the element id\r
      */\r
     getElId: function() {\r
@@ -930,7 +1076,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the id for this node's children div\r
-     *\r
+     * @method getChildrenElId\r
      * @return {string} the element id for this node's children div\r
      */\r
     getChildrenElId: function() {\r
@@ -939,16 +1085,17 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the id for this node's toggle element\r
-     *\r
+     * @method getToggleElId\r
      * @return {string} the toggel element id\r
      */\r
     getToggleElId: function() {\r
         return "ygtvt" + this.index;\r
     },\r
 \r
-    /**\r
+    /*\r
      * Returns the id for this node's spacer image.  The spacer is positioned\r
      * over the toggle and provides feedback for screen readers.\r
+     * @method getSpacerId\r
      * @return {string} the id for the spacer image\r
      */\r
     /*\r
@@ -959,6 +1106,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns this node's container html element\r
+     * @method getEl\r
      * @return {HTMLElement} the container html element\r
      */\r
     getEl: function() {\r
@@ -967,6 +1115,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the div that was generated for this node's children\r
+     * @method getChildrenEl\r
      * @return {HTMLElement} this node's children div\r
      */\r
     getChildrenEl: function() {\r
@@ -975,14 +1124,16 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the element that is being used for this node's toggle.\r
+     * @method getToggleEl\r
      * @return {HTMLElement} this node's toggle html element\r
      */\r
     getToggleEl: function() {\r
         return document.getElementById(this.getToggleElId());\r
     },\r
 \r
-    /**\r
+    /*\r
      * Returns the element that is being used for this node's spacer.\r
+     * @method getSpacer\r
      * @return {HTMLElement} this node's spacer html element\r
      */\r
     /*\r
@@ -1009,6 +1160,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Generates the link that will invoke this node's toggle method\r
+     * @method getToggleLink\r
      * @return {string} the javascript url for toggling this node\r
      */\r
     getToggleLink: function() {\r
@@ -1018,6 +1170,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Hides this nodes children (creating them if necessary), changes the\r
+     * @method collapse\r
      * toggle style.\r
      */\r
     collapse: function() {\r
@@ -1027,7 +1180,13 @@ YAHOO.widget.Node.prototype = {
         // fire the collapse event handler\r
         var ret = this.tree.onCollapse(this);\r
 \r
-        if ("undefined" != typeof ret && !ret) {\r
+        if (false === ret) {\r
+            return;\r
+        }\r
+\r
+        ret = this.tree.fireEvent("collapse", this);\r
+\r
+        if (false === ret) {\r
             return;\r
         }\r
 \r
@@ -1040,9 +1199,7 @@ YAHOO.widget.Node.prototype = {
         this.hideChildren();\r
         this.expanded = false;\r
 \r
-        if (this.hasIcon) {\r
-            this.getToggleEl().className = this.getStyle();\r
-        }\r
+        this.updateIcon();\r
 \r
         // this.getSpacer().title = this.getStateText();\r
 \r
@@ -1051,6 +1208,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Shows this nodes children (creating them if necessary), changes the\r
      * toggle style, and collapses its siblings if multiExpand is not set.\r
+     * @method expand\r
      */\r
     expand: function() {\r
         // Only expand if currently collapsed.\r
@@ -1059,7 +1217,13 @@ YAHOO.widget.Node.prototype = {
         // fire the expand event handler\r
         var ret = this.tree.onExpand(this);\r
 \r
-        if ("undefined" != typeof ret && !ret) {\r
+        if (false === ret) {\r
+            return;\r
+        }\r
+        \r
+        ret = this.tree.fireEvent("expand", this);\r
+\r
+        if (false === ret) {\r
             return;\r
         }\r
 \r
@@ -1074,9 +1238,8 @@ YAHOO.widget.Node.prototype = {
         }\r
 \r
         this.expanded = true;\r
-        if (this.hasIcon) {\r
-            this.getToggleEl().className = this.getStyle();\r
-        }\r
+\r
+        this.updateIcon();\r
 \r
         // this.getSpacer().title = this.getStateText();\r
 \r
@@ -1101,9 +1264,18 @@ YAHOO.widget.Node.prototype = {
         this.showChildren();\r
     },\r
 \r
+    updateIcon: function() {\r
+        if (this.hasIcon) {\r
+            var el = this.getToggleEl();\r
+            if (el) {\r
+                el.className = this.getStyle();\r
+            }\r
+        }\r
+    },\r
+\r
     /**\r
      * Returns the css style name for the toggle\r
-     *\r
+     * @method getStyle\r
      * @return {string} the css class for this node's toggle\r
      */\r
     getStyle: function() {\r
@@ -1127,6 +1299,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Returns the hover style for the icon\r
      * @return {string} the css class hover state\r
+     * @method getHoverStyle\r
      */\r
     getHoverStyle: function() { \r
         var s = this.getStyle();\r
@@ -1138,6 +1311,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Recursively expands all of this node's children.\r
+     * @method expandAll\r
      */\r
     expandAll: function() { \r
         for (var i=0;i<this.children.length;++i) {\r
@@ -1157,6 +1331,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Recursively collapses all of this node's children.\r
+     * @method collapseAll\r
      */\r
     collapseAll: function() { \r
         for (var i=0;i<this.children.length;++i) {\r
@@ -1169,7 +1344,7 @@ YAHOO.widget.Node.prototype = {
      * Configures this node for dynamically obtaining the child data\r
      * when the node is first expanded.  Calling it without the callback\r
      * will turn off dynamic load for the node.\r
-     *\r
+     * @method setDynamicLoad\r
      * @param fmDataLoader {function} the function that will be used to get the data.\r
      * @param iconMode {int} configures the icon that is displayed when a dynamic\r
      * load node is expanded the first time without children.  By default, the \r
@@ -1192,7 +1367,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Evaluates if this node is the root node of the tree\r
-     *\r
+     * @method isRoot\r
      * @return {boolean} true if this is the root node\r
      */\r
     isRoot: function() { \r
@@ -1204,7 +1379,7 @@ YAHOO.widget.Node.prototype = {
      * the property both in this instance and the root node.  If the tree is\r
      * defined to load all children dynamically, the data callback function is\r
      * defined in the root node\r
-     *\r
+     * @method isDynamic\r
      * @return {boolean} true if this node's children are to be loaded dynamically\r
      */\r
     isDynamic: function() { \r
@@ -1212,6 +1387,12 @@ YAHOO.widget.Node.prototype = {
         return lazy;\r
     },\r
 \r
+    /**\r
+     * Returns the current icon mode.  This refers to the way childless dynamic\r
+     * load nodes appear.\r
+     * @method getIconMode\r
+     * @return {int} 0 for collapse style, 1 for leaf node style\r
+     */\r
     getIconMode: function() {\r
         return (this.iconMode || this.tree.root.iconMode);\r
     },\r
@@ -1223,7 +1404,7 @@ YAHOO.widget.Node.prototype = {
      * children (for instance, the toggle needs to show the expandable \r
      * presentation state).  In other times we want to know if there are rendered\r
      * children.  For the latter, "checkForLazyLoad" should be false.\r
-     *\r
+     * @method hasChildren\r
      * @param checkForLazyLoad {boolean} should we check for unloaded children?\r
      * @return {boolean} true if this has children or if it might and we are\r
      * checking for this condition.\r
@@ -1235,6 +1416,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Expands if node is collapsed, collapses otherwise.\r
+     * @method toggle\r
      */\r
     toggle: function() {\r
         if (!this.tree.locked && ( this.hasChildren(true) || this.isDynamic()) ) {\r
@@ -1244,10 +1426,13 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns the markup for this node and its children.\r
-     *\r
+     * @method getHtml\r
      * @return {string} the markup for this node and its expanded children.\r
      */\r
     getHtml: function() {\r
+\r
+        this.childrenRendered = false;\r
+\r
         var sb = [];\r
         sb[sb.length] = '<div class="ygtvitem" id="' + this.getElId() + '">';\r
         sb[sb.length] = this.getNodeHtml();\r
@@ -1260,7 +1445,7 @@ YAHOO.widget.Node.prototype = {
      * Called when first rendering the tree.  We always build the div that will\r
      * contain this nodes children, but we don't render the children themselves\r
      * unless this node is expanded.\r
-     *\r
+     * @method getChildrenHtml\r
      * @return {string} the children container div html and any expanded children\r
      * @private\r
      */\r
@@ -1288,7 +1473,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Generates the markup for the child nodes.  This is not done until the node\r
      * is expanded.\r
-     *\r
+     * @method renderChildren\r
      * @return {string} the html for this node's children\r
      * @private\r
      */\r
@@ -1334,13 +1519,14 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Called when we know we have all the child data.\r
+     * @method completeRender\r
      * @return {string} children html\r
      */\r
     completeRender: function() {\r
         var sb = [];\r
 \r
         for (var i=0; i < this.children.length; ++i) {\r
-            this.children[i].childrenRendered = false;\r
+            // this.children[i].childrenRendered = false;\r
             sb[sb.length] = this.children[i].getHtml();\r
         }\r
         \r
@@ -1352,6 +1538,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Load complete is the callback function we pass to the data provider\r
      * in dynamic load situations.\r
+     * @method loadComplete\r
      */\r
     loadComplete: function() {\r
         this.getChildrenEl().innerHTML = this.completeRender();\r
@@ -1363,7 +1550,7 @@ YAHOO.widget.Node.prototype = {
 \r
     /**\r
      * Returns this node's ancestor at the specified depth.\r
-     *\r
+     * @method getAncestor\r
      * @param {int} depth the depth of the ancestor.\r
      * @return {Node} the ancestor\r
      */\r
@@ -1386,7 +1573,7 @@ YAHOO.widget.Node.prototype = {
      * this node.  If this node's ancestor at the specified depth\r
      * has a next sibling the presentation is different than if it\r
      * does not have a next sibling\r
-     *\r
+     * @method getDepthStyle\r
      * @param {int} depth the depth of the ancestor.\r
      * @return {string} the css class for the spacer\r
      */\r
@@ -1398,7 +1585,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Get the markup for the node.  This is designed to be overrided so that we can\r
      * support different types of nodes.\r
-     *\r
+     * @method getNodeHtml\r
      * @return {string} The HTML that will render this node.\r
      */\r
     getNodeHtml: function() { \r
@@ -1408,6 +1595,7 @@ YAHOO.widget.Node.prototype = {
     /**\r
      * Regenerates the html for this node and its children.  To be used when the\r
      * node is expanded and new children have been added.\r
+     * @method refresh\r
      */\r
     refresh: function() {\r
         // this.loadComplete();\r
@@ -1422,7 +1610,8 @@ YAHOO.widget.Node.prototype = {
     },\r
 \r
     /**\r
-     * toString\r
+     * Node toString\r
+     * @method toString\r
      * @return {string} string representation of the node\r
      */\r
     toString: function() {\r
@@ -1431,11 +1620,15 @@ YAHOO.widget.Node.prototype = {
 \r
 };\r
 \r
+YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);\r
+\r
 /**\r
  * A custom YAHOO.widget.Node that handles the unique nature of \r
  * the virtual, presentationless root node.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class RootNode\r
  * @extends YAHOO.widget.Node\r
+ * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to\r
  * @constructor\r
  */\r
 YAHOO.widget.RootNode = function(oTree) {\r
@@ -1444,29 +1637,29 @@ YAHOO.widget.RootNode = function(oTree) {
        // to alter the standard properties a bit.\r
        this.init(null, null, true);\r
        \r
-       /**\r
+       /*\r
         * For the root node, we get the tree reference from as a param\r
         * to the constructor instead of from the parent element.\r
-        *\r
-        * @type TreeView\r
         */\r
        this.tree = oTree;\r
 };\r
 \r
-YAHOO.widget.RootNode.prototype = new YAHOO.widget.Node();\r
+YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {\r
+    \r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() { \r
+        return ""; \r
+    },\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.RootNode.prototype.getNodeHtml = function() { \r
-       return ""; \r
-};\r
+    toString: function() { \r
+        return "RootNode";\r
+    },\r
 \r
-YAHOO.widget.RootNode.prototype.toString = function() { \r
-    return "RootNode";\r
-};\r
+    loadComplete: function() { \r
+        this.tree.draw();\r
+    }\r
 \r
-YAHOO.widget.RootNode.prototype.loadComplete = function() { \r
-    this.tree.draw();\r
-};\r
+});\r
 /**\r
  * The default node presentation.  The first parameter should be\r
  * either a string that will be used as the node's label, or an object\r
@@ -1474,7 +1667,8 @@ YAHOO.widget.RootNode.prototype.loadComplete = function() {
  * label will toggle the expanded/collapsed state of the node.  By\r
  * changing the href property of the instance, this behavior can be\r
  * changed so that the label will go to the specified href.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class TextNode\r
  * @extends YAHOO.widget.Node\r
  * @constructor\r
  * @param oData {object} a string or object containing the data that will\r
@@ -1483,165 +1677,194 @@ YAHOO.widget.RootNode.prototype.loadComplete = function() {
  * @param expanded {boolean} the initial expanded/collapsed state\r
  */\r
 YAHOO.widget.TextNode = function(oData, oParent, expanded) {\r
-    // this.type = "TextNode";\r
 \r
     if (oData) { \r
         this.init(oData, oParent, expanded);\r
         this.setUpLabel(oData);\r
     }\r
 \r
+};\r
+\r
+YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {\r
+    \r
     /**\r
-     * @private\r
+     * The CSS class for the label href.  Defaults to ygtvlabel, but can be\r
+     * overridden to provide a custom presentation for a specific node.\r
+     * @property labelStyle\r
+     * @type string\r
      */\r
-};\r
+    labelStyle: "ygtvlabel",\r
 \r
-YAHOO.widget.TextNode.prototype = new YAHOO.widget.Node();\r
+    /**\r
+     * The derived element id of the label for this node\r
+     * @property labelElId\r
+     * @type string\r
+     */\r
+    labelElId: null,\r
 \r
-/**\r
- * The CSS class for the label href.  Defaults to ygtvlabel, but can be\r
- * overridden to provide a custom presentation for a specific node.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.labelStyle = "ygtvlabel";\r
+    /**\r
+     * The text for the label.  It is assumed that the oData parameter will\r
+     * either be a string that will be used as the label, or an object that\r
+     * has a property called "label" that we will use.\r
+     * @property label\r
+     * @type string\r
+     */\r
+    label: null,\r
 \r
-/**\r
- * The derived element id of the label for this node\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.labelElId = null;\r
+    textNodeParentChange: function() {\r
\r
+        /**\r
+         * Custom event that is fired when the text node label is clicked.  The\r
+         * custom event is defined on the tree instance, so there is a single\r
+         * event that handles all nodes in the tree.  The node clicked is \r
+         * provided as an argument\r
+         *\r
+         * @event labelClick\r
+         * @for YAHOO.widget.TreeView\r
+         * @param {YAHOO.widget.Node} node the node clicked\r
+         */\r
+        if (this.tree && !this.tree.hasEvent("labelClick")) {\r
+            this.tree.createEvent("labelClick", this.tree);\r
+        }\r
+       \r
+    },\r
 \r
-/**\r
- * The text for the label.  It is assumed that the oData parameter will\r
- * either be a string that will be used as the label, or an object that\r
- * has a property called "label" that we will use.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.TextNode.prototype.label = null;\r
+    /**\r
+     * Sets up the node label\r
+     * @method setUpLabel\r
+     * @param oData string containing the label, or an object with a label property\r
+     */\r
+    setUpLabel: function(oData) { \r
+        \r
+        // set up the custom event on the tree\r
+        this.textNodeParentChange();\r
+        this.subscribe("parentChange", this.textNodeParentChange);\r
 \r
-/**\r
- * Sets up the node label\r
- * \r
- * @param oData string containing the label, or an object with a label property\r
- */\r
-YAHOO.widget.TextNode.prototype.setUpLabel = function(oData) { \r
-    if (typeof oData == "string") {\r
-        oData = { label: oData };\r
-    }\r
-    this.label = oData.label;\r
-    \r
-    // update the link\r
-    if (oData.href) {\r
-        this.href = oData.href;\r
-    }\r
+        if (typeof oData == "string") {\r
+            oData = { label: oData };\r
+        }\r
+        this.label = oData.label;\r
+        \r
+        // update the link\r
+        if (oData.href) {\r
+            this.href = oData.href;\r
+        }\r
 \r
-    // set the target\r
-    if (oData.target) {\r
-        this.target = oData.target;\r
-    }\r
+        // set the target\r
+        if (oData.target) {\r
+            this.target = oData.target;\r
+        }\r
 \r
-    if (oData.style) {\r
-        this.labelStyle = oData.style;\r
-    }\r
+        if (oData.style) {\r
+            this.labelStyle = oData.style;\r
+        }\r
 \r
-    this.labelElId = "ygtvlabelel" + this.index;\r
-};\r
+        this.labelElId = "ygtvlabelel" + this.index;\r
+    },\r
 \r
-/**\r
- * Returns the label element\r
- *\r
- * @return {object} the element\r
- */\r
-YAHOO.widget.TextNode.prototype.getLabelEl = function() { \r
-    return document.getElementById(this.labelElId);\r
-};\r
+    /**\r
+     * Returns the label element\r
+     * @for YAHOO.widget.TextNode\r
+     * @method getLabelEl\r
+     * @return {object} the element\r
+     */\r
+    getLabelEl: function() { \r
+        return document.getElementById(this.labelElId);\r
+    },\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.TextNode.prototype.getNodeHtml = function() { \r
-    var sb = [];\r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() { \r
+        var sb = [];\r
 \r
-    sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
-    sb[sb.length] = '<tr>';\r
-    \r
-    for (i=0;i<this.depth;++i) {\r
-        // sb[sb.length] = '<td class="ygtvdepthcell">&#160;</td>';\r
-        sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
-    }\r
+        sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
+        sb[sb.length] = '<tr>';\r
+        \r
+        for (var i=0;i<this.depth;++i) {\r
+            // sb[sb.length] = '<td class="ygtvdepthcell">&#160;</td>';\r
+            sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
+        }\r
 \r
-    var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
-                    this.tree.id + '\',' + this.index + ')';\r
-\r
-    sb[sb.length] = '<td';\r
-    // sb[sb.length] = ' onselectstart="return false"';\r
-    sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
-    sb[sb.length] = ' class="' + this.getStyle() + '"';\r
-    if (this.hasChildren(true)) {\r
-        sb[sb.length] = ' onmouseover="this.className=';\r
-        sb[sb.length] = getNode + '.getHoverStyle()"';\r
-        sb[sb.length] = ' onmouseout="this.className=';\r
-        sb[sb.length] = getNode + '.getStyle()"';\r
-    }\r
-    sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
+        var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
+                        this.tree.id + '\',' + this.index + ')';\r
 \r
-    /*\r
-    sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
-    sb[sb.length] = ' alt=""';\r
-    sb[sb.length] = ' tabindex=0';\r
-    sb[sb.length] = ' src="' + this.spacerPath + '"';\r
-    sb[sb.length] = ' title="' + this.getStateText() + '"';\r
-    sb[sb.length] = ' class="ygtvspacer"';\r
-    // sb[sb.length] = ' onkeypress="return ' + getNode + '".onKeyPress()"';\r
-    sb[sb.length] = ' />';\r
-    */\r
+        sb[sb.length] = '<td';\r
+        // sb[sb.length] = ' onselectstart="return false"';\r
+        sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
+        sb[sb.length] = ' class="' + this.getStyle() + '"';\r
+        if (this.hasChildren(true)) {\r
+            sb[sb.length] = ' onmouseover="this.className=';\r
+            sb[sb.length] = getNode + '.getHoverStyle()"';\r
+            sb[sb.length] = ' onmouseout="this.className=';\r
+            sb[sb.length] = getNode + '.getStyle()"';\r
+        }\r
+        sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
+\r
+        /*\r
+        sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
+        sb[sb.length] = ' alt=""';\r
+        sb[sb.length] = ' tabindex=0';\r
+        sb[sb.length] = ' src="' + this.spacerPath + '"';\r
+        sb[sb.length] = ' title="' + this.getStateText() + '"';\r
+        sb[sb.length] = ' class="ygtvspacer"';\r
+        // sb[sb.length] = ' onkeypress="return ' + getNode + '".onKeyPress()"';\r
+        sb[sb.length] = ' />';\r
+        */\r
+\r
+        sb[sb.length] = '&#160;';\r
+\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '<td>';\r
+        sb[sb.length] = '<a';\r
+        sb[sb.length] = ' id="' + this.labelElId + '"';\r
+        sb[sb.length] = ' class="' + this.labelStyle + '"';\r
+        sb[sb.length] = ' href="' + this.href + '"';\r
+        sb[sb.length] = ' target="' + this.target + '"';\r
+        sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';\r
+        if (this.hasChildren(true)) {\r
+            sb[sb.length] = ' onmouseover="document.getElementById(\'';\r
+            sb[sb.length] = this.getToggleElId() + '\').className=';\r
+            sb[sb.length] = getNode + '.getHoverStyle()"';\r
+            sb[sb.length] = ' onmouseout="document.getElementById(\'';\r
+            sb[sb.length] = this.getToggleElId() + '\').className=';\r
+            sb[sb.length] = getNode + '.getStyle()"';\r
+        }\r
+        sb[sb.length] = ' >';\r
+        sb[sb.length] = this.label;\r
+        sb[sb.length] = '</a>';\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '</tr>';\r
+        sb[sb.length] = '</table>';\r
 \r
-    sb[sb.length] = '&#160;';\r
-\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '<td>';\r
-    sb[sb.length] = '<a';\r
-    sb[sb.length] = ' id="' + this.labelElId + '"';\r
-    sb[sb.length] = ' class="' + this.labelStyle + '"';\r
-    sb[sb.length] = ' href="' + this.href + '"';\r
-    sb[sb.length] = ' target="' + this.target + '"';\r
-    sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';\r
-    if (this.hasChildren(true)) {\r
-        sb[sb.length] = ' onmouseover="document.getElementById(\'';\r
-        sb[sb.length] = this.getToggleElId() + '\').className=';\r
-        sb[sb.length] = getNode + '.getHoverStyle()"';\r
-        sb[sb.length] = ' onmouseout="document.getElementById(\'';\r
-        sb[sb.length] = this.getToggleElId() + '\').className=';\r
-        sb[sb.length] = getNode + '.getStyle()"';\r
-    }\r
-    sb[sb.length] = ' >';\r
-    sb[sb.length] = this.label;\r
-    sb[sb.length] = '</a>';\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '</tr>';\r
-    sb[sb.length] = '</table>';\r
-\r
-    return sb.join("");\r
-};\r
+        return sb.join("");\r
+    },\r
 \r
-/**\r
- * Executed when the label is clicked\r
- * @param me {Node} this node\r
- * @scope the anchor tag clicked\r
- * @return false to cancel the anchor click\r
- */\r
-YAHOO.widget.TextNode.prototype.onLabelClick = function(me) { \r
-    //return true;\r
-};\r
+    /**\r
+     * Executed when the label is clicked.  Fires the labelClick custom event.\r
+     * @method onLabelClick\r
+     * @param me {Node} this node\r
+     * @scope the anchor tag clicked\r
+     * @return false to cancel the anchor click\r
+     */\r
+    onLabelClick: function(me) { \r
+        return me.tree.fireEvent("labelClick", me);\r
+        //return true;\r
+    },\r
 \r
-YAHOO.widget.TextNode.prototype.toString = function() { \r
-    return "TextNode (" + this.index + ") " + this.label;\r
-};\r
+    toString: function() { \r
+        return "TextNode (" + this.index + ") " + this.label;\r
+    }\r
 \r
+});\r
 /**\r
  * A menu-specific implementation that differs from TextNode in that only \r
  * one sibling can be expanded at a time.\r
+ * @namespace YAHOO.widget\r
+ * @class MenuNode\r
  * @extends YAHOO.widget.TextNode\r
+ * @param oData {object} a string or object containing the data that will\r
+ * be used to render this node\r
+ * @param oParent {YAHOO.widget.Node} this node's parent node\r
+ * @param expanded {boolean} the initial expanded/collapsed state\r
  * @constructor\r
  */\r
 YAHOO.widget.MenuNode = function(oData, oParent, expanded) {\r
@@ -1650,31 +1873,29 @@ YAHOO.widget.MenuNode = function(oData, oParent, expanded) {
                this.setUpLabel(oData);\r
        }\r
 \r
-    /**\r
+    /*\r
      * Menus usually allow only one branch to be open at a time.\r
-     * @type boolean\r
      */\r
        this.multiExpand = false;\r
 \r
-    /**\r
-     * @private\r
-     */\r
 \r
 };\r
 \r
-YAHOO.widget.MenuNode.prototype = new YAHOO.widget.TextNode();\r
+YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {\r
 \r
-YAHOO.widget.MenuNode.prototype.toString = function() { \r
-    return "MenuNode (" + this.index + ") " + this.label;\r
-};\r
+    toString: function() { \r
+        return "MenuNode (" + this.index + ") " + this.label;\r
+    }\r
 \r
+});\r
 /**\r
  * This implementation takes either a string or object for the\r
  * oData argument.  If is it a string, we will use it for the display\r
  * of this node (and it can contain any html code).  If the parameter\r
  * is an object, we look for a parameter called "html" that will be\r
  * used for this node's display.\r
- *\r
+ * @namespace YAHOO.widget\r
+ * @class HTMLNode\r
  * @extends YAHOO.widget.Node\r
  * @constructor\r
  * @param oData {object} a string or object containing the data that will\r
@@ -1691,131 +1912,132 @@ YAHOO.widget.HTMLNode = function(oData, oParent, expanded, hasIcon) {
     }\r
 };\r
 \r
-YAHOO.widget.HTMLNode.prototype = new YAHOO.widget.Node();\r
+YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {\r
 \r
-/**\r
- * The CSS class for the html content container.  Defaults to ygtvhtml, but \r
- * can be overridden to provide a custom presentation for a specific node.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.contentStyle = "ygtvhtml";\r
+    /**\r
    * The CSS class for the html content container.  Defaults to ygtvhtml, but \r
    * can be overridden to provide a custom presentation for a specific node.\r
+     * @property contentStyle\r
    * @type string\r
    */\r
+    contentStyle: "ygtvhtml",\r
 \r
-/**\r
- * The generated id that will contain the data passed in by the implementer.\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.contentElId = null;\r
+    /**\r
    * The generated id that will contain the data passed in by the implementer.\r
+     * @property contentElId\r
    * @type string\r
    */\r
+    contentElId: null,\r
 \r
-/**\r
- * The HTML content to use for this node's display\r
- *\r
- * @type string\r
- */\r
-YAHOO.widget.HTMLNode.prototype.content = null;\r
+    /**\r
    * The HTML content to use for this node's display\r
+     * @property content\r
    * @type string\r
    */\r
+    content: null,\r
 \r
-/**\r
- * Sets up the node label\r
- *\r
- * @param {object} An html string or object containing an html property\r
- * @param {boolean} hasIcon determines if the node will be rendered with an\r
- * icon or not\r
- */\r
-YAHOO.widget.HTMLNode.prototype.initContent = function(oData, hasIcon) { \r
-    if (typeof oData == "string") {\r
-        oData = { html: oData };\r
-    }\r
+    /**\r
+     * Sets up the node label\r
+     * @property initContent\r
+     * @param {object} An html string or object containing an html property\r
+     * @param {boolean} hasIcon determines if the node will be rendered with an\r
+     * icon or not\r
+     */\r
+    initContent: function(oData, hasIcon) { \r
+        if (typeof oData == "string") {\r
+            oData = { html: oData };\r
+        }\r
+\r
+        this.html = oData.html;\r
+        this.contentElId = "ygtvcontentel" + this.index;\r
+        this.hasIcon = hasIcon;\r
 \r
-    this.html = oData.html;\r
-    this.contentElId = "ygtvcontentel" + this.index;\r
-    this.hasIcon = hasIcon;\r
+    },\r
 \r
     /**\r
-     * @private\r
+     * Returns the outer html element for this node's content\r
+     * @method getContentEl\r
+     * @return {HTMLElement} the element\r
      */\r
-};\r
-\r
-/**\r
- * Returns the outer html element for this node's content\r
- *\r
- * @return {HTMLElement} the element\r
- */\r
-YAHOO.widget.HTMLNode.prototype.getContentEl = function() { \r
-    return document.getElementById(this.contentElId);\r
-};\r
+    getContentEl: function() { \r
+        return document.getElementById(this.contentElId);\r
+    },\r
 \r
-// overrides YAHOO.widget.Node\r
-YAHOO.widget.HTMLNode.prototype.getNodeHtml = function() { \r
-    var sb = [];\r
+    // overrides YAHOO.widget.Node\r
+    getNodeHtml: function() { \r
+        var sb = [];\r
 \r
-    sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
-    sb[sb.length] = '<tr>';\r
-    \r
-    for (i=0;i<this.depth;++i) {\r
-        sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
-    }\r
+        sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
+        sb[sb.length] = '<tr>';\r
+        \r
+        for (var i=0;i<this.depth;++i) {\r
+            sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';\r
+        }\r
 \r
-    if (this.hasIcon) {\r
-        sb[sb.length] = '<td';\r
-        sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
-        sb[sb.length] = ' class="' + this.getStyle() + '"';\r
-        sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '"';\r
-        if (this.hasChildren(true)) {\r
-            sb[sb.length] = ' onmouseover="this.className=';\r
-            sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
-            sb[sb.length] = this.tree.id + '\',' + this.index +  ').getHoverStyle()"';\r
-            sb[sb.length] = ' onmouseout="this.className=';\r
-            sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
-            sb[sb.length] = this.tree.id + '\',' + this.index +  ').getStyle()"';\r
+        if (this.hasIcon) {\r
+            sb[sb.length] = '<td';\r
+            sb[sb.length] = ' id="' + this.getToggleElId() + '"';\r
+            sb[sb.length] = ' class="' + this.getStyle() + '"';\r
+            sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '"';\r
+            if (this.hasChildren(true)) {\r
+                sb[sb.length] = ' onmouseover="this.className=';\r
+                sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
+                sb[sb.length] = this.tree.id + '\',' + this.index +  ').getHoverStyle()"';\r
+                sb[sb.length] = ' onmouseout="this.className=';\r
+                sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
+                sb[sb.length] = this.tree.id + '\',' + this.index +  ').getStyle()"';\r
+            }\r
+            sb[sb.length] = '>&#160;</td>';\r
         }\r
-        sb[sb.length] = '>&#160;</td>';\r
-    }\r
 \r
-    sb[sb.length] = '<td';\r
-    sb[sb.length] = ' id="' + this.contentElId + '"';\r
-    sb[sb.length] = ' class="' + this.contentStyle + '"';\r
-    sb[sb.length] = ' >';\r
-    sb[sb.length] = this.html;\r
-    sb[sb.length] = '</td>';\r
-    sb[sb.length] = '</tr>';\r
-    sb[sb.length] = '</table>';\r
+        sb[sb.length] = '<td';\r
+        sb[sb.length] = ' id="' + this.contentElId + '"';\r
+        sb[sb.length] = ' class="' + this.contentStyle + '"';\r
+        sb[sb.length] = ' >';\r
+        sb[sb.length] = this.html;\r
+        sb[sb.length] = '</td>';\r
+        sb[sb.length] = '</tr>';\r
+        sb[sb.length] = '</table>';\r
 \r
-    return sb.join("");\r
-};\r
+        return sb.join("");\r
+    },\r
 \r
-YAHOO.widget.HTMLNode.prototype.toString = function() { \r
-    return "HTMLNode (" + this.index + ")";\r
-};\r
+    toString: function() { \r
+        return "HTMLNode (" + this.index + ")";\r
+    }\r
 \r
+});\r
 /**\r
  * A static factory class for tree view expand/collapse animations\r
- *\r
- * @constructor\r
+ * @class TVAnim\r
+ * @static\r
  */\r
 YAHOO.widget.TVAnim = function() {\r
     return {\r
         /**\r
          * Constant for the fade in animation\r
-         * \r
+         * @property FADE_IN\r
          * @type string\r
+         * @static\r
          */\r
         FADE_IN: "TVFadeIn",\r
 \r
         /**\r
          * Constant for the fade out animation\r
-         * \r
+         * @property FADE_OUT\r
          * @type string\r
+         * @static\r
          */\r
         FADE_OUT: "TVFadeOut",\r
 \r
         /**\r
          * Returns a ygAnim instance of the given type\r
-         *\r
+         * @method getAnim\r
          * @param type {string} the type of animation\r
          * @param el {HTMLElement} the element to element (probably the children div)\r
          * @param callback {function} function to invoke when the animation is done.\r
          * @return {YAHOO.util.Animation} the animation instance\r
+         * @static\r
          */\r
         getAnim: function(type, el, callback) {\r
             if (YAHOO.widget[type]) {\r
@@ -1827,9 +2049,10 @@ YAHOO.widget.TVAnim = function() {
 \r
         /**\r
          * Returns true if the specified animation class is available\r
-         *\r
+         * @method isValid\r
          * @param type {string} the type of animation\r
          * @return {boolean} true if valid, false if not\r
+         * @static\r
          */\r
         isValid: function(type) {\r
             return (YAHOO.widget[type]);\r
@@ -1839,7 +2062,7 @@ YAHOO.widget.TVAnim = function() {
 \r
 /**\r
  * A 1/2 second fade-in animation.\r
- *\r
+ * @class TVFadeIn\r
  * @constructor\r
  * @param el {HTMLElement} the element to animate\r
  * @param callback {function} function to invoke when the animation is finished\r
@@ -1847,26 +2070,25 @@ YAHOO.widget.TVAnim = function() {
 YAHOO.widget.TVFadeIn = function(el, callback) {\r
     /**\r
      * The element to animate\r
+     * @property el\r
      * @type HTMLElement\r
      */\r
     this.el = el;\r
 \r
     /**\r
      * the callback to invoke when the animation is complete\r
-     *\r
+     * @property callback\r
      * @type function\r
      */\r
     this.callback = callback;\r
 \r
-    /**\r
-     * @private\r
-     */\r
 };\r
 \r
-/**\r
- * Performs the animation\r
- */\r
 YAHOO.widget.TVFadeIn.prototype = {\r
+    /**\r
+     * Performs the animation\r
+     * @method animate\r
+     */\r
     animate: function() {\r
         var tvanim = this;\r
 \r
@@ -1875,13 +2097,7 @@ YAHOO.widget.TVFadeIn.prototype = {
         s.filter = "alpha(opacity=10)";\r
         s.display = "";\r
 \r
-        // var dur = ( navigator.userAgent.match(/msie/gi) ) ? 0.05 : 0.4;\r
         var dur = 0.4; \r
-        // var a = new ygAnim_Fade(this.el, dur, 1);\r
-        // a.setStart(0.1);\r
-        // a.onComplete = function() { tvanim.onComplete(); };\r
-\r
-        // var a = new YAHOO.util.Anim(this.el, 'opacity', 0.1, 1);\r
         var a = new YAHOO.util.Anim(this.el, {opacity: {from: 0.1, to: 1, unit:""}}, dur);\r
         a.onComplete.subscribe( function() { tvanim.onComplete(); } );\r
         a.animate();\r
@@ -1889,11 +2105,17 @@ YAHOO.widget.TVFadeIn.prototype = {
 \r
     /**\r
      * Clean up and invoke callback\r
+     * @method onComplete\r
      */\r
     onComplete: function() {\r
         this.callback();\r
     },\r
 \r
+    /**\r
+     * toString\r
+     * @method toString\r
+     * @return {string} the string representation of the instance\r
+     */\r
     toString: function() {\r
         return "TVFadeIn";\r
     }\r
@@ -1901,7 +2123,7 @@ YAHOO.widget.TVFadeIn.prototype = {
 \r
 /**\r
  * A 1/2 second fade out animation.\r
- *\r
+ * @class TVFadeOut\r
  * @constructor\r
  * @param el {HTMLElement} the element to animate\r
  * @param callback {Function} function to invoke when the animation is finished\r
@@ -1909,34 +2131,28 @@ YAHOO.widget.TVFadeIn.prototype = {
 YAHOO.widget.TVFadeOut = function(el, callback) {\r
     /**\r
      * The element to animate\r
+     * @property el\r
      * @type HTMLElement\r
      */\r
     this.el = el;\r
 \r
     /**\r
      * the callback to invoke when the animation is complete\r
-     *\r
+     * @property callback\r
      * @type function\r
      */\r
     this.callback = callback;\r
 \r
-    /**\r
-     * @private\r
-     */\r
 };\r
 \r
-/**\r
- * Performs the animation\r
- */\r
 YAHOO.widget.TVFadeOut.prototype = {\r
+    /**\r
+     * Performs the animation\r
+     * @method animate\r
+     */\r
     animate: function() {\r
         var tvanim = this;\r
-        // var dur = ( navigator.userAgent.match(/msie/gi) ) ? 0.05 : 0.4;\r
         var dur = 0.4;\r
-        // var a = new ygAnim_Fade(this.el, dur, 0.1);\r
-        // a.onComplete = function() { tvanim.onComplete(); };\r
-\r
-        // var a = new YAHOO.util.Anim(this.el, 'opacity', 1, 0.1);\r
         var a = new YAHOO.util.Anim(this.el, {opacity: {from: 1, to: 0.1, unit:""}}, dur);\r
         a.onComplete.subscribe( function() { tvanim.onComplete(); } );\r
         a.animate();\r
@@ -1944,6 +2160,7 @@ YAHOO.widget.TVFadeOut.prototype = {
 \r
     /**\r
      * Clean up and invoke callback\r
+     * @method onComplete\r
      */\r
     onComplete: function() {\r
         var s = this.el.style;\r
@@ -1953,6 +2170,11 @@ YAHOO.widget.TVFadeOut.prototype = {
         this.callback();\r
     },\r
 \r
+    /**\r
+     * toString\r
+     * @method toString\r
+     * @return {string} the string representation of the instance\r
+     */\r
     toString: function() {\r
         return "TVFadeOut";\r
     }\r
diff --git a/lib/yui/yahoo-dom-event/README b/lib/yui/yahoo-dom-event/README
new file mode 100755 (executable)
index 0000000..0843c0c
--- /dev/null
@@ -0,0 +1,23 @@
+yahoo-event-dom.js Release Notes\r
+\r
+*** version 0.12.0 ***\r
+\r
+The yahoo-event-dom.js file rolls up the three most commonly-used YUI Utilities\r
+into a single file; it includes the following files:\r
+\r
+* Yahoo Global Object\r
+* Event\r
+* Dom\r
+\r
+These three files serve as a common foundation for most YUI components and\r
+third-party implementations.  On pages where you do not need additional YUI\r
+Utilities (Connection Manager, Animation Utility, Drag & Drop Utility), the\r
+yahoo-event-dom.js aggregate will often be an optimal choice.\r
+\r
+Note: If you do require additional utilities, the full utilities.js file is\r
+provided in this distribution; utilities.js includes all YUI Utilities in a\r
+single file.\r
+\r
+Please see the blog article on www.yuiblog.com titled "YUI: Weighing in on\r
+Pageweights" at http://yuiblog.com/blog/2006/10/16/pageweight-yui0114/ for more\r
+details.\r
diff --git a/lib/yui/yahoo-dom-event/yahoo-dom-event.js b/lib/yui/yahoo-dom-event/yahoo-dom-event.js
new file mode 100755 (executable)
index 0000000..eaaa22c
--- /dev/null
@@ -0,0 +1 @@
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.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){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;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;break;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(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}return collection;}return null;},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'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}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';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||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){var region=new 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){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');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;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[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;}};})();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(x instanceof Array){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.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};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 _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){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],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,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],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},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(e){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){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;el.id=id;}return id;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[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=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}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];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{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(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};
\ No newline at end of file
index 44207c1383462f72bd3bdc6c1b8868823e4392b0..3b38b352fe74a55887f8a8247e03c3dd6e67bd86 100755 (executable)
@@ -1,10 +1,37 @@
 YAHOO Global Namespace - Release Notes\r
 \r
+0.12.0\r
+\r
+   * Added YAHOO.augment, which copies all or part of the prototype of one\r
+     object to another.  \r
+\r
+   * YAHOO.namespace now can create multiple namespaces.\r
+\r
+   * Added an optional third parameter to YAHOO.extend: overrides.  It takes\r
+     an object literal of properties/methods to apply to the subclass\r
+     prototype, overriding the superclass if present.\r
+\r
+0.11.4\r
+\r
+   * Changed window.YAHOO = window.YAHOO || {} to \r
+     if (typeof YAHOO == "undefined") YAHOO = {} because the previous statement\r
+     contributed to a memory leak in IE6 when the library was hosted in an \r
+     iframe.\r
+\r
+0.11.3\r
+\r
+   * Changed var YAHOO = window.YAHOO || {} to window.YAHOO = window.YAHOO || {}.\r
+     This fixes an issue in IE where YAHOO would get overwritten if previously\r
+     defined via array notation (window["YAHOO"]).\r
+\r
 0.11.0\r
+\r
    * Added YAHOO.extend, which provides an easy way to assign the prototype,\r
      constructor, and superclass properties inheritance properties.  It also\r
      prevents the constructor of the superclass from being exectuted twice.\r
 \r
 0.10.0\r
+\r
    * Added YAHOO.log that provides a safe way to plumb logging statements in\r
      code that will work if the logging component isn't available.\r
+\r
index 0bf2365cfc4be0a23c678426f6b42a31b0e641a8..5fa147e6c5155992ef1104f55453278f680ab6f2 100755 (executable)
@@ -1,61 +1,81 @@
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
+*/\r
 \r
-/*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
-*/ \r
+/**\r
+ * The YAHOO object is the single global object used by YUI Library.  It\r
+ * contains utility function for setting up namespaces, inheritance, and\r
+ * logging.  YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces\r
+ * created automatically for and used by the library.\r
+ * @module yahoo\r
+ * @title  YAHOO Global\r
+ */\r
 \r
 /**\r
- * The Yahoo global namespace\r
- * @constructor\r
+ * The YAHOO global namespace object\r
+ * @class YAHOO\r
+ * @static\r
  */\r
-var YAHOO = window.YAHOO || {};\r
+if (typeof YAHOO == "undefined") {\r
+    var YAHOO = {};\r
+}\r
 \r
 /**\r
  * Returns the namespace specified and creates it if it doesn't exist\r
- *\r
+ * <pre>\r
  * YAHOO.namespace("property.package");\r
  * YAHOO.namespace("YAHOO.property.package");\r
- *\r
+ * </pre>\r
  * Either of the above would create YAHOO.property, then\r
  * YAHOO.property.package\r
  *\r
- * @param  {String} ns The name of the namespace\r
- * @return {Object}    A reference to the namespace object\r
+ * Be careful when naming packages. Reserved words may work in some browsers\r
+ * and not others. For instance, the following will fail in Safari:\r
+ * <pre>\r
+ * YAHOO.namespace("really.long.nested.namespace");\r
+ * </pre>\r
+ * This fails because "long" is a future reserved word in ECMAScript\r
+ *\r
+ * @method namespace\r
+ * @static\r
+ * @param  {String*} arguments 1-n namespaces to create\r
+ * @return {Object}  A reference to the last namespace object created\r
  */\r
-YAHOO.namespace = function(ns) {\r
+YAHOO.namespace = function() {\r
+    var a=arguments, o=null, i, j, d;\r
+    for (i=0; i<a.length; ++i) {\r
+        d=a[i].split(".");\r
+        o=YAHOO;\r
 \r
-    if (!ns || !ns.length) {\r
-        return null;\r
+        // YAHOO is implied, so it is ignored if it is included\r
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {\r
+            o[d[j]]=o[d[j]] || {};\r
+            o=o[d[j]];\r
+        }\r
     }\r
 \r
-    var levels = ns.split(".");\r
-    var nsobj = YAHOO;\r
-\r
-    // YAHOO is implied, so it is ignored if it is included\r
-    for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {\r
-        nsobj[levels[i]] = nsobj[levels[i]] || {};\r
-        nsobj = nsobj[levels[i]];\r
-    }\r
-\r
-    return nsobj;\r
+    return o;\r
 };\r
 \r
 /**\r
  * Uses YAHOO.widget.Logger to output a log message, if the widget is available.\r
  *\r
- * @param  {string}  sMsg       The message to log.\r
- * @param  {string}  sCategory  The log category for the message.  Default\r
- *                              categories are "info", "warn", "error", time".\r
- *                              Custom categories can be used as well. (opt)\r
- * @param  {string}  sSource    The source of the the message (opt)\r
- * @return {boolean}            True if the log operation was successful.\r
+ * @method log\r
+ * @static\r
+ * @param  {String}  msg  The message to log.\r
+ * @param  {String}  cat  The log category for the message.  Default\r
+ *                        categories are "info", "warn", "error", time".\r
+ *                        Custom categories can be used as well. (opt)\r
+ * @param  {String}  src  The source of the the message (opt)\r
+ * @return {Boolean}      True if the log operation was successful.\r
  */\r
-YAHOO.log = function(sMsg, sCategory, sSource) {\r
-    var l = YAHOO.widget.Logger;\r
+YAHOO.log = function(msg, cat, src) {\r
+    var l=YAHOO.widget.Logger;\r
     if(l && l.log) {\r
-        return l.log(sMsg, sCategory, sSource);\r
+        return l.log(msg, cat, src);\r
     } else {\r
         return false;\r
     }\r
@@ -65,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
  * Utility to set up the prototype, constructor and superclass properties to\r
  * support an inheritance strategy that can chain constructors and methods.\r
  *\r
- * @param {Function} subclass   the object to modify\r
- * @param {Function} superclass the object to inherit\r
+ * @method extend\r
+ * @static\r
+ * @param {Function} subc   the object to modify\r
+ * @param {Function} superc the object to inherit\r
+ * @param {String[]} overrides  additional properties/methods to add to the\r
+ *                              subclass prototype.  These will override the\r
+ *                              matching items obtained from the superclass\r
+ *                              if present.\r
  */\r
-YAHOO.extend = function(subclass, superclass) {\r
-    var f = function() {};\r
-    f.prototype = superclass.prototype;\r
-    subclass.prototype = new f();\r
-    subclass.prototype.constructor = subclass;\r
-    subclass.superclass = superclass.prototype;\r
-    if (superclass.prototype.constructor == Object.prototype.constructor) {\r
-        superclass.prototype.constructor = superclass;\r
+YAHOO.extend = function(subc, superc, overrides) {\r
+    var F = function() {};\r
+    F.prototype=superc.prototype;\r
+    subc.prototype=new F();\r
+    subc.prototype.constructor=subc;\r
+    subc.superclass=superc.prototype;\r
+    if (superc.prototype.constructor == Object.prototype.constructor) {\r
+        superc.prototype.constructor=superc;\r
+    }\r
+\r
+    if (overrides) {\r
+        for (var i in overrides) {\r
+            subc.prototype[i]=overrides[i];\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Applies all prototype properties in the supplier to the receiver if the\r
+ * receiver does not have these properties yet.  Optionally, one or more\r
+ * methods/properties can be specified (as additional parameters).  This\r
+ * option will overwrite the property if receiver has it already.\r
+ *\r
+ * @method augment\r
+ * @static\r
+ * @param {Function} r  the object to receive the augmentation\r
+ * @param {Function} s  the object that supplies the properties to augment\r
+ * @param {String*}  arguments zero or more properties methods to augment the\r
+ *                             receiver with.  If none specified, everything\r
+ *                             in the supplier will be used unless it would\r
+ *                             overwrite an existing property in the receiver\r
+ */\r
+YAHOO.augment = function(r, s) {\r
+    var rp=r.prototype, sp=s.prototype, a=arguments, i, p;\r
+    if (a[2]) {\r
+        for (i=2; i<a.length; ++i) {\r
+            rp[a[i]] = sp[a[i]];\r
+        }\r
+    } else {\r
+        for (p in sp) {\r
+            if (!rp[p]) {\r
+                rp[p] = sp[p];\r
+            }\r
+        }\r
     }\r
 };\r
 \r
-YAHOO.namespace("util");\r
-YAHOO.namespace("widget");\r
-YAHOO.namespace("example");\r
+YAHOO.namespace("util", "widget", "example");\r
 \r
index a2ef7c6f465ecd675304773d5e2f0fdd71a4aed2..d79c5cd8f06d35d0118706034b02aea121487cb5 100755 (executable)
@@ -1 +1 @@
-/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.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){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");
\ No newline at end of file
index 74aed9574bd84cdc71cc0ca772d20c17f606f985..8a44a91ba4e69e28b97e9d427e437795ca98913f 100755 (executable)
@@ -1,60 +1,81 @@
 /*                                                                                                                                                      \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    \r
-Code licensed under the BSD License:                                                                                                                    \r
-http://developer.yahoo.net/yui/license.txt                                                                                                              \r
-version: 0.11.0                                                                                                                                         \r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.0\r
 */ \r
 \r
 /**\r
- * The Yahoo global namespace\r
- * @constructor\r
+ * The YAHOO object is the single global object used by YUI Library.  It\r
+ * contains utility function for setting up namespaces, inheritance, and\r
+ * logging.  YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces\r
+ * created automatically for and used by the library.\r
+ * @module yahoo\r
+ * @title  YAHOO Global\r
  */\r
-var YAHOO = window.YAHOO || {};\r
+\r
+/**\r
+ * The YAHOO global namespace object\r
+ * @class YAHOO\r
+ * @static\r
+ */\r
+if (typeof YAHOO == "undefined") {\r
+    var YAHOO = {};\r
+}\r
 \r
 /**\r
  * Returns the namespace specified and creates it if it doesn't exist\r
- *\r
+ * <pre>\r
  * YAHOO.namespace("property.package");\r
  * YAHOO.namespace("YAHOO.property.package");\r
- *\r
+ * </pre>\r
  * Either of the above would create YAHOO.property, then\r
  * YAHOO.property.package\r
  *\r
- * @param  {String} ns The name of the namespace\r
- * @return {Object}    A reference to the namespace object\r
+ * Be careful when naming packages. Reserved words may work in some browsers\r
+ * and not others. For instance, the following will fail in Safari:\r
+ * <pre>\r
+ * YAHOO.namespace("really.long.nested.namespace");\r
+ * </pre>\r
+ * This fails because "long" is a future reserved word in ECMAScript\r
+ *\r
+ * @method namespace\r
+ * @static\r
+ * @param  {String*} arguments 1-n namespaces to create \r
+ * @return {Object}  A reference to the last namespace object created\r
  */\r
-YAHOO.namespace = function(ns) {\r
-\r
-    if (!ns || !ns.length) {\r
-        return null;\r
-    }\r
-\r
-    var levels = ns.split(".");\r
-    var nsobj = YAHOO;\r
+YAHOO.namespace = function() {\r
+    var a=arguments, o=null, i, j, d;\r
+    for (i=0; i<a.length; ++i) {\r
+        d=a[i].split(".");\r
+        o=YAHOO;\r
 \r
-    // YAHOO is implied, so it is ignored if it is included\r
-    for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {\r
-        nsobj[levels[i]] = nsobj[levels[i]] || {};\r
-        nsobj = nsobj[levels[i]];\r
+        // YAHOO is implied, so it is ignored if it is included\r
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {\r
+            o[d[j]]=o[d[j]] || {};\r
+            o=o[d[j]];\r
+        }\r
     }\r
 \r
-    return nsobj;\r
+    return o;\r
 };\r
 \r
 /**\r
  * Uses YAHOO.widget.Logger to output a log message, if the widget is available.\r
  *\r
- * @param  {string}  sMsg       The message to log.\r
- * @param  {string}  sCategory  The log category for the message.  Default\r
- *                              categories are "info", "warn", "error", time".\r
- *                              Custom categories can be used as well. (opt)\r
- * @param  {string}  sSource    The source of the the message (opt)\r
- * @return {boolean}            True if the log operation was successful.\r
+ * @method log\r
+ * @static\r
+ * @param  {String}  msg  The message to log.\r
+ * @param  {String}  cat  The log category for the message.  Default\r
+ *                        categories are "info", "warn", "error", time".\r
+ *                        Custom categories can be used as well. (opt)\r
+ * @param  {String}  src  The source of the the message (opt)\r
+ * @return {Boolean}      True if the log operation was successful.\r
  */\r
-YAHOO.log = function(sMsg, sCategory, sSource) {\r
-    var l = YAHOO.widget.Logger;\r
+YAHOO.log = function(msg, cat, src) {\r
+    var l=YAHOO.widget.Logger;\r
     if(l && l.log) {\r
-        return l.log(sMsg, sCategory, sSource);\r
+        return l.log(msg, cat, src);\r
     } else {\r
         return false;\r
     }\r
@@ -64,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
  * Utility to set up the prototype, constructor and superclass properties to\r
  * support an inheritance strategy that can chain constructors and methods.\r
  *\r
- * @param {Function} subclass   the object to modify\r
- * @param {Function} superclass the object to inherit\r
+ * @method extend\r
+ * @static\r
+ * @param {Function} subc   the object to modify\r
+ * @param {Function} superc the object to inherit\r
+ * @param {String[]} overrides  additional properties/methods to add to the\r
+ *                              subclass prototype.  These will override the\r
+ *                              matching items obtained from the superclass \r
+ *                              if present.\r
  */\r
-YAHOO.extend = function(subclass, superclass) {\r
-    var f = function() {};\r
-    f.prototype = superclass.prototype;\r
-    subclass.prototype = new f();\r
-    subclass.prototype.constructor = subclass;\r
-    subclass.superclass = superclass.prototype;\r
-    if (superclass.prototype.constructor == Object.prototype.constructor) {\r
-        superclass.prototype.constructor = superclass;\r
+YAHOO.extend = function(subc, superc, overrides) {\r
+    var F = function() {};\r
+    F.prototype=superc.prototype;\r
+    subc.prototype=new F();\r
+    subc.prototype.constructor=subc;\r
+    subc.superclass=superc.prototype;\r
+    if (superc.prototype.constructor == Object.prototype.constructor) {\r
+        superc.prototype.constructor=superc;\r
+    }\r
+\r
+    if (overrides) {\r
+        for (var i in overrides) {\r
+            subc.prototype[i]=overrides[i];\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Applies all prototype properties in the supplier to the receiver if the\r
+ * receiver does not have these properties yet.  Optionally, one or more\r
+ * methods/properties can be specified (as additional parameters).  This\r
+ * option will overwrite the property if receiver has it already.\r
+ *\r
+ * @method augment\r
+ * @static\r
+ * @param {Function} r  the object to receive the augmentation\r
+ * @param {Function} s  the object that supplies the properties to augment\r
+ * @param {String*}  arguments zero or more properties methods to augment the\r
+ *                             receiver with.  If none specified, everything\r
+ *                             in the supplier will be used unless it would\r
+ *                             overwrite an existing property in the receiver\r
+ */\r
+YAHOO.augment = function(r, s) {\r
+    var rp=r.prototype, sp=s.prototype, a=arguments, i, p;\r
+    if (a[2]) {\r
+        for (i=2; i<a.length; ++i) {\r
+            rp[a[i]] = sp[a[i]];\r
+        }\r
+    } else {\r
+        for (p in sp) { \r
+            if (!rp[p]) {\r
+                rp[p] = sp[p];\r
+            }\r
+        }\r
     }\r
 };\r
 \r
-YAHOO.namespace("util");\r
-YAHOO.namespace("widget");\r
-YAHOO.namespace("example");\r
+YAHOO.namespace("util", "widget", "example");\r
 \r